Package org.semanticweb.owlapi.model

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


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


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

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

            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();

            if (format != null) try {
                manager.saveOntology(ontology, format, out);
            } catch (OWLOntologyStorageException e) {
                log.error("Failed to store ontology for rendering.", e);
                throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
            }
            else throw new IOException();
View Full Code Here

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

                OWLOntologyFormat owlformat = owlmanager.getOntologyFormat(owlmodel);

                owlmanager.saveOntology(owlmodel, owlformat, out);

                OntModel jenamodel = ModelFactory.createOntologyModel();
                id = owlmodel.getOntologyID();
                jenamodel.read(new ByteArrayInputStream(out.toByteArray()), id.toString().replace("<", "")
                        .replace(">", ""), format);
View Full Code Here

    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

        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));
  }
 
 
  /*
   * given an existing ontology, add a class to it.  this not only adds the class itself, but adds any synonyms, all equivalent classes
View Full Code Here

        output("Unreparable lints:");
        for( Lint lint : unreparableLints ) {
          output( lint.toString() );
        }
      }
      manager.saveOntology( rootOntologyLints.getOntology(), new StreamDocumentTarget( new FileOutputStream( m_OutputOntologyPath ) ) );
      output( "Saved to " + m_OutputOntologyPath );

    }
  }
 
View Full Code Here

        output("Unreparable lints:");
        for( Lint lint : unreparableLints ) {
          output( lint.toString() );
        }
      }
      manager.saveOntology( rootOntologyLints.getOntology(), new StreamDocumentTarget( new FileOutputStream( m_OutputOntologyPath ) ) );
      output( "Saved to " + m_OutputOntologyPath );

    }
  }
 
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

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.