org.openrdf.rio
Interface RdfDocumentWriter

All Known Implementing Classes:
N3Writer, NTriplesWriter, RdfXmlWriter, TurtleWriter

public interface RdfDocumentWriter

An interface defining methods for writing RDF documents.


Method Summary
 void endDocument()
          Ends the document writing.
 void setNamespace(String prefix, String name)
          Sets a mapping from a namespace prefix to a namespace name.
 void startDocument()
          Starts the document writing.
 void writeComment(String comment)
          Writes a comment to the document.
 void writeStatement(Resource subject, URI predicate, Value object)
          Writes a statement to the document.
 

Method Detail

setNamespace

public void setNamespace(String prefix,
                         String name)
                  throws IOException
Sets a mapping from a namespace prefix to a namespace name. Some implementations of this interface may require that namespace are set before the document writing starts (i.e. before startDocument() is called). Note that a mapping can only be defined once for a given namespace name. The RdfDocumentWriter will ignore an attempt to define a mapping for a namespace it already has a mapping for.

Throws:
IOException

startDocument

public void startDocument()
                   throws IOException
Starts the document writing.

Throws:
IOException

endDocument

public void endDocument()
                 throws IOException
Ends the document writing.

Throws:
IOException

writeStatement

public void writeStatement(Resource subject,
                           URI predicate,
                           Value object)
                    throws IOException
Writes a statement to the document. The startDocument() method should have been called before.

Throws:
IOException

writeComment

public void writeComment(String comment)
                  throws IOException
Writes a comment to the document. An implementation may ignore these calls if the format doesn't support comments.

Throws:
IOException


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