Package org.ontoware.rdf2go.model.node.impl

Examples of org.ontoware.rdf2go.model.node.impl.URIImpl


 
  @Test
  public void testMapping() {
   
    JPackage jp = new JPackage("Package");
    JClass root = new JClass(jp,"Rootclass", new URIImpl("urn:java:class.Rootclass"));
    JModel jm = new JModel(root);
   
    URI testURI = new URIImpl("urn:test:classX");
    JClass testClass = new JClass(jp,"Testclass", testURI);
   
    jm.addMapping( testURI, testClass );
   
    Assert.assertNotNull(jm.getMapping(testURI));
View Full Code Here


   * @throws ModelRuntimeException if URI syntax is wrong
   *
   * [Generated from RDFReactor template rule #c7]
   */
  public Resource ( Model model, String uriString, boolean write) throws ModelRuntimeException {
    super(model, RDFS_CLASS, new URIImpl(uriString,false), write);
  }
View Full Code Here

   * @throws ModelRuntimeException if URI syntax is wrong
   *
   * [Generated from RDFReactor template rule #c7]
   */
  public Bag ( Model model, String uriString, boolean write) throws ModelRuntimeException {
    super(model, RDFS_CLASS, new URIImpl(uriString,false), write);
  }
View Full Code Here

   * @throws ModelRuntimeException if URI syntax is wrong
   *
   * [Generated from RDFReactor template rule #c7]
   */
  public Container ( Model model, String uriString, boolean write) throws ModelRuntimeException {
    super(model, RDFS_CLASS, new URIImpl(uriString,false), write);
  }
View Full Code Here

    // replace model with RDFS based one
    this.model.close();
    this.model = getModelFactory().createModel(Reasoning.rdfs);
    this.model.open();
   
    URI resourceA = new URIImpl("urn:resource:A");
    URI resourceB = new URIImpl("urn:resource:B");
    URI propertyA = new URIImpl("urn:prop:A");
    URI propertyB = new URIImpl("urn:prop:B");
    URI propertyC = new URIImpl("urn:prop:C");
   
    this.model.addStatement(propertyA, propertyB, propertyC);
    this.model.addStatement(propertyB, RDFS.subPropertyOf, RDFS.subPropertyOf);
    Assert.assertTrue(this.model.contains(propertyA, RDFS.subPropertyOf, propertyC));
   
View Full Code Here

    Assert.assertTrue(this.model.contains(resourceA, propertyC, resourceB));
  }
 
  @Test
  public void testSimpleQuery1() throws Exception {
    URI a = new URIImpl("test://a");
    URI b = new URIImpl("test://b");
    URI c = new URIImpl("test://c");
    this.model.addStatement(a, b, c);
    ClosableIterator<? extends Statement> it = this.model.findStatements(a, b, c);
    assertTrue(it.hasNext());
    it.close();
  }
View Full Code Here

    it.close();
  }
 
  @Test
  public void testSimpleQuery() throws Exception {
    URI a = new URIImpl("test://a");
    URI b = new URIImpl("test://b");
    URI c = new URIImpl("test://c");
    this.model.addStatement(a, b, c);
    assertEquals(1, this.model.size());
   
    ClosableIterator<? extends Statement> it = this.model.findStatements(Variable.ANY, b, c);
    assertTrue(it.hasNext());
View Full Code Here

    Model a = getModelFactory().createModel();
    a.open();
    Model b = getModelFactory().createModel();
    b.open();
   
    a.addStatement(new URIImpl("urn:test:a", false), new URIImpl("urn:test:b", false),
            new URIImpl("urn:test:c", false));
    b.addStatement(new URIImpl("urn:test:x", false), new URIImpl("urn:test:y", false),
            new URIImpl("urn:test:z", false));
    Diff diff = a.getDiff(b.iterator());
    assertTrue(diff.getAdded().iterator().hasNext());
    assertTrue(diff.getRemoved().iterator().hasNext());
    a.close();
    b.close();
View Full Code Here

    Model a = getModelFactory().createModel();
    a.open();
    Model b = getModelFactory().createModel();
    b.open();
   
    a.addStatement(new URIImpl("urn:test:a", false), new URIImpl("urn:test:b", false),
            new URIImpl("urn:test:c", false));
   
    b.addStatement(new URIImpl("urn:test:a", false), new URIImpl("urn:test:b", false),
            new URIImpl("urn:test:c", false));
   
    ClosableIterator<Statement> i = a.iterator();
    Statement aStmt = i.next();
    i.close();
    i = b.iterator();
View Full Code Here

    Model a = getModelFactory().createModel();
    a.open();
    Model b = getModelFactory().createModel();
    b.open();
   
    a.addStatement(new URIImpl("urn:test:a", false), new URIImpl("urn:test:b", false),
            new URIImpl("urn:test:c", false));
   
    ClosableIterator<Statement> i = a.iterator();
    Statement aStmt = i.next();
    i.close();
   
    assertEquals(0, aStmt.compareTo(aStmt));
   
    b.addStatement(new URIImpl("urn:test:a", false), new URIImpl("urn:test:b", false),
            new URIImpl("urn:test:c", false));
    i = b.iterator();
    Statement bStmt = i.next();
    i.close();
   
    assertEquals(0, aStmt.compareTo(bStmt));
View Full Code Here

TOP

Related Classes of org.ontoware.rdf2go.model.node.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.