Package org.semanticweb.owlapi.model

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


        ManchesterSyntaxDocumentFormat manSyntaxFormat = new ManchesterSyntaxDocumentFormat();
        if (format.isPrefixOWLOntologyFormat()) {
            manSyntaxFormat
                    .copyPrefixesFrom(format.asPrefixOWLOntologyFormat());
        }
        manager.saveOntology(pizzaOntology, manSyntaxFormat,
                new StreamDocumentTarget(new ByteArrayOutputStream()));
    }

    /**
     * This example shows how to get access to objects that represent entities.
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()));
    }

    /**
     * This example shows how to work with dataranges. OWL 1.1 allows data
View Full Code Here

        // }
        // Now save a copy to another location in OWL/XML format (i.e. disregard
        // the format that the ontology was loaded in).
        File f = folder.newFile("owlapiexample_example1.xml");
        IRI documentIRI2 = IRI.create(f);
        manager.saveOntology(ontology, new OWLXMLDocumentFormat(), documentIRI2);
        // Remove the ontology from the manager
        manager.removeOntology(ontology);
    }

    @Test
View Full Code Here

        Iterable<OWLClassExpression> superClasses = sup(
                ontology.filterAxioms(Filters.subClassWithSub, clsA, INCLUDED),
                OWLClassExpression.class);
        // Now save the ontology. The ontology will be saved to the location
        // where we loaded it from, in the default ontology format
        manager.saveOntology(ontology);
    }

    /**
     * These examples show how to create new ontologies.
     *
 
View Full Code Here

        System.out.println(clazz);
        /* Add the closure axioms */
        closureAxioms.addClosureAxioms(clazz);
        /* Now save a copy to another location */
        System.out.println("Saving: " + outputDocumentIRI);
        manager.saveOntology(ontology, outputDocumentIRI);
        System.out.println("Ontology Saved...");
        System.out.println("Document IRI : " + outputDocumentIRI);
        /* Remove the ontology from the manager */
        manager.removeOntology(ontology);
        System.out.println("Done");
View Full Code Here

                + manager.getOntologyFormat(ontology));
        /* Register the ontology storer with the manager */
        manager.getOntologyStorers().add(new TutorialSyntaxStorerFactory());
        /* Save using a different format */
        System.out.println("Storing     : " + outputDocumentIRI);
        manager.saveOntology(ontology, new OWLTutorialSyntaxOntologyFormat(),
                outputDocumentIRI);
        /* Remove the ontology from the manager */
        manager.removeOntology(ontology);
        System.out.println("Done");
    }
View Full Code Here

        // Create a new ontology in the test resources.
        OWLOntologyManager mgr = OWLOntologyManagerFactory.createOWLOntologyManager(null);
        OWLOntology o = mgr.createOntology(dummyiri);
        File f = new File(URI.create(url.toString() + "/dummycharacters.owl"));
        mgr.saveOntology(o, new WriterDocumentTarget(new FileWriter(f)));
        assertTrue(f.exists());

        ((AutoIRIMapper) mapper).update();
        // The old mapper should be able to locate the new ontology.
        assertFalse(dummyiri.equals(mapper.getDocumentIRI(dummyiri)));
View Full Code Here

    public static void printOntology(OWLOntology o, PrintStream printer) {

        OWLOntologyManager mgr = OWLManager.createOWLOntologyManager();
        StringDocumentTarget tgt = new StringDocumentTarget();
        try {
            mgr.saveOntology(o, new RDFXMLOntologyFormat(), tgt);
        } catch (OWLOntologyStorageException e) {
            e.printStackTrace(printer);
        }
        printer.println(tgt.toString());
View Full Code Here

             */

            if (mediaType.toString().equals(KRFormat.RDF_XML)) {

                try {
                    manager.saveOntology(ontology, new RDFXMLOntologyFormat(), out);
                } catch (OWLOntologyStorageException e) {
                    log.error("Failed to store ontology for rendering.", e);
                }
            } else if (mediaType.toString().equals(KRFormat.OWL_XML)) {
                try {
View Full Code Here

                } catch (OWLOntologyStorageException e) {
                    log.error("Failed to store ontology for rendering.", e);
                }
            } else if (mediaType.toString().equals(KRFormat.OWL_XML)) {
                try {
                    manager.saveOntology(ontology, new OWLXMLOntologyFormat(), out);
                } catch (OWLOntologyStorageException e) {
                    log.error("Failed to store ontology for rendering.", e);
                }
            } else if (mediaType.toString().equals(KRFormat.MANCHESTER_OWL)) {
                try {
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.