Package org.openrdf.model.impl

Examples of org.openrdf.model.impl.URIImpl


  {
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < 512; i++) {
      sb.append(Character.toChars('A' + (i % 26)));
    }
    URI subj = new URIImpl(EXAMPLE_NS + PICASSO);
    URI pred = new URIImpl(EXAMPLE_NS + PAINTS);
    URI obj = new URIImpl(EXAMPLE_NS + GUERNICA + sb.toString());

    testValueRoundTrip(subj, pred, obj);
  }
View Full Code Here


  {
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < 512; i++) {
      sb.append(Character.toChars('A' + (i % 26)));
    }
    URI subj = new URIImpl(EXAMPLE_NS + PICASSO);
    URI pred = new URIImpl(EXAMPLE_NS + PAINTS);
    Literal obj = new LiteralImpl("guernica" + sb.toString());

    testValueRoundTrip(subj, pred, obj);
  }
View Full Code Here

  {
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < 1024000; i++) {
      sb.append(Character.toChars('A' + (i % 26)));
    }
    URI subj = new URIImpl(EXAMPLE_NS + PICASSO);
    URI pred = new URIImpl(EXAMPLE_NS + PAINTS);
    Literal obj = new LiteralImpl("guernica" + sb.toString());

    testValueRoundTrip(subj, pred, obj);
  }
View Full Code Here

  {
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < 512; i++) {
      sb.append(Character.toChars('A' + (i % 26)));
    }
    URI subj = new URIImpl(EXAMPLE_NS + PICASSO);
    URI pred = new URIImpl(EXAMPLE_NS + PAINTS);
    Literal obj = new LiteralImpl("guernica" + sb.toString(), "es");

    testValueRoundTrip(subj, pred, obj);
  }
View Full Code Here

    assertEquals(3, con.size(null, null, null, false, context1));
    assertEquals(4, con.size(null, RDF.TYPE, null, false));
    assertEquals(1, con.size(null, paints, null, false));
    assertEquals(2, con.size(picasso, null, null, false));

    URI unknownContext = new URIImpl(EXAMPLE_NS + "unknown");

    assertEquals(0, con.size(null, null, null, false, unknownContext));
    assertEquals(0, con.size(null, picasso, null, false));

    URIImpl uriImplContext1 = new URIImpl(context1.toString());

    assertEquals(3, con.size(null, null, null, false, uriImplContext1));
  }
View Full Code Here

  }

  private void assertEmpty(SailConnection con)
    throws StoreException
  {
    URI unknownContext = new URIImpl(EXAMPLE_NS + "unknown");
    for (Resource subj : Arrays.asList(null, picasso)) {
      for (URI pred : Arrays.asList(null, paints, RDF.TYPE)) {
        for (Value obj : Arrays.asList(null, guernica)) {
          for (Resource[] ctx : Arrays.asList(new Resource[0], new Resource[] { context1 },
              new Resource[] { unknownContext }))
View Full Code Here

    public void testExtractPageMeta() throws RepositoryException {
        assertExtract("/html/html-head-meta-extractor.html");
        assertModelNotEmpty();
        assertStatementsSize(null, null, null, 7);
        assertContains(
                new URIImpl("http://bob.example.com/"),
                new URIImpl("http://purl.org/dc/elements/1.1/title"),
                "XHTML+RDFa example",
                "en"
        );
         assertContains(
                new URIImpl("http://bob.example.com/"),
                new URIImpl("http://purl.org/dc/elements/1.1/language"),
                "en",
                "en"
        );
        assertContains(
                new URIImpl("http://bob.example.com/"),
                new URIImpl("http://purl.org/dc/elements/1.1/subject"),
                "XHTML+RDFa, semantic web",
                "en"
        );
        assertContains(
                new URIImpl("http://bob.example.com/"),
                new URIImpl("http://purl.org/dc/elements/1.1/format"),
                "application/xhtml+xml",
                "en"
        );
        assertContains(
                new URIImpl("http://bob.example.com/"),
                new URIImpl("http://purl.org/dc/elements/1.1/description"),
                "Example for Extensible Hypertext Markup Language + Resource Description Framework – in – attributes.",
                "en"
        );
        assertContains(
                new URIImpl("http://bob.example.com/"),
                new URIImpl(vSINDICE.NAMESPACE.toString() + "robots"),
                "index, follow",
                "en"
        );
        assertContains(
                new URIImpl("http://bob.example.com/"),
                new URIImpl(vSINDICE.NAMESPACE.toString() + "content-language"),
                "en",
                "en"
        );
    }
View Full Code Here

                    null
            );
        } else {
            URI literalType = null;
            try {
                literalType = new URIImpl(lt.value);
            } catch (Exception e) {
                reportError( String.format("Error while parsing literal type '%s'", lt.value), row, col );
            }
            return createLiteral(
                    validateAndNormalizeLiteral(value, literalType),
View Full Code Here

public class InferenceBug {

  @Test
  //@Ignore("due to http://openrdf.org/issues/browse/SES-521")
  public void testAddInferredStatementExplicitly() throws RepositoryException {
    URI a = new URIImpl("urn:rel:a");
    URI b = new URIImpl("urn:rel:b");
    URI c = new URIImpl("urn:rel:c");
    URI defaultContext = null;
    // create a Sail stack
    Sail sail = new MemoryStore();
    sail = new ForwardChainingRDFSInferencer(sail);
    // create a Repository
View Full Code Here

      repository.initialize();
    } catch (RepositoryException e) {
      throw new RuntimeException(e);
    }

    URI a = new URIImpl("urn:test:a");
    URI b = new URIImpl("urn:test:b");
    URI c = new URIImpl("urn:test:c");
    URI d = new URIImpl("urn:test:d");
    URI nrlInverse = ForwardChainingRDFSPlusInverseInferencerConnection.NRL_InverseProperty;

    repository.getConnection().add(a, b, c, new Resource[0]);

    Assert.assertFalse(repository.getConnection().hasStatement(c, d, a,
View Full Code Here

TOP

Related Classes of org.openrdf.model.impl.URIImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.