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

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


  @Before
  public void setUp() throws Exception {
    this.model = RDF2Go.getModelFactory().createModel();
    this.model.open();
    this.model.removeAll();
    this.instanceURI = new URIImpl("data://person-1");
  }
View Full Code Here


    this.model.removeAll();
    this.instanceURI = new URIImpl("data://person-1");
  }

  public void testTyping() throws Exception {
    URI jim = new URIImpl("data://jim");
    Person p = new Person(this.model, jim, true);
    Assert.assertTrue(this.model.contains(jim, RDF.type, Person.PERSON));
  }
View Full Code Here

  }

  public void testHashCode() throws ModelRuntimeException {
    Person p1 = new Person(this.model, this.instanceURI, true);
    Person p2 = new Person(this.model, this.instanceURI, true);
    Person p3 = new Person(this.model, new URIImpl("test://otheruri"), true);
    assertEquals(p1.hashCode(), p2.hashCode());
    assertNotSame(p1.hashCode(), p3.hashCode());
  }
View Full Code Here

   * Class under test for boolean equals(Object)
   */
  public void testEqualsObject() throws ModelRuntimeException {
    Person p1 = new Person(this.model, this.instanceURI, true);
    Person p2 = new Person(this.model, this.instanceURI, true);
    Person p3 = new Person(this.model, new URIImpl("test://otheruri"), true);
    assertEquals(p1, p2);
    assertNotSame(p1, p3);
  }
View Full Code Here

  @Ignore("outdated")
  @Test
  public void testAdd() throws Exception {
    // create Person p
    Person p = new Person(this.model, new URIImpl("data://jim"), true);
    assertTrue("model contains a Person after add", this.model.contains(p
        .getResource(), RDF.type, Person.PERSON));

    // set name
    p.setName("Jim");

    assert this.model.contains(p.getResource(), RDF.type, Person.PERSON);
    assert this.model.contains(p.getResource(), Person.NAME, "Jim");

    // create Persons q1 and q2
    Person q1 = new Person(this.model, new URIImpl("data://jon"), true);
    q1.setName("Jon");
    Person q2 = new Person(this.model, new URIImpl("data://joe"), true);
    q2.setName("Joe");

    // add friends
    assertEquals(0, p.getAllFriend().length);
    p.addFriend(q1);
View Full Code Here

  @Ignore("outdated")
  @Test
  public void testRemove() throws ModelRuntimeException {
    Person p = new Person(this.model, this.instanceURI, true);
    Person q = new Person(this.model, new URIImpl("data://p1"), true);
    Person q2 = new Person(this.model, new URIImpl("data://p2"), true);
    p.addFriend(q);
    p.addFriend(q2);
    assertEquals(2, p.getAllFriend().length);

    assertTrue(this.model.contains(p.getResource(), Person.HAS_FRIEND, q2
View Full Code Here

  @Test
  public void testCalendarHandling() {
    Model model = RDF2Go.getModelFactory().createModel();
    model.open();
    URI s = new URIImpl("urn:test:S");
    URI p = new URIImpl("urn:test:P");
    Calendar cal = Calendar.getInstance();
    BridgeBase.add(model, s, p, cal);
  }
View Full Code Here

  }

  public static URI getRDFasURI(Object o) throws ModelRuntimeException {
    String annotation = o.getClass().getAnnotation(
        org.ontoware.rdfreactor.annotation.RDF.class).value();
    return new URIImpl(annotation);
  }
View Full Code Here

   * @throws ModelRuntimeException if URI syntax is wrong
   *
   * [Generated from RDFReactor template rule #c7]
   */
  public Class ( 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 OwlClass(Model model, String uriString, boolean write) throws ModelRuntimeException {
        super(model, RDFS_CLASS, new URIImpl(uriString, false), write);
    }
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.