org.w3c.rdf.examples
Class NTriplesDumpConsumer

java.lang.Object
  |
  +--org.w3c.rdf.util.xml.DumpConsumer
        |
        +--org.w3c.rdf.examples.NTriplesDumpConsumer

public class NTriplesDumpConsumer
extends DumpConsumer
implements RDFConsumer


Constructor Summary
NTriplesDumpConsumer()
          Default constructor
 
Method Summary
 void addStatement(Statement s)
          This method outputs text to stdout that is suitable for use in NTriples.
static java.lang.String convertGenId(java.lang.String s, boolean addbrackets)
          If the given string looks like a generated node id (aka a annonymous node): http://foo.com/#genid repace it with a string of the following form: _:genid
 void endModel()
          This method handles the NTriples footer.
 NodeFactory getNodeFactory()
          node factory to be used by the parser for creating resources and literals passed to addStatement
static void main(java.lang.String[] args)
          main method for debugging the NTriples output generator Input is a URI Output (to stdout) is the input for the DOT program
 void startModel()
          This method handles the NTriples header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NTriplesDumpConsumer

public NTriplesDumpConsumer()
Default constructor
Method Detail

startModel

public void startModel()
This method handles the NTriples header. Put any special NTriples commands here.
Specified by:
startModel in interface RDFConsumer
Overrides:
startModel in class DumpConsumer

endModel

public void endModel()
This method handles the NTriples footer.
Specified by:
endModel in interface RDFConsumer
Overrides:
endModel in class DumpConsumer

getNodeFactory

public NodeFactory getNodeFactory()
Description copied from interface: RDFConsumer
node factory to be used by the parser for creating resources and literals passed to addStatement
Specified by:
getNodeFactory in interface RDFConsumer
Overrides:
getNodeFactory in class DumpConsumer

convertGenId

public static java.lang.String convertGenId(java.lang.String s,
                                            boolean addbrackets)
If the given string looks like a generated node id (aka a annonymous node): http://foo.com/#genid repace it with a string of the following form: _:genid
Parameters:
s - the input string

addStatement

public void addStatement(Statement s)
This method outputs text to stdout that is suitable for use in NTriples.
Specified by:
addStatement in interface RDFConsumer
Overrides:
addStatement in class DumpConsumer
Parameters:
s -  

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
main method for debugging the NTriples output generator Input is a URI Output (to stdout) is the input for the DOT program