org.ontoware.rdf2go.model
Interface ModelIO

All Known Subinterfaces:
Model

public interface ModelIO


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 in, Syntax syntax, java.lang.String baseURI)
          Reads RDF data from the given InputStream in the given Syntax.
 void readFrom(java.io.Reader in)
          Read from Reader assuming 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 RDF data from the given Reader in the given Syntax.
 java.lang.String serialize(Syntax syntax)
          Convenience method to export a Model to a String in a given syntax.
 void writeTo(java.io.OutputStream out)
          Writing an RDF/XML stream in UTF8 encoding
 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)
          Writing an RDF/XML stream in UTF8 encoding
 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 in UTF8 encoding. Models are read with a default syntax of RDF/XML

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
Reads assuming the given syntax. Encoding defaults to UTF8. When reading TRiX into a Model, the context URI is ignored.

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

readFrom

void readFrom(java.io.Reader in,
              Syntax syntax,
              java.lang.String baseURI)
              throws java.io.IOException,
                     ModelRuntimeException
Reads RDF data from the given Reader in the given Syntax. The baseURI is used to dereference URIs with the syntax ":name".

Parameters:
in -
syntax -
baseURI -
Throws:
java.io.IOException
ModelRuntimeException

readFrom

void readFrom(java.io.InputStream in)
              throws java.io.IOException,
                     ModelRuntimeException
Read from InputStream assuming to read an RDF/XML stream.

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.InputStream reader,
              Syntax syntax)
              throws java.io.IOException,
                     ModelRuntimeException
Reads assuming the given syntax. Encoding defaults to UTF8.

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

readFrom

void readFrom(java.io.InputStream in,
              Syntax syntax,
              java.lang.String baseURI)
              throws java.io.IOException,
                     ModelRuntimeException
Reads RDF data from the given InputStream in the given Syntax. The baseURI is used to dereference URIs with the syntax ":name".

Parameters:
in -
syntax -
baseURI -
Throws:
java.io.IOException
ModelRuntimeException

writeTo

void writeTo(java.io.Writer out)
             throws java.io.IOException,
                    ModelRuntimeException
Writing an RDF/XML stream in UTF8 encoding

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
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

writeTo

void writeTo(java.io.OutputStream out)
             throws java.io.IOException,
                    ModelRuntimeException
Writing an RDF/XML stream in UTF8 encoding

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
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

serialize

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

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


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