Package org.semanticweb.owlapi.io

Examples of org.semanticweb.owlapi.io.StreamDocumentTarget


    }

    @Override
    public void saveOntology(OWLOntology ontology, OutputStream outputStream)
            throws OWLOntologyStorageException {
        saveOntology(ontology, new StreamDocumentTarget(outputStream));
    }
View Full Code Here


    @Override
    public void saveOntology(OWLOntology ontology,
            OWLDocumentFormat ontologyFormat, OutputStream outputStream)
            throws OWLOntologyStorageException {
        saveOntology(ontology, ontologyFormat, new StreamDocumentTarget(
                outputStream));
    }
View Full Code Here

        if (format.isPrefixOWLOntologyFormat()) {
            manSyntaxFormat
                    .copyPrefixesFrom(format.asPrefixOWLOntologyFormat());
        }
        manager.saveOntology(pizzaOntology, manSyntaxFormat,
                new StreamDocumentTarget(new ByteArrayOutputStream()));
    }
View Full Code Here

                .getOWLDatatypeDefinitionAxiom(concessionaryAgeDatatype,
                        concessionaryAge);
        // Add the definition to our ontology
        manager.addAxiom(ontology, datatypeDef);
        // Dump our ontology
        manager.saveOntology(ontology, new StreamDocumentTarget(
                new ByteArrayOutputStream()));
    }
View Full Code Here

        // Create the property assertion and add it to the ontology
        OWLAxiom ax = factory.getOWLDataPropertyAssertionAxiom(hasAge, john,
                literal);
        manager.addAxiom(ontology, ax);
        // Dump the ontology to System.out
        manager.saveOntology(ontology, new StreamDocumentTarget(
                new ByteArrayOutputStream()));
    }
View Full Code Here

        // specify that :Mary is a :Person
        OWLOntology ontology = manager.createOntology(IRI.create(base));
        // Add the class assertion
        manager.addAxiom(ontology, classAssertion);
        // Dump the ontology to stdout
        manager.saveOntology(ontology, new StreamDocumentTarget(
                new ByteArrayOutputStream()));
    }
View Full Code Here

                person, mary);
        OWLOntology o = m.createOntology(IRI.create(base));
        // Add the class assertion
        m.addAxiom(o, classAssertion);
        // Dump the ontology
        StreamDocumentTarget target = new StreamDocumentTarget(
                new ByteArrayOutputStream());
        m.saveOntology(o, target);
    }
View Full Code Here

                                .create("http://www.semanticweb.org/ontologies/dataranges#age")),
                        integerGE18);
        // Add the definition to our ontology
        m.addAxiom(o, datatypeDef);
        // Dump our ontology
        StreamDocumentTarget target = new StreamDocumentTarget(
                new ByteArrayOutputStream());
        m.saveOntology(o, target);
    }
View Full Code Here

        OWLOntologyManager m = create();
        OWLOntology o = loadPizzaOntology(m);
        // Register the ontology storer with the manager
        m.getOntologyStorers().add(new TutorialSyntaxStorerFactory());
        // Save using a different format
        StreamDocumentTarget target = new StreamDocumentTarget(
                new ByteArrayOutputStream());
        m.saveOntology(o, new OWLTutorialSyntaxOntologyFormat(), target);
    }
View Full Code Here

        assertTrue(containsConsider(ont2, axAsubB));
        @SuppressWarnings("null")
        @Nonnull
        File savedLocation1 = folder.newFile("testont1A.owl");
        FileOutputStream out1 = new FileOutputStream(savedLocation1);
        StreamDocumentTarget writer1 = new StreamDocumentTarget(out1);
        ont1.getOWLOntologyManager().saveOntology(ont1, format, writer1);
        @SuppressWarnings("null")
        @Nonnull
        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
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.io.StreamDocumentTarget

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.