Package org.ontoware.rdf2go.model.node

Examples of org.ontoware.rdf2go.model.node.URI


    RepositoryModelFactory repositoryModelFactory = new RepositoryModelFactory();
    Model model = repositoryModelFactory.createModel();
    model.open();

    URI a = new URIImpl("urn:test:a");
    URI b = new URIImpl("urn:test:b");
    List list = new List(model, "urn:test:list", true);
   
    //assertTrue( list instanceof URI );  --> fails

    model.addStatement(a, b, list.asURI() );
View Full Code Here


      return this.underlying.hasNext();
    }

    @Override
    public Model next() {
      URI uri = this.underlying.next();

      Model model = getModel(uri);

      this.lastURI = uri;
      return model;
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

  @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

      Object o = returnType.newInstance();

      // check for RDF annotation
      if (write) {
        try {
          URI rdfsClassURI = getRDFasURI(o);
          model.addStatement(name, RDF.type, rdfsClassURI);
          // now forget the annotation and never us it again?
        } catch (ModelRuntimeException e) {
          throw new RuntimeException(e);
        }
View Full Code Here

    reasoning = Reasoning.rdfs;
    model = modelFactory.createModel(reasoning);
    model.open();

    // using reasoning (here: assuming RDFS semantics)
    URI A = model.createURI("urn:A");
    URI B = model.createURI("urn:B");
    URI C = model.createURI("urn:C");
    model.addStatement(B, RDFS.subClassOf, A);
    model.addStatement(C, RDFS.subClassOf, B);
    // now let's see who is a superclass of C:
    System.out.println("All superclasses of "+C+":");
    ClosableIterator<? extends Statement> it = model.findStatements(C, RDFS.subClassOf, Variable.ANY);
View Full Code Here

  public void putAll(Map<? extends URI, ? extends Object> t) {
    // TODO use generics better?
    Iterator<?> it = t.entrySet().iterator();
    while (it.hasNext()) {
      Entry<?, ?> entry = (Entry) it.next();
      URI uri = (URI) entry.getKey();
      put(uri, entry.getValue());
    }
  }
View Full Code Here

    init();

    // creating URIs
    // persons
    URI max = model.createURI("http://xam.de/foaf.rdf.xml#i");
    URI konrad = model.createURI("http://example.com/persons#konrad");
    URI guido = model.createURI("http://example.com/persons#guido");
    URI james = model.createURI("http://example.com/persons#james");
    // relations
    URI hasName = model.createURI("http://xmlns.com/foaf/0.1/#term_name");
    URI hasAge = model.createURI("http://example.com/relations#age");
    hasTag = model.createURI("http://example.com/relations#hasTag");
    // tags
    PlainLiteral tagJava = model.createPlainLiteral("Java");
    PlainLiteral tagPython = model.createPlainLiteral("Python");
    PlainLiteral tagComputers = model.createPlainLiteral("Computers");
View Full Code Here

    init();
   
    // creating URIs
    // persons
    URI max = model.createURI("http://xam.de/foaf.rdf.xml#i");
    URI konrad = model.createURI("http://example.com/persons#konrad");
    URI guido = model.createURI("http://example.com/persons#guido");
    URI james = model.createURI("http://example.com/persons#james");
    // relations
    hasTag = model.createURI("http://example.com/relations#hasTag");
    // tags
    PlainLiteral tagJava = model.createPlainLiteral("Java");
    PlainLiteral tagPython = model.createPlainLiteral("Python");
View Full Code Here

    model.open();
    assert model.isOpen();

    // creating URIs
    String foafURI = "http://xmlns.com/foaf/0.1/";
    URI max = model.createURI("http://xam.de/foaf.rdf.xml#i");
    URI currentProject = model.createURI(foafURI + "#term_currentProject");
    URI name = model.createURI(foafURI + "#term_name");
    URI semweb4j = model.createURI("http://semweb4j.org");

    // adding a statement to the model
    model.addStatement(max, currentProject, semweb4j);
    model.addStatement(max, name, "Max Völkel");
View Full Code Here

TOP

Related Classes of org.ontoware.rdf2go.model.node.URI

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.