Class RDFTopicMapWriter

java.lang.Object
net.ontopia.topicmaps.utils.rdf.RDFTopicMapWriter
All Implemented Interfaces:
TopicMapWriterIF

public class RDFTopicMapWriter extends Object implements 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 Details

    • PROPERTY_PRESERVE_REIFICATION

      public static final String PROPERTY_PRESERVE_REIFICATION
      See Also:
    • PROPERTY_PRESERVE_SCOPE

      public static final String PROPERTY_PRESERVE_SCOPE
      See Also:
    • PROPERTY_FILTER

      public static final String PROPERTY_FILTER
      See Also:
    • handler

      protected org.apache.jena.rdfxml.xmlinput.StatementHandler handler
    • model

      protected org.apache.jena.rdf.model.Model model
    • writer

      protected Writer writer
    • namepreds

      protected Map namepreds
    • preferred_roles

      protected Map preferred_roles
    • preserve_scope

      protected boolean preserve_scope
    • preserve_reification

      protected boolean preserve_reification
    • filter

      protected Predicate 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 RDFTopicMapWriter(OutputStream stream) throws IOException
      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 RDFTopicMapWriter(OutputStream stream, String encoding) throws IOException
      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 RDFTopicMapWriter(Writer writer)
      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 void setFilter(Predicate filter)
      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

      public void write(TopicMapIF topicmap)
      Description copied from interface: TopicMapWriterIF
      PUBLIC: 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:
      write in interface TopicMapWriterIF
      Parameters:
      topicmap - The topic map to be exported/written; an object implementing TopicMapIF
    • write

      protected void write(TopicIF topic)
    • write

      protected void write(AssociationIF assoc)
    • setup

      protected void setup(TopicMapIF topicmap)
    • setAdditionalProperties

      public void setAdditionalProperties(Map<String,Object> properties)
      Sets additional properties for the RDFTopicMapWriter. Accepted properties:
      Specified by:
      setAdditionalProperties in interface TopicMapWriterIF
      Parameters:
      properties -