Package net.ontopia.topicmaps.utils.rdf
Class RDFTopicMapWriter
java.lang.Object
net.ontopia.topicmaps.utils.rdf.RDFTopicMapWriter
- All Implemented Interfaces:
TopicMapWriterIF
PUBLIC: A topic map writer that can convert topic maps to RDF. The
conversion may result in an RDF event stream, an RDF model, or RDF
serialized into the RDF/XML format.
- Since:
- 2.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRDFTopicMapWriter(OutputStream stream) PUBLIC: Creates a writer that writes the RDF representation to the given OutputStream serialized to RDF/XML and using the UTF-8 character encoding.RDFTopicMapWriter(OutputStream stream, String encoding) PUBLIC: Creates a writer that writes the RDF representation to the given OutputStream serialized to RDF/XML and using the given character encoding.RDFTopicMapWriter(Writer writer) PUBLIC: Creates a writer that writes the RDF representation to the given OutputStream serialized to RDF/XML.RDFTopicMapWriter(org.apache.jena.rdf.model.Model model) PUBLIC: Creates a writer that builds an RDF representation of the topic map in the given Jena RDF model.RDFTopicMapWriter(org.apache.jena.rdfxml.xmlinput.StatementHandler handler) PUBLIC: Creates a writer that writes the RDF representation to the given StatementHandler. -
Method Summary
Modifier and TypeMethodDescriptionbooleanPUBLIC: Returns true if the writer will use RDF reification to preserve reification in the topic map.booleanPUBLIC: Returns true if the writer will use RDF reification to preserve the scopes in the topic map.voidsetAdditionalProperties(Map<String, Object> properties) Sets additional properties for the RDFTopicMapWriter.voidPUBLIC: Sets the filter that decides which topic map constructs are accepted and exported.voidsetPreserveReification(boolean preserve_reification) PUBLIC: Controls whether the writer will use RDF reification to preserve reification in the topic map.voidsetPreserveScope(boolean preserve_scope) PUBLIC: Controls whether the writer will use RDF reification to preserve the scopes in the topic map.protected voidsetup(TopicMapIF topicmap) protected voidwrite(AssociationIF assoc) protected voidvoidwrite(TopicMapIF topicmap) PUBLIC: Writes the given topic map to an implicit implementation dependent destination.
-
Field Details
-
PROPERTY_PRESERVE_REIFICATION
- See Also:
-
PROPERTY_PRESERVE_SCOPE
- See Also:
-
PROPERTY_FILTER
- See Also:
-
handler
protected org.apache.jena.rdfxml.xmlinput.StatementHandler handler -
model
protected org.apache.jena.rdf.model.Model model -
writer
-
namepreds
-
preferred_roles
-
preserve_scope
protected boolean preserve_scope -
preserve_reification
protected boolean preserve_reification -
filter
-
-
Constructor Details
-
RDFTopicMapWriter
public RDFTopicMapWriter(org.apache.jena.rdfxml.xmlinput.StatementHandler handler) PUBLIC: Creates a writer that writes the RDF representation to the given StatementHandler. -
RDFTopicMapWriter
PUBLIC: Creates a writer that writes the RDF representation to the given OutputStream serialized to RDF/XML and using the UTF-8 character encoding.- Throws:
IOException
-
RDFTopicMapWriter
PUBLIC: Creates a writer that writes the RDF representation to the given OutputStream serialized to RDF/XML and using the given character encoding.- Throws:
IOException- Since:
- 5.1.3
-
RDFTopicMapWriter
PUBLIC: Creates a writer that writes the RDF representation to the given OutputStream serialized to RDF/XML. -
RDFTopicMapWriter
public RDFTopicMapWriter(org.apache.jena.rdf.model.Model model) PUBLIC: Creates a writer that builds an RDF representation of the topic map in the given Jena RDF model.
-
-
Method Details
-
setPreserveScope
public void setPreserveScope(boolean preserve_scope) PUBLIC: Controls whether the writer will use RDF reification to preserve the scopes in the topic map. -
getPreserveScope
public boolean getPreserveScope()PUBLIC: Returns true if the writer will use RDF reification to preserve the scopes in the topic map. -
setPreserveReification
public void setPreserveReification(boolean preserve_reification) PUBLIC: Controls whether the writer will use RDF reification to preserve reification in the topic map. -
getPreserveReification
public boolean getPreserveReification()PUBLIC: Returns true if the writer will use RDF reification to preserve reification in the topic map. -
setFilter
PUBLIC: Sets the filter that decides which topic map constructs are accepted and exported. Uses 'filter' to identify individual topic constructs as allowed or disallowed. TM constructs that depend on the disallowed topics are also disallowed.- Parameters:
filter- Places constraints on individual topicmap constructs.
-
write
Description copied from interface:TopicMapWriterIFPUBLIC: Writes the given topic map to an implicit implementation dependent destination. The write method will close any resources opened internally. This means that the write method can only be called once if the stream/writer was opened internally.- Specified by:
writein interfaceTopicMapWriterIF- Parameters:
topicmap- The topic map to be exported/written; an object implementing TopicMapIF
-
write
-
write
-
setup
-
setAdditionalProperties
Sets additional properties for the RDFTopicMapWriter. Accepted properties:- 'preserveReification' (Boolean), corresponds to
setPreserveReification(boolean) - 'preserveScope' (Boolean), corresponds to
setPreserveScope(boolean) - 'filter' (DeciderIF), corresponds to
setFilter(net.ontopia.utils.DeciderIF)
- Specified by:
setAdditionalPropertiesin interfaceTopicMapWriterIF- Parameters:
properties-
- 'preserveReification' (Boolean), corresponds to
-