/** * Saves the ontology. The ontology will be saved to the location that it was loaded from, or if * it was created programmatically, it will be saved to the location specified by an ontology * IRI mapper at creation time. The ontology will be saved in the same format which it was * loaded from, or the default ontology format if the ontology was created programmatically. * * @throws OWLOntologyStorageException An exception will be thrown if there is a problem with * saving the ontology, or the ontology can't be saved in the format it was loaded from. */ default void saveOntology() throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this); }
/** * Saves the ontology, using the specified document IRI to determine where/how the ontology * should be saved. * * @param documentIRI The document IRI where the ontology should be saved to * @throws OWLOntologyStorageException If the ontology cannot be saved */ default void saveOntology(IRI documentIRI) throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this, documentIRI); }
/** * Saves the ontology in the specified ontology format to its document URI. * * @param ontologyFormat The format in which the ontology should be saved. * @throws OWLOntologyStorageException If the ontology cannot be saved. */ default void saveOntology(OWLDocumentFormat ontologyFormat) throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this, ontologyFormat); }
/** * Saves the ontology to the specified output target in the specified ontology format. * * @param ontologyFormat The output format in which to save the ontology * @param documentTarget The output target where the ontology will be saved to * @throws OWLOntologyStorageException If the ontology could not be saved. */ default void saveOntology(OWLDocumentFormat ontologyFormat, OWLOntologyDocumentTarget documentTarget) throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this, ontologyFormat, documentTarget); }
/** * Saves the ontology, to the specified output stream * * @param outputStream The output stream where the ontology will be saved to * @throws OWLOntologyStorageException If there was a problem saving this ontology to the * specified output stream */ default void saveOntology(OutputStream outputStream) throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this, outputStream); }
/** * Saves the ontology. The ontology will be saved to the location that it was loaded from, or if * it was created programmatically, it will be saved to the location specified by an ontology * IRI mapper at creation time. The ontology will be saved in the same format which it was * loaded from, or the default ontology format if the ontology was created programmatically. * * @throws OWLOntologyStorageException An exception will be thrown if there is a problem with * saving the ontology, or the ontology can't be saved in the format it was loaded from. */ default void saveOntology() throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this); }
/** * Saves the ontology in the specified ontology format to its document URI. * * @param ontologyFormat The format in which the ontology should be saved. * @throws OWLOntologyStorageException If the ontology cannot be saved. */ default void saveOntology(OWLDocumentFormat ontologyFormat) throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this, ontologyFormat); }
/** * Saves the ontology to the specified output target in the specified ontology format. * * @param ontologyFormat The output format in which to save the ontology * @param documentTarget The output target where the ontology will be saved to * @throws OWLOntologyStorageException If the ontology could not be saved. */ default void saveOntology(OWLDocumentFormat ontologyFormat, OWLOntologyDocumentTarget documentTarget) throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this, ontologyFormat, documentTarget); }
/** * Saves the specified ontology in the specified ontology format to its document URI. * * @param ontology The ontology to be saved. * @param ontologyFormat The format in which the ontology should be saved. * @throws OWLOntologyStorageException If the ontology cannot be saved. * @throws UnknownOWLOntologyException if the specified ontology is not managed by this manager */ default void saveOntology(OWLOntology ontology, OWLDocumentFormat ontologyFormat) throws OWLOntologyStorageException { saveOntology(ontology, ontologyFormat, getOntologyDocumentIRI(ontology)); }
/** * Saves the ontology to the specified document IRI in the specified ontology format. * * @param ontologyFormat The format in which to save the ontology * @param documentIRI The document IRI where the ontology should be saved to * @throws OWLOntologyStorageException If the ontology could not be saved. */ default void saveOntology(OWLDocumentFormat ontologyFormat, IRI documentIRI) throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this, ontologyFormat, documentIRI); }
/** * Saves the ontology to the specified output stream in the specified ontology format. * * @param ontologyFormat The format in which to save the ontology * @param outputStream The output stream where the ontology will be saved to. * @throws OWLOntologyStorageException If the ontology could not be saved. */ default void saveOntology(OWLDocumentFormat ontologyFormat, OutputStream outputStream) throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this, ontologyFormat, outputStream); }
/** * Saves the ontology to the specified * {@link org.semanticweb.owlapi.io.OWLOntologyDocumentTarget}. * * @param documentTarget The output target where the ontology will be saved to. * @throws OWLOntologyStorageException If the ontology could not be saved. */ default void saveOntology(OWLOntologyDocumentTarget documentTarget) throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this, documentTarget); }
/** * Saves the specified ontology in the specified ontology format to its document URI. * * @param ontology The ontology to be saved. * @param ontologyFormat The format in which the ontology should be saved. * @throws OWLOntologyStorageException If the ontology cannot be saved. * @throws UnknownOWLOntologyException if the specified ontology is not managed by this manager */ default void saveOntology(OWLOntology ontology, OWLDocumentFormat ontologyFormat) throws OWLOntologyStorageException { saveOntology(ontology, ontologyFormat, getOntologyDocumentIRI(ontology)); }
/** * Saves the ontology, using the specified document IRI to determine where/how the ontology * should be saved. * * @param documentIRI The document IRI where the ontology should be saved to * @throws OWLOntologyStorageException If the ontology cannot be saved */ default void saveOntology(IRI documentIRI) throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this, documentIRI); }
/** * Saves the ontology to the specified document IRI in the specified ontology format. * * @param ontologyFormat The format in which to save the ontology * @param documentIRI The document IRI where the ontology should be saved to * @throws OWLOntologyStorageException If the ontology could not be saved. */ default void saveOntology(OWLDocumentFormat ontologyFormat, IRI documentIRI) throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this, ontologyFormat, documentIRI); }
/** * Saves the ontology, to the specified output stream * * @param outputStream The output stream where the ontology will be saved to * @throws OWLOntologyStorageException If there was a problem saving this ontology to the * specified output stream */ default void saveOntology(OutputStream outputStream) throws OWLOntologyStorageException { getOWLOntologyManager().saveOntology(this, outputStream); }
private void writeNewProject(OWLOntologyManager rootOntologyManager, OWLOntology ontology) throws OWLOntologyStorageException { rootOntologyDocument.getParentFile().mkdirs(); rootOntologyManager.saveOntology(ontology, new BinaryOWLOntologyDocumentFormat(), IRI.create(rootOntologyDocument)); ImportsCacheManager cacheManager = importsCacheManagerProvider.get(); cacheManager.cacheImports(ontology); } }
public static void logOntology(String message, OWLOntology ontology, Logger logger, Level level) { if (logger.isLoggable(level)) { logger.log(level, message); StringDocumentTarget out = new StringDocumentTarget(); try { ontology.getOWLOntologyManager().saveOntology(ontology, new OWLXMLOntologyFormat(), out); } catch (OWLOntologyStorageException e) { logger.log(level, "Could not display ontology", e); } logger.log(level, out.toString()); } }
@Deprecated 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()); }
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()); }