Examples of OWLXMLOntologyFormat


Examples of org.semanticweb.owlapi.io.OWLXMLOntologyFormat

        // By default ontologies are saved in the format from which they were loaded.

        OWLOntologyFormat format = manager.getOntologyFormat(ontology);
      
        // We can save the ontology in a different format Lets save the ontology in owl/xml format
        OWLXMLOntologyFormat owlxmlFormat = new OWLXMLOntologyFormat();
        //or in the rdf/xml format
        RDFXMLOntologyFormat rdfxmlFormat = new RDFXMLOntologyFormat();
       
        // Some ontology formats support prefix names and prefix IRIs.  When we save the ontology in the new format we
        // will copy the prefixes over so that we have nicely abbreviated IRIs in the new ontology document
        if (format.isPrefixOWLOntologyFormat()) {
            owlxmlFormat.copyPrefixesFrom(format.asPrefixOWLOntologyFormat());
        }
       
//        manager.saveOntology(ontology, owlxmlFormat, IRI.create(file.toURI()));  //uses the owl ontology format
//        manager.saveOntology(ontology, IRI.create(file.toURI()));   //uses...some type of RDF format, but not the same as SWEET
        manager.saveOntology(ontology, rdfxmlFormat, IRI.create(file.toURI()));
View Full Code Here

Examples of org.semanticweb.owlapi.io.OWLXMLOntologyFormat

        OWLOntologyFormat format = manager.getOntologyFormat(ontology);
       
        // We can save the ontology in a different format Lets save the ontology in owl/xml format
       
       
        OWLXMLOntologyFormat owlxmlFormat = new OWLXMLOntologyFormat();
        // Some ontology formats support prefix names and prefix IRIs. In our
        // case we loaded the pizza ontology from an rdf/xml format, which
        // supports prefixes. When we save the ontology in the new format we
        // will copy the prefixes over so that we have nicely abbreviated IRIs
        // in the new ontology document
        if (format.isPrefixOWLOntologyFormat()) {
            owlxmlFormat.copyPrefixesFrom(format.asPrefixOWLOntologyFormat());
        }

        manager.saveOntology(ontology, owlxmlFormat, IRI.create(file.toURI()));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.io.OWLXMLOntologyFormat

   */
  public static void saveAxioms( Collection<OWLAxiom> axioms, OutputStream outputStream ) throws IOException {
    try {
      OWLOntology ontology = OWL.Ontology( axioms );

      OWL.manager.saveOntology( ontology, new OWLXMLOntologyFormat(), outputStream );
     
      outputStream.flush();
     
      OWL.manager.removeOntology( ontology );
    } catch( OWLException e ) {
View Full Code Here

Examples of org.semanticweb.owlapi.io.OWLXMLOntologyFormat

  public static void save( Taxonomy<OWLClass> taxonomy,
      OutputStream outputStream ) throws IOException {
    try {
      OWLOntology ontology = createTaxonomyOntology( taxonomy );

      OWL.manager.saveOntology( ontology, new OWLXMLOntologyFormat(), new StreamDocumentTarget( outputStream) );
     
      outputStream.flush();
     
      OWL.manager.removeOntology( ontology );
    } catch( OWLException e ) {
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.