Package org.ontoware.rdf2go.model

Examples of org.ontoware.rdf2go.model.Model.open()


       
        log.info("Input model has " + modelWithSchemaData.size() + " triples");
       
        // enable RDFS inferencing
        Model m = RDF2Go.getModelFactory().createModel(Reasoning.rdfs);
        m.open();
        m.addAll(modelWithSchemaData.iterator());
       
        // prepare JModel
        JModel jm = Semantics.getbuiltIns_RDFS();
       
View Full Code Here


        log.info("Initialising JModel");
        JModel jm = Semantics.getbuiltIns_RDFS();
       
        log.info("Loading schema triples");
        Model m = RDF2Go.getModelFactory().createModel(Reasoning.rdfsAndOwl);
        m.open();
        m.addAll(schemaDataModel.iterator());
       
        log.info("Skolemisation (replacing all blank nodes with random URIs)");
        ModelUtils.deanonymize(m);
       
View Full Code Here

        // OntModel combined = ModelFactory.createOntologyModel(spec, base);
        //
        // Model m = new ModelImplJena22(combined);
       
        Model m = RDF2Go.getModelFactory().createModel(Reasoning.owl);
        m.open();
        m.addAll(schemaDataModel.iterator());
       
        // Reasoner reasoner = ReasonerRegistry.getOWLMicroReasoner();//
        // miniReasoner();
        // reasoner = reasoner.bindSchema(schemaDataModel);
View Full Code Here

    // getting model factory
    ModelFactory modelFactory = RDF2Go.getModelFactory();
   
    // getting model
    Model model = modelFactory.createModel();
    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");
View Full Code Here

 
  public static Model loadFromClassPathResource( String resourceName ) {
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    InputStream in = cl.getResourceAsStream(resourceName);
    Model model = RDF2Go.getModelFactory().createModel();
    model.open();
    try {
      model.readFrom(in);
    } catch (ModelRuntimeException e) {
      throw new RuntimeException(e);
    } catch (IOException e) {
View Full Code Here

   *            N-TRIPLE (*.nt) notation
   * @return a Jena Model
   */
  public static Model read(String filename) {
    Model m = RDF2Go.getModelFactory().createModel();
    m.open();

    FileInputStream fis;
    File f = new File(filename);
    try {
      fis = new FileInputStream(f);
View Full Code Here

    ModelFactory modelFactory = RDF2Go.getModelFactory();
    Assert.assertNotNull(modelFactory);
    Model model = modelFactory.createModel();
    Assert.assertNotNull(model);
    Assert.assertFalse(model.isOpen());
    model.open();
    Assert.assertTrue(model.isOpen());
   
    // use the model a bit
    // load foaf test data
    // make sure the file is loaded
View Full Code Here

  }

  @Test
  public void testApplyRule() {
    Model m = RDF2Go.getModelFactory().createModel();
    m.open();
    Map<String, URI> nsMap = new HashMap<String, URI>();
    nsMap.put("rdf", new URIImpl(
        "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
    String LOCAL = "http://example.com#";
    nsMap.put("", new URIImpl(LOCAL));
View Full Code Here

  }

  @Test
  public void testUriRename() {
    Model m = RDF2Go.getModelFactory().createModel();
    m.open();

    URI a = new URIImpl("urn:test:a");
    URI b = new URIImpl("urn:test:b");
    URI c = new URIImpl("urn:test:c");
View Full Code Here

  }

  @Test
  public void testUriPrefixRename() {
    Model m = RDF2Go.getModelFactory().createModel();
    m.open();

    URI a = new URIImpl("urn:test:a");
    URI b = new URIImpl("urn:test:b");
    URI c = new URIImpl("urn:test:c");
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.