Class OWLXMLWriter
java.lang.Object
org.semanticweb.owlapi.owlxml.renderer.OWLXMLWriter
Writes OWL/XML. In an OWL/XML documents written by this writer, the base is always the ontology
URI, and the default namespace is always the OWL namespace (http://www.w3.org/2002/07/owl#).
Unlike RDF/XML, entity URIs aren't abbreviated using the XML namespace mechanism, instead they
are encoded using 'prefix' elements.
- Since:
- 2.0.0
- Author:
- Matthew Horridge, The University Of Manchester, Bio-Health Informatics Group
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
End document.getIRIString
(IRI iri) Gets an IRI attribute value for a full IRI.void
startDocument
(OWLOntology ontology) void
void
writeCardinalityAttribute
(int cardinality) void
writeDatatypeAttribute
(OWLDatatype datatype) Writes a datatype attributed (used on Literal elements).void
Write end element.void
writeFacetAttribute
(OWLFacet facet) void
writeIRIAttribute
(IRI iri) void
writeIRIElement
(IRI iri) Writes an IRI element for a given IRI.void
writeLangAttribute
(String lang) void
writeNodeIDAttribute
(NodeID nodeID) void
writePrefix
(String prefixName, String iri) A convenience method to write a prefix.void
void
writeTextContent
(String text)
-
Constructor Details
-
OWLXMLWriter
- Parameters:
writer
- writerontology
- ontology
-
-
Method Details
-
getIRIPrefixMap
- Returns:
- iri to prefix map
-
getNamespaceManager
- Returns:
- namespace manager
-
writePrefix
A convenience method to write a prefix.- Parameters:
prefixName
- The name of the prefix (e.g. owl: is the prefix name for the OWL prefix)iri
- The prefix iri
-
getIRIString
Gets an IRI attribute value for a full IRI. If the IRI has a prefix that coincides with a written prefix then the compact IRI will be returned, otherwise the full IRI will be returned.- Parameters:
iri
- The IRI- Returns:
- Either the compact version of the IRI or the full IRI.
-
startDocument
- Parameters:
ontology
- ontology- Throws:
OWLRendererException
- renderer error
-
endDocument
public void endDocument()End document. -
writeStartElement
- Parameters:
name
- name
-
writeEndElement
public void writeEndElement()Write end element. -
writeDatatypeAttribute
Writes a datatype attributed (used on Literal elements). The full datatype IRI is written out.- Parameters:
datatype
- The datatype
-
writeNodeIDAttribute
- Parameters:
nodeID
- nodeID
-
writeIRIAttribute
- Parameters:
iri
- iri
-
writeIRIElement
Writes an IRI element for a given IRI.- Parameters:
iri
- The IRI to be written as an element. If the IRI can be abbreviated then an AbbreviatedIRI element will be written
-
writeLangAttribute
- Parameters:
lang
- language tag
-
writeCardinalityAttribute
public void writeCardinalityAttribute(int cardinality) - Parameters:
cardinality
- cardinality
-
writeTextContent
- Parameters:
text
- text
-
writeFacetAttribute
- Parameters:
facet
- facet
-
writeAnnotationURIAttribute
- Parameters:
uri
- URI
-