Examples of createOntology()


Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

        IRI ontologyIRI = IRI.create("http://example.com/owlapi/families");
        // Now that we have a URI for out ontology, we can create the actual
        // ontology. Note that the create ontology method throws an
        // OWLOntologyCreationException if there was a problem creating the
        // ontology.
        OWLOntology ont = manager.createOntology(ontologyIRI);
        // We can use the manager to get a reference to an OWLDataFactory. The
        // data factory provides a point for creating OWL API objects such as
        // classes, properties and individuals.
        OWLDataFactory factory = manager.getOWLDataFactory();
        // We first need to create some references to individuals. All of our
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

    @Test
    public void testNamedOntologyToString() throws OWLOntologyCreationException {
        OWLOntologyManager man = OWLManager.createOWLOntologyManager();
        IRI ontIRI = IRI("http://owlapi.sourceforge.net/ont");
        OWLOntology ont = man.createOntology(ontIRI);
        String s = ont.toString();
        String expected = "Ontology(" + ont.getOntologyID() + ") [Axioms: "
                + ont.getAxiomCount() + " Logical Axioms: "
                + ont.getLogicalAxiomCount() + "] First 20 axioms: {}";
        assertEquals(expected, s);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

    }

    @Test
    public void testCreateOntologyWithIRI() throws OWLOntologyCreationException {
        OWLOntologyManager manager = createManager();
        OWLOntology ontology = manager.createOntology(ONTOLOGY_IRI);
        assertEquals(ONTOLOGY_IRI, ontology.getOntologyID().getOntologyIRI()
                .get());
        assertEquals(ONTOLOGY_IRI, manager.getOntologyDocumentIRI(ontology));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

    @Test
    public void testCreateOntologyWithAxioms()
            throws OWLOntologyCreationException {
        OWLOntologyManager manager = createManager();
        OWLOntology ontology = manager.createOntology(new HashSet<OWLAxiom>());
        assertNotNull("ontology should not be null",
                manager.getOntologyDocumentIRI(ontology));
    }

    @Test
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

    @Test
    public void testCreateOntologyWithAxiomsAndIRI()
            throws OWLOntologyCreationException {
        OWLOntologyManager manager = createManager();
        OWLOntology ontology = manager.createOntology(new HashSet<OWLAxiom>(),
                ONTOLOGY_IRI);
        assertEquals(ONTOLOGY_IRI, ontology.getOntologyID().getOntologyIRI()
                .get());
        assertEquals(ONTOLOGY_IRI, manager.getOntologyDocumentIRI(ontology));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

    public void testCreateOntologyWithIdWithVersionIRI()
            throws OWLOntologyCreationException {
        OWLOntologyManager manager = createManager();
        IRI versionIRI = IRI("http://version/1");
        OWLOntologyID id = new OWLOntologyID(of(ONTOLOGY_IRI), of(versionIRI));
        OWLOntology ontology = manager.createOntology(id);
        assertEquals(ONTOLOGY_IRI, ontology.getOntologyID().getOntologyIRI()
                .get());
        assertEquals(versionIRI, ontology.getOntologyID().getVersionIRI().get());
        assertEquals(versionIRI, manager.getOntologyDocumentIRI(ontology));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

    @Test
    public void testCreateOntologyWithId() throws OWLOntologyCreationException {
        OWLOntologyManager manager = createManager();
        OWLOntologyID id = new OWLOntologyID(of(ONTOLOGY_IRI), absent());
        OWLOntology ontology = manager.createOntology(id);
        assertEquals(ONTOLOGY_IRI, ontology.getOntologyID().getOntologyIRI()
                .get());
        assertEquals(ONTOLOGY_IRI, manager.getOntologyDocumentIRI(ontology));
    }
}
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

    }

    @Test
    public void shouldCheckContents() throws OWLOntologyCreationException {
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        manager.createOntology(IRI.create("http://www.test.com/123"));
        OWLOntologyID anonymousId = OWLManager.createOWLOntologyManager()
                .createOntology().getOntologyID();
        manager.contains(anonymousId);
    }
}
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

    @Test
    public void shouldNotFailOnAnonymousOntologySearch()
            throws OWLOntologyCreationException {
        OWLOntologyManager man = OWLManager.createOWLOntologyManager();
        man.createOntology(new OWLOntologyID());
        assertNull(man.getOntology(new OWLOntologyID()));
    }
}
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

            + "    <owl:Ontology><owl:imports rdf:resource=\"urn:test\"/></owl:Ontology></rdf:RDF>";

    @Test
    public void shouldNotLoadWrong() throws OWLOntologyCreationException {
        OWLOntologyManager m = OWLManager.createOWLOntologyManager();
        m.createOntology(IRI.create("urn:test"));
        StringDocumentSource documentSource = new StringDocumentSource(input);
        OWLOntology o = m.loadOntologyFromOntologyDocument(documentSource);
        assertTrue(o.getOntologyID().toString(), o.isAnonymous());
        assertFalse(o.getOntologyID().getDefaultDocumentIRI().isPresent());
    }
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.