org.w3c.rdf.examples
Class GraphVizDumpConsumer

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

public class GraphVizDumpConsumer
extends DumpConsumer
implements RDFConsumer


Field Summary
 java.lang.String title
          This is the title to be used for the generated VizGraph graph.
 
Constructor Summary
GraphVizDumpConsumer()
          Default constructor
GraphVizDumpConsumer(java.io.PrintWriter pw)
          Default constructor
 
Method Summary
 void addGraphAttribute(java.lang.String attr)
          Interface to accept graph-level attributes that should be added to the graph's header information.
 void addNamespace(java.lang.String namespacePrefix, java.lang.String namespaceName)
          This method adds a namespace prefix and the associated namespace URI to the consumer.
 void addStatement(Statement s)
          This method outputs text to stdout that is suitable for use in GraphViz.
 void endModel()
          This method dumps out the Graph Viz 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 DOT file generator Input is a URI Output (to stdout) is the input for the DOT program
 void startModel()
          This method dumps the Graph Viz header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

title

public java.lang.String title
This is the title to be used for the generated VizGraph graph. The default is "foo".
Constructor Detail

GraphVizDumpConsumer

public GraphVizDumpConsumer()
Default constructor

GraphVizDumpConsumer

public GraphVizDumpConsumer(java.io.PrintWriter pw)
Default constructor
Method Detail

addGraphAttribute

public void addGraphAttribute(java.lang.String attr)
Interface to accept graph-level attributes that should be added to the graph's header information.
Parameters:
attr - a graph-level attribute string (e.g. size="4,4") to be added to the output

addNamespace

public void addNamespace(java.lang.String namespacePrefix,
                         java.lang.String namespaceName)
This method adds a namespace prefix and the associated namespace URI to the consumer. Instances of the fully qualified namespace URIs in all nodes are replaced with the prefix. Note: empty prefixes are supported, for example, foo.addNamespace( "", fullURI ); Will cause all instances of fullURI to be replaced by the empty string, useful for omitting the doc-source node that SiRPAC produces.
Parameters:
namespacePrefix - The prefix to associate with the fully qualified namespace URI.
namespaceName - The fully qualified namespace name.

startModel

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

endModel

public void endModel()
This method dumps out the Graph Viz 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

addStatement

public void addStatement(Statement s)
This method outputs text to stdout that is suitable for use in GraphViz.
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 DOT file generator Input is a URI Output (to stdout) is the input for the DOT program