Examples of URIImpl


Examples of org.openrdf.model.impl.URIImpl

    mboxAlice = vf.createLiteral("alice@example.org");
    mboxBob = vf.createLiteral("bob@example.org");

    Александър = vf.createLiteral("Александър");

    unknownContext = new URIImpl("urn:unknownContext");

    context1 = vf.createURI("urn:x-local:graph1");
    context2 = vf.createURI("urn:x-local:graph2");
  }
View Full Code Here

Examples of org.openrdf.model.impl.URIImpl

  }

  public void testTransactionIsolation()
    throws Exception
  {
    URI bob = new URIImpl("urn:test:bob");
    testCon.begin();
    testCon.add(bob, name, nameBob);

    assertTrue(testCon.hasMatch(bob, name, nameBob, false));
    assertFalse(testCon2.hasMatch(bob, name, nameBob, false));
View Full Code Here

Examples of org.openrdf.model.impl.URIImpl

    URI guernica = vf.createURI(EXAMPLE_NS, GUERNICA);

    context1 = vf.createURI(EXAMPLE_NS, CONTEXT_1);
    context2 = vf.createURI(EXAMPLE_NS, CONTEXT_2);

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

    Thread.sleep(2000); // increase modified age
    assertEquals(0, testCon.sizeMatch(null, null, null, false));
    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 }))
          {
            assertEquals(0, testCon.sizeMatch(subj, pred, obj, false, ctx));
          }
        }
      }
    }

    // Add some data to the repository
    testCon.begin();
    testCon.add(painter, RDF.TYPE, RDFS.CLASS);
    testCon.add(painting, RDF.TYPE, RDFS.CLASS);
    testCon.add(picasso, RDF.TYPE, painter, context1);
    testCon.add(guernica, RDF.TYPE, painting, context1);
    testCon.add(picasso, paints, guernica, context1);
    testCon.commit();

    Thread.sleep(1000); // increase modified age
    assertEquals(5, testCon.sizeMatch(null, null, null, false));
    assertEquals(5, testCon.sizeMatch(null, null, null, false));
    assertEquals(3, testCon.sizeMatch(null, null, null, false, context1));
    assertEquals(4, testCon.sizeMatch(null, RDF.TYPE, null, false));
    assertEquals(1, testCon.sizeMatch(null, paints, null, false));
    assertEquals(2, testCon.sizeMatch(picasso, null, null, false));
    assertEquals(2, testCon.sizeMatch(picasso, null, null, false));

    assertEquals(0, testCon.sizeMatch(null, null, null, false, unknownContext));
    assertEquals(0, testCon.sizeMatch(null, picasso, null, false));

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

    assertEquals(3, testCon.sizeMatch(null, null, null, false, uriImplContext1));
  }
View Full Code Here

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)));
    }
    String EXAMPLE_NS = "urn:test:";
    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

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)));
    }
    String EXAMPLE_NS = "urn:test:";
    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

Examples of org.openrdf.model.impl.URIImpl

    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < 5120; i++) {
      sb.append(Character.toChars('A' + (i % 26)));
    }
    String EXAMPLE_NS = "urn:test:";
    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

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)));
    }
    String EXAMPLE_NS = "urn:test:";
    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

Examples of org.openrdf.model.impl.URIImpl

  }

  public void testValueRoundTrip1()
    throws Exception
  {
    URI subj = new URIImpl(EXAMPLE_NS + PICASSO);
    URI pred = new URIImpl(EXAMPLE_NS + PAINTS);
    URI obj = new URIImpl(EXAMPLE_NS + GUERNICA);

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

Examples of org.openrdf.model.impl.URIImpl

  public void testValueRoundTrip2()
    throws Exception
  {
    BNode subj = vf.createBNode();
    URI pred = new URIImpl(EXAMPLE_NS + PAINTS);
    URI obj = new URIImpl(EXAMPLE_NS + GUERNICA);

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

Examples of org.openrdf.model.impl.URIImpl

  }

  public void testValueRoundTrip3()
    throws Exception
  {
    URI subj = new URIImpl(EXAMPLE_NS + PICASSO);
    URI pred = new URIImpl(EXAMPLE_NS + PAINTS);
    Literal obj = new LiteralImpl("guernica");

    testValueRoundTrip(subj, pred, obj);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.