* writer
* @param ontology
* ontology
*/
public OWLXMLWriter(@Nonnull Writer writer, @Nullable OWLOntology ontology) {
XMLWriterNamespaceManager nsm = new XMLWriterNamespaceManager(
Namespaces.OWL.toString());
nsm.setPrefix("xsd", Namespaces.XSD.toString());
nsm.setPrefix("rdf", Namespaces.RDF.toString());
nsm.setPrefix("rdfs", Namespaces.RDFS.toString());
nsm.setPrefix("xml", Namespaces.XML.toString());
String base = Namespaces.OWL.toString();
if (ontology != null && !ontology.isAnonymous()) {
base = ontology.getOntologyID().getOntologyIRI().get().toString();
}
this.writer = XMLWriterFactory.createXMLWriter(writer, nsm, base);