org.openrdf.sesame.query
Class RdfGraphWriter

java.lang.Object
  extended byorg.openrdf.sesame.query.RdfGraphWriter
All Implemented Interfaces:
GraphQueryResultListener

public class RdfGraphWriter
extends Object
implements GraphQueryResultListener


Constructor Summary
RdfGraphWriter(RDFFormat rdfFormat, OutputStream out)
          Creates a new RdfGraphWriter that will write the received query results to the supplied OutputStream.
 
Method Summary
 void endGraphQueryResult()
          Indicates the end of a graph-like query result.
 void namespace(String prefix, String name)
          Reports a namespace and its (preferred) prefix that might be used in the query result.
 void reportError(String msg)
          Reports an error that has occurred during the query evaluation.
 void startGraphQueryResult()
          Indicates the start of a graph-like query result.
 void triple(Resource subj, URI pred, Value obj)
          Delivers the next triple in the query result.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RdfGraphWriter

public RdfGraphWriter(RDFFormat rdfFormat,
                      OutputStream out)
               throws IOException
Creates a new RdfGraphWriter that will write the received query results to the supplied OutputStream. The rdfFormat parameter controls the serialization format of the written RDF

Parameters:
out - The OutputStream to write the RDF to.
rdfFormat - One of the constants defined in class RDFFormat.
Method Detail

startGraphQueryResult

public void startGraphQueryResult()
                           throws IOException
Indicates the start of a graph-like query result.

Specified by:
startGraphQueryResult in interface GraphQueryResultListener
Throws:
IOException

endGraphQueryResult

public void endGraphQueryResult()
                         throws IOException
Indicates the end of a graph-like query result.

Specified by:
endGraphQueryResult in interface GraphQueryResultListener
Throws:
IOException

namespace

public void namespace(String prefix,
                      String name)
               throws IOException
Description copied from interface: GraphQueryResultListener
Reports a namespace and its (preferred) prefix that might be used in the query result. Namespaces will be reported before the start of the query result as much as possible to accomodate listeners that need these mapping beforehand (like an RDF/XML document writer).

Specified by:
namespace in interface GraphQueryResultListener
Throws:
IOException

triple

public void triple(Resource subj,
                   URI pred,
                   Value obj)
            throws IOException
Description copied from interface: GraphQueryResultListener
Delivers the next triple in the query result.

Specified by:
triple in interface GraphQueryResultListener
Throws:
IOException

reportError

public void reportError(String msg)
                 throws IOException
Description copied from interface: GraphQueryResultListener
Reports an error that has occurred during the query evaluation.

Specified by:
reportError in interface GraphQueryResultListener
Throws:
IOException


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.