Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLOntologyFormat$NullLoaderMetaData


      throw new IOntologyException("Unable to save ontology "+getIRI(),e);
    }
  }
 
  public void write(OutputStream out, int format) throws IOntologyException {
    OWLOntologyFormat ontologyFormat = manager.getOntologyFormat(ontology);
    switch(format){
    case OWL_FORMAT:
      ontologyFormat = new OWLXMLOntologyFormat();break;
    case RDF_FORMAT:
      ontologyFormat = new RDFXMLOntologyFormat();break;
View Full Code Here


      throw new IOntologyException("Unable to save ontology "+getIRI(),e);
    }
  }
 
  public void write(OutputStream out, int format) throws IOntologyException {
    OWLOntologyFormat ontologyFormat = manager.getOntologyFormat(ontology);
    switch(format){
    case OWL_FORMAT:
      ontologyFormat = new OWLXMLOntologyFormat();break;
    case RDF_FORMAT:
      ontologyFormat = new RDFXMLOntologyFormat();break;
View Full Code Here

        // Native formats first
        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

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

                OntModel jenamodel = ModelFactory.createOntologyModel();
                id = owlmodel.getOntologyID();
View Full Code Here

                if (!importedOntology.equals(ontology)) {
                    copyPrefixes(manager.getOntologyFormat(importedOntology));
                }
            }
        }
        OWLOntologyFormat format = manager.getOntologyFormat(ontology);
        copyPrefixes(format);
    }
View Full Code Here

                if (existingOntology == null && !ont.isEmpty()) {
                    // Junk from a previous parse.  We should clear the ont
                    getOWLOntologyManager().removeOntology(ont);
                    ont = super.createOWLOntology(ontologyID, documentSource.getDocumentIRI(), mediator);
                }
                OWLOntologyFormat format = parser.parse(documentSource, ont, configuration);
                mediator.setOntologyFormat(ont, format);
                return ont;
            }
            catch (IOException e) {
                // No hope of any parsers working?
View Full Code Here

            man.makeLoadImportRequest(importsDeclaration, getConsumer().getConfiguration());


            OWLOntology importedOntology = man.getImportedOntology(importsDeclaration);
            if (importedOntology != null) {
                OWLOntologyFormat importedOntologyFormat = man.getOntologyFormat(importedOntology);
                if (importedOntologyFormat instanceof RDFOntologyFormat) {
                    if (importedOntology.isAnonymous()) {
                        OWLOntologyLoaderConfiguration.MissingOntologyHeaderStrategy missingOntologyHeaderStrategy = getConsumer().getConfiguration().getMissingOntologyHeaderStrategy();
                        boolean includeGraph = missingOntologyHeaderStrategy.equals(OWLOntologyLoaderConfiguration.MissingOntologyHeaderStrategy.INCLUDE_GRAPH);
View Full Code Here

    File file = new File(path);
    //File file = File.createTempFile("corpusOntology", "owl", whereToSave.getAbsoluteFile());
        manager.saveOntology(ontology, IRI.create(file.toURI()));
        // 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

    File file = new File(path);
    //File file = File.createTempFile("corpusOntology", "owl", whereToSave.getAbsoluteFile());
        manager.saveOntology(ontology, IRI.create(file.toURI()));
        // By default ontologies are saved in the format from which they were loaded. In this case the ontology was loaded from an rdf/xml
        //file We can get information about the format of an ontology from its manager
        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

    //
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////


    public void saveOntology(OWLOntology ontology) throws OWLOntologyStorageException, UnknownOWLOntologyException {
        OWLOntologyFormat format = getOntologyFormat(ontology);
        saveOntology(ontology, format);
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLOntologyFormat$NullLoaderMetaData

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.