net.ontopia.topicmaps.utils.rdf
Class RDFTopicMapWriter

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

public class RDFTopicMapWriter
extends java.lang.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 Summary
protected  DeciderIF filter
           
protected  com.hp.hpl.jena.rdf.arp.StatementHandler handler
           
protected  com.hp.hpl.jena.rdf.model.Model model
           
protected  java.util.Map namepreds
           
protected  java.util.Map preferred_roles
           
protected  boolean preserve_reification
           
protected  boolean preserve_scope
           
protected  java.io.Writer writer
           
 
Constructor Summary
RDFTopicMapWriter(com.hp.hpl.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(java.io.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(java.io.OutputStream stream, java.lang.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(com.hp.hpl.jena.rdf.arp.StatementHandler handler)
          PUBLIC: Creates a writer that writes the RDF representation to the given StatementHandler.
RDFTopicMapWriter(java.io.Writer writer)
          PUBLIC: Creates a writer that writes the RDF representation to the given OutputStream serialized to RDF/XML.
 
Method Summary
 boolean getPreserveReification()
          PUBLIC: Returns true if the writer will use RDF reification to preserve reification in the topic map.
 boolean getPreserveScope()
          PUBLIC: Returns true if the writer will use RDF reification to preserve the scopes in the topic map.
 void setFilter(DeciderIF filter)
          PUBLIC: Sets the filter that decides which topic map constructs are accepted and exported.
 void setPreserveReification(boolean preserve_reification)
          PUBLIC: Controls whether the writer will use RDF reification to preserve reification in the topic map.
 void setPreserveScope(boolean preserve_scope)
          PUBLIC: Controls whether the writer will use RDF reification to preserve the scopes in the topic map.
protected  void setup(TopicMapIF topicmap)
           
protected  void write(AssociationIF assoc)
           
protected  void write(TopicIF topic)
           
 void write(TopicMapIF topicmap)
          PUBLIC: Writes the given topic map to an implicit implementation dependent destination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handler

protected com.hp.hpl.jena.rdf.arp.StatementHandler handler

model

protected com.hp.hpl.jena.rdf.model.Model model

writer

protected java.io.Writer writer

namepreds

protected java.util.Map namepreds

preferred_roles

protected java.util.Map preferred_roles

preserve_scope

protected boolean preserve_scope

preserve_reification

protected boolean preserve_reification

filter

protected DeciderIF filter
Constructor Detail

RDFTopicMapWriter

public RDFTopicMapWriter(com.hp.hpl.jena.rdf.arp.StatementHandler handler)
PUBLIC: Creates a writer that writes the RDF representation to the given StatementHandler.


RDFTopicMapWriter

public RDFTopicMapWriter(java.io.OutputStream stream)
                  throws java.io.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:
java.io.IOException

RDFTopicMapWriter

public RDFTopicMapWriter(java.io.OutputStream stream,
                         java.lang.String encoding)
                  throws java.io.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:
java.io.IOException
Since:
5.1.3

RDFTopicMapWriter

public RDFTopicMapWriter(java.io.Writer writer)
PUBLIC: Creates a writer that writes the RDF representation to the given OutputStream serialized to RDF/XML.


RDFTopicMapWriter

public RDFTopicMapWriter(com.hp.hpl.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 Detail

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(DeciderIF 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)


Copyright © 2000-2012 Ontopia.