Examples of RDFXMLOntologyFormat


Examples of org.semanticweb.owlapi.io.RDFXMLOntologyFormat

    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

Examples of org.semanticweb.owlapi.io.RDFXMLOntologyFormat

             */

            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

Examples of org.semanticweb.owlapi.io.RDFXMLOntologyFormat

    private static synchronized void cacheOntology(URI physicalRemoteUri, File file, OWLOntology ont) throws UnknownOWLOntologyException,
                                                                                                     OWLOntologyStorageException {
        uris.put(physicalRemoteUri, file);
        oiri.put(physicalRemoteUri, ont.getOntologyID().getOntologyIRI());
        manager.setOntologyDocumentIRI(ont, IRI.create(file));
        manager.saveOntology(ont, new RDFXMLOntologyFormat(), IRI.create(file));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.io.RDFXMLOntologyFormat

                 */
   
                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

Examples of org.semanticweb.owlapi.io.RDFXMLOntologyFormat

             */

            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

Examples of org.semanticweb.owlapi.io.RDFXMLOntologyFormat

        if (RDF_XML_TYPE.equals(mediaType) || OWL_XML_TYPE.equals(mediaType)
            || MANCHESTER_OWL_TYPE.equals(mediaType) || FUNCTIONAL_OWL_TYPE.equals(mediaType)
            || TURTLE_TYPE.equals(mediaType) || X_TURTLE_TYPE.equals(mediaType)) {

            OWLOntologyFormat format = null;
            if (RDF_XML_TYPE.equals(mediaType)) format = new RDFXMLOntologyFormat();
            else if (OWL_XML_TYPE.equals(mediaType)) format = new OWLXMLOntologyFormat();
            else if (MANCHESTER_OWL_TYPE.equals(mediaType)) format = new ManchesterOWLSyntaxOntologyFormat();
            else if (FUNCTIONAL_OWL_TYPE.equals(mediaType)) format = new OWLFunctionalSyntaxOntologyFormat();
            else if (TURTLE_TYPE.equals(mediaType) || X_TURTLE_TYPE.equals(mediaType)) format = new TurtleOntologyFormat();
View Full Code Here

Examples of org.semanticweb.owlapi.io.RDFXMLOntologyFormat

            if (format.equals("TURTLE") || format.equals("RDF/XML")) {

                if (format.equals("TURTLE")) owlmanager.setOntologyFormat(owlmodel,
                    new TurtleOntologyFormat());
                if (format.equals("RDF/XML")) owlmanager.setOntologyFormat(owlmodel,
                    new RDFXMLOntologyFormat());

                OWLOntologyFormat owlformat = owlmanager.getOntologyFormat(owlmodel);

                owlmanager.saveOntology(owlmodel, owlformat, out);
View Full Code Here

Examples of org.semanticweb.owlapi.io.RDFXMLOntologyFormat

    public static TripleCollection owlOntologyToClerezzaMGraph(OWLOntology ontology) {
        MGraph mGraph = null;
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        OWLOntologyManager manager = ontology.getOWLOntologyManager();
        try {
            manager.saveOntology(ontology, new RDFXMLOntologyFormat(), out);
            ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
            ParsingProvider parser = new JenaParserProvider();
            mGraph = new SimpleMGraph();
            parser.parse(mGraph, in, SupportedFormat.RDF_XML, null);
        } catch (OWLOntologyStorageException e) {
View Full Code Here

Examples of org.semanticweb.owlapi.io.RDFXMLOntologyFormat

    public OWLOntologyFormat parse(OWLOntologyDocumentSource documentSource, OWLOntology ontology, OWLOntologyLoaderConfiguration configuration) throws OWLParserException, IOException, OWLOntologyChangeException, UnloadableImportException {
      InputSource is = null;
      try {
         
            final RDFXMLOntologyFormat format = new RDFXMLOntologyFormat();
            final RDFParser parser = new RDFParser() {
                @Override
        public void startPrefixMapping(String prefix, String IRI) throws SAXException {
                    super.startPrefixMapping(prefix, IRI);
                    format.setPrefix(prefix, IRI);
                }


                @Override
        public void startElement(String namespaceIRI, String localName, String qName, Attributes atts) throws SAXException {
View Full Code Here

Examples of org.semanticweb.owlapi.io.RDFXMLOntologyFormat

        IRI mergedOntologyIRI = IRI.create(outputPath);
        OWLOntology merged = merger.createMergedOntology(man, mergedOntologyIRI);
        // Print out the axioms in the merged ontology.

        // Save to RDF/XML
        man.saveOntology(merged, new RDFXMLOntologyFormat(), IRI.create("file:" + outputPath));
  }
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.