org.ontoware.rdf2go.model
Interface ModelSetIO

All Known Subinterfaces:
ModelSet

public interface ModelSetIO

Defines reading and writing to and from readers/writers and streams. The default syntax for ModelSets is TRiX.

Author:
voelkel

Method Summary
 void readFrom(java.io.InputStream in)
          Read from InputStream assuming to read an RDF/XML stream.
 void readFrom(java.io.InputStream reader, Syntax syntax)
          Reads assuming the given syntax.
 void readFrom(java.io.InputStream reader, Syntax syntax, java.lang.String baseURI)
          Reads assuming the given syntax.
 void readFrom(java.io.Reader in)
          Read from Reader assuming to read a TRiX stream in UTF8 encoding.
 void readFrom(java.io.Reader in, Syntax syntax)
          Reads assuming the given syntax.
 void readFrom(java.io.Reader in, Syntax syntax, java.lang.String baseURI)
          Reads assuming the given syntax.
 java.lang.String serialize(Syntax syntax)
          Convenience method to export a ModelSet to a String in a given syntax.
 void writeTo(java.io.OutputStream out)
          Writing a TRiX stream in UTF8 encoding For more info on TRiX read: http://www.hpl.hp.com/techreports/2003/HPL-2003-268.html
 void writeTo(java.io.OutputStream out, Syntax syntax)
          Write the model to the passed writer, using the passed syntax.
 void writeTo(java.io.Writer out)
          Write to writer in UTF8 and TRiX.
 void writeTo(java.io.Writer out, Syntax syntax)
          Write the model to the passed writer, using the passed syntax.
 

Method Detail

readFrom

void readFrom(java.io.Reader in)
              throws java.io.IOException,
                     ModelRuntimeException
Read from Reader assuming to read a TRiX stream in UTF8 encoding. All Models are created with the corresponding names as defined in the TRiX stream as needed. For more info on TRiX read: http://www.hpl.hp.com/techreports/2003/HPL-2003-268.html

Parameters:
in - the input to read
Throws:
java.io.IOException - on IOErrors
ModelRuntimeException - on RDF serialization errors or model errors

readFrom

void readFrom(java.io.Reader in,
              Syntax syntax)
              throws java.io.IOException,
                     ModelRuntimeException,
                     SyntaxNotSupportedException
Reads assuming the given syntax. Encoding defaults to UTF8. All Models are created with the corresponding names as defined in the TRiX stream as needed.

Parameters:
in - the input to read
syntax - syntax to use
Throws:
java.io.IOException - on IOErrors
ModelRuntimeException - on RDF serialisation errors or model errors
SyntaxNotSupportedException - if adapter can't handle the given syntax

readFrom

void readFrom(java.io.Reader in,
              Syntax syntax,
              java.lang.String baseURI)
              throws java.io.IOException,
                     ModelRuntimeException,
                     SyntaxNotSupportedException
Reads assuming the given syntax. Encoding defaults to UTF8. All Models are created with the corresponding names as defined in the TRiX stream as needed.

Parameters:
in - the input to read
syntax - syntax to use
baseURI - baseURI to use
Throws:
java.io.IOException - on IOErrors
ModelRuntimeException - on RDF serialisation errors or model errors
SyntaxNotSupportedException - if adapter can't handle the given syntax

readFrom

void readFrom(java.io.InputStream in)
              throws java.io.IOException,
                     ModelRuntimeException
Read from InputStream assuming to read an RDF/XML stream. All Models are created with the corresponding names as defined in the TRiX stream as needed. For more info on TRiX read: http://www.hpl.hp.com/techreports/2003/HPL-2003-268.html

Parameters:
in - the input to read
Throws:
java.io.IOException - on IOErrors
ModelRuntimeException - on RDF serialisation errors or model errors

readFrom

void readFrom(java.io.InputStream reader,
              Syntax syntax)
              throws java.io.IOException,
                     ModelRuntimeException,
                     SyntaxNotSupportedException
Reads assuming the given syntax. Encoding defaults to UTF8. All Models are created with the corresponding names as defined in the TRiX stream as needed.

Parameters:
in - the input to read
syntax - syntax to use
Throws:
java.io.IOException - on IOErrors
ModelRuntimeException - on RDF serialisation errors or model errors
SyntaxNotSupportedException - if adapter can't handle the given syntax

readFrom

void readFrom(java.io.InputStream reader,
              Syntax syntax,
              java.lang.String baseURI)
              throws java.io.IOException,
                     ModelRuntimeException,
                     SyntaxNotSupportedException
Reads assuming the given syntax. Encoding defaults to UTF8. All Models are created with the corresponding names as defined in the TRiX stream as needed.

Parameters:
in - the input to read
syntax - syntax to use
baseURI - base URI to use
Throws:
java.io.IOException - on IOErrors
ModelRuntimeException - on RDF serialisation errors or model errors
SyntaxNotSupportedException - if adapter can't handle the given syntax

writeTo

void writeTo(java.io.Writer out)
             throws java.io.IOException,
                    ModelRuntimeException
Write to writer in UTF8 and TRiX. For more info on TRiX read: http://www.hpl.hp.com/techreports/2003/HPL-2003-268.html

Parameters:
out - the output to write to
Throws:
java.io.IOException - on IOErrors
ModelRuntimeException - on RDF serialization errors or model errors

writeTo

void writeTo(java.io.Writer out,
             Syntax syntax)
             throws java.io.IOException,
                    ModelRuntimeException,
                    SyntaxNotSupportedException
Write the model to the passed writer, using the passed syntax.

Parameters:
out - the output to write to
syntax - syntax to use
Throws:
java.io.IOException - on IOErrors
ModelRuntimeException - on RDF serialization errors or model errors
SyntaxNotSupportedException - if adapter can't handle the given syntax

writeTo

void writeTo(java.io.OutputStream out)
             throws java.io.IOException,
                    ModelRuntimeException
Writing a TRiX stream in UTF8 encoding For more info on TRiX read: http://www.hpl.hp.com/techreports/2003/HPL-2003-268.html

Parameters:
out - the output to write to
Throws:
java.io.IOException - on IOErrors
ModelRuntimeException - on RDF serialization errors or model errors

writeTo

void writeTo(java.io.OutputStream out,
             Syntax syntax)
             throws java.io.IOException,
                    ModelRuntimeException,
                    SyntaxNotSupportedException
Write the model to the passed writer, using the passed syntax.

Parameters:
out - the output to write to
syntax - syntax to use
Throws:
java.io.IOException - on IOErrors
ModelRuntimeException - on RDF serialization errors or model errors
SyntaxNotSupportedException - if adapter can't handle the given syntax

serialize

java.lang.String serialize(Syntax syntax)
                           throws SyntaxNotSupportedException
Convenience method to export a ModelSet to a String in a given syntax.

Parameters:
syntax -
Returns:
a String, containing the ModelSet content in the given syntax.
Throws:
SyntaxNotSupportedException - if the syntax is not supported


Copyright © 2005-2008 FZI - Forschungszentrum Informatik | Karlsruhe | Germany. All Rights Reserved.