Examples of loadOntologyFromOntologyDocument()


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

    @Test
    public void testConvert() throws Exception {
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        String input = "Prefix(:=<http://www.example.org/#>)\nOntology(<http://example.org/>\nSubClassOf(:a :b) )";
        StringDocumentSource source = new StringDocumentSource(input);
        OWLOntology origOnt = manager.loadOntologyFromOntologyDocument(source);
        assertNotNull(origOnt);
        assertEquals(1, manager.getOntologies().size());
        assertFalse(origOnt.getOntologyID().getVersionIRI().isPresent());
        assertTrue(origOnt.getAxiomCount() > 0);
        Optional<IRI> ontologyIRI = origOnt.getOntologyID().getOntologyIRI();
View Full Code Here

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

        // remove the ontology from the manager, so it can be loaded again
        m.removeOntology(o);
        // create a document source from a string
        StringDocumentSource documentSource = new StringDocumentSource(target);
        // load the ontology from a document source
        OWLOntology o2 = m.loadOntologyFromOntologyDocument(documentSource);
        assertNotNull(o2);
    }

    @Test
    public void testOntologyCreation() throws OWLException {
View Full Code Here

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

    @Test
    public void testrun() throws Exception {
        OWLOntologyManager m = OWLManager.createOWLOntologyManager();
        m.getIRIMappers().add(new AutoIRIMapper(new File("."), false));
        OWLOntology o = m.loadOntologyFromOntologyDocument(getClass()
                .getResourceAsStream("/pizza.owl"));
        m.addAxiom(o, DF.getOWLDeclarationAxiom(DF.getOWLClass(iri)));
        m.addAxiom(
                o,
                DF.getOWLSubClassOfAxiom(c,
View Full Code Here

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

        OWLOntology ont = man.createOntology();
        man.addAxiom(ont, rule);
        StringDocumentTarget documentTarget = new StringDocumentTarget();
        man.saveOntology(ont, ontologyFormat, documentTarget);
        OWLOntologyManager man2 = OWLManager.createOWLOntologyManager();
        OWLOntology ont2 = man2
                .loadOntologyFromOntologyDocument(new StringDocumentSource(
                        documentTarget.toString(),
                        OWLOntologyDocumentSourceBase
                                .getNextDocumentIRI("string:ontology"),
                        ontologyFormat, null));
View Full Code Here

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

    @Nonnull
    protected OWLOntology parseOWLFile(String fn)
            throws OWLOntologyCreationException {
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        // TODO replace
        return manager.loadOntologyFromOntologyDocument(getInputStream(fn));
    }

    @Nonnull
    protected OWLOntology convert(OBODoc obodoc) {
        OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(
View Full Code Here

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

        @Nonnull
        String x = args[0];
        System.out.println(x);
        IRI documentIRI = IRI.create(x);
        // Now load the ontology.
        OWLOntology ontology = manager
                .loadOntologyFromOntologyDocument(documentIRI);
        // Report information about the ontology
        System.out.println("Ontology Loaded...");
        System.out.println("Document IRI: " + documentIRI);
        System.out.println("Ontology : " + ontology.getOntologyID());
View Full Code Here

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

        OWLOntologyLoaderConfiguration config = new OWLOntologyLoaderConfiguration()
                .setStrict(false);
        @SuppressWarnings("resource")
        InputStream in = getClass().getResourceAsStream(CIDOC_FILE);
        assertNotNull("can't find CIDOC_FILE", in);
        cidocOntology = manager.loadOntologyFromOntologyDocument(
                new StreamDocumentSource(in), config);
        assertNotNull(cidocOntology);
        OWLDocumentFormat format = manager.getOntologyFormat(cidocOntology);
        assertNotNull(format);
        assertTrue(format.isPrefixOWLOntologyFormat());
View Full Code Here

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

        File savedLocation2 = folder.newFile("testont2A.owl");
        FileOutputStream out2 = new FileOutputStream(savedLocation2);
        StreamDocumentTarget writer2 = new StreamDocumentTarget(out2);
        ont2.getOWLOntologyManager().saveOntology(ont2, format, writer2);
        OWLOntologyManager man = OWLManager.createOWLOntologyManager();
        OWLOntology ont1L = man
                .loadOntologyFromOntologyDocument(savedLocation1);
        OWLOntology ont2L = man
                .loadOntologyFromOntologyDocument(savedLocation2);
        // annoProp is in ont1 and in the import closure of ont2
        assertTrue(containsConsiderEx(ont1L, axannoPropdecl));
View Full Code Here

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

        StreamDocumentTarget writer2 = new StreamDocumentTarget(out2);
        ont2.getOWLOntologyManager().saveOntology(ont2, format, writer2);
        OWLOntologyManager man = OWLManager.createOWLOntologyManager();
        OWLOntology ont1L = man
                .loadOntologyFromOntologyDocument(savedLocation1);
        OWLOntology ont2L = man
                .loadOntologyFromOntologyDocument(savedLocation2);
        // annoProp is in ont1 and in the import closure of ont2
        assertTrue(containsConsiderEx(ont1L, axannoPropdecl));
        assertFalse(containsConsiderEx(ont2L, axannoPropdecl));
        assertTrue(containsConsider(ont2L, axannoPropdecl));
View Full Code Here

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

        FileOutputStream out2 = new FileOutputStream(savedLocation2);
        StreamDocumentTarget writer2 = new StreamDocumentTarget(out2);
        ont2.getOWLOntologyManager().saveOntology(ont2, format, writer2);
        OWLOntologyManager man = OWLManager.createOWLOntologyManager();
        @SuppressWarnings("unused")
        OWLOntology ont1L = man
                .loadOntologyFromOntologyDocument(savedLocation1);
        OWLOntology ont2L = man
                .loadOntologyFromOntologyDocument(savedLocation2);
        for (OWLOntology importedOntology : ont2L.getImports()) {
            for (OWLAxiom importedAxiom : importedOntology.getAxioms()) {
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.