org.apache.jena.riot
Class RDFDataMgr

java.lang.Object
  extended by org.apache.jena.riot.RDFDataMgr

public class RDFDataMgr
extends Object

General purpose reader framework for RDF (triples and quads) syntaxes.

It also provides a way to lookup names in different locations and to remap URIs to other URIs.

Extensible - a new syntax can be added to the framework.

Operations fall into the following categories:


Field Summary
static Symbol streamManagerSymbol
           
 
Constructor Summary
RDFDataMgr()
           
 
Method Summary
static WriterDatasetRIOT createDatasetWriter(Lang lang)
          Create a writer for an RDF language
static WriterDatasetRIOT createDatasetWriter(RDFFormat serialization)
          Create a writer for an RDF language
static WriterGraphRIOT createGraphWriter(Lang lang)
          Create a writer for an RDF language
static WriterGraphRIOT createGraphWriter(RDFFormat serialization)
          Create a writer for an RDF language
static ReaderRIOT createReader(Lang lang)
           
static Lang determineLang(String target, String ctStr, Lang hintLang)
          Determine the Lang, given the URI target, any content type header string and a hint
static Dataset loadDataset(String uri)
          Create a memory Dataset and read in some data
static Dataset loadDataset(String uri, Lang lang)
          Create a memory Dataset and read in some data
static DatasetGraph loadDatasetGraph(String uri)
          Create a memory DatasetGraph and read in some data
static DatasetGraph loadDatasetGraph(String uri, Lang lang)
          Create a memory DatasetGraph and read in some data
static Graph loadGraph(String uri)
          Create a memory Graph and read in some data
static Graph loadGraph(String uri, Lang lang)
          Create a memory Graph and read in some data
static Model loadModel(String uri)
          Create a memory Model and read in some data
static Model loadModel(String uri, Lang lang)
          Create a memory Model and read in some data
static TypedInputStream open(String filenameOrURI)
          Open a stream to the destination (URI or filename) Performs content negotiation, including looking at file extension.
static TypedInputStream open(String filenameOrURI, Context context)
          Open a stream to the destination (URI or filename) Performs content negotiation, including looking at file extension.
static TypedInputStream open(String filenameOrURI, StreamManager streamManager)
          Open a stream to the destination (URI or filename) Performs content negotiation, including looking at file extension.
static void parse(StreamRDF sink, InputStream in, Lang lang)
          Read RDF data.
static void parse(StreamRDF sink, InputStream in, String base, Lang hintLang)
          Read RDF data.
static void parse(StreamRDF sink, InputStream in, String base, Lang hintLang, Context context)
          Read RDF data.
static void parse(StreamRDF sink, Reader in, Lang lang)
          Read RDF data.
static void parse(StreamRDF sink, Reader in, String base, Lang hintLang)
          Read RDF data.
static void parse(StreamRDF sink, Reader in, String base, Lang hintLang, Context context)
          Read RDF data.
static void parse(StreamRDF sink, String uri)
          Read RDF data.
static void parse(StreamRDF sink, String uri, Lang lang)
          Read RDF data.
static void parse(StreamRDF sink, String uri, Lang hintLang, Context context)
          Read RDF data.
static void parse(StreamRDF sink, String uri, String base, Lang hintLang, Context context)
          Read RDF data.
static void parse(StreamRDF sink, TypedInputStream in)
          Read RDF data.
static void parse(StreamRDF sink, TypedInputStream in, String base)
          Read RDF data.
static void parse(StreamRDF sink, TypedInputStream in, String base, Context context)
          Read RDF data.
static void read(DatasetGraph dataset, InputStream in, Lang lang)
          Read quads or triples into a dataset with bytes from an input stream.
static void read(DatasetGraph dataset, InputStream in, String base, Lang lang)
          Read quads or triples into a dataset with bytes from an input stream.
static void read(DatasetGraph dataset, Reader in, String base, Lang lang)
          Deprecated. use an InputStream or a StringReader.
static void read(DatasetGraph dataset, String uri)
          Read quads or triples into a Dataset from the given location, with hint of language.
static void read(DatasetGraph dataset, String uri, Lang hintLang)
          Read quads or triples into a Dataset from the given location, with hint of language.
static void read(DatasetGraph dataset, String uri, Lang hintLang, Context context)
          Read quads or triples into a Dataset from the given location.
static void read(DatasetGraph dataset, StringReader in, String base, Lang lang)
          Read quads into a dataset with chars from a StringReader.
static void read(DatasetGraph dataset, String uri, String base, Lang hintLang)
          Read quads or triples into a Dataset from the given location, with hint of language.
static void read(DatasetGraph dataset, String uri, String base, Lang hintLang, Context context)
          Read quads or triples into a Dataset from the given location.
static void read(Dataset dataset, InputStream in, Lang lang)
          Read quads or triples into a dataset with bytes from an input stream.
static void read(Dataset dataset, InputStream in, String base, Lang lang)
          Read quads or triples into a dataset with bytes from an input stream.
static void read(Dataset dataset, Reader in, String base, Lang lang)
          Deprecated. use an InputStream or a StringReader.
static void read(Dataset dataset, String uri)
          Read quads or triples into a Dataset from the given location, with hint of language.
static void read(Dataset dataset, String uri, Lang hintLang)
          Read quads or triples into a Dataset from the given location, with hint of language.
static void read(Dataset dataset, String uri, Lang hintLang, Context context)
          Read quads or triples into a Dataset from the given location.
static void read(Dataset dataset, StringReader in, String base, Lang lang)
          Read quads into a dataset with chars from a StringReader.
static void read(Dataset dataset, String uri, String base, Lang hintLang)
          Read quads or triples into a Dataset from the given location, with hint of language.
static void read(Dataset dataset, String uri, String base, Lang hintLang, Context context)
          Read quads or triples into a Dataset from the given location.
static void read(Graph graph, InputStream in, Lang lang)
          Read triples into a Model with bytes from an InputStream.
static void read(Graph graph, InputStream in, String base, Lang lang)
          Read triples into a Model with bytes from an InputStream.
static void read(Graph graph, Reader in, String base, Lang lang)
          Deprecated. Use an InputStream or StringReader.
static void read(Graph graph, String uri)
          Read triples into a Model from the given location.
static void read(Graph graph, String uri, Context context)
          Read triples into a Model from the given location, with some parameters for the reader
static void read(Graph graph, String uri, Lang hintLang)
          Read triples into a Model from the given location, with a hint of the language (MIME type or short name)
static void read(Graph graph, String uri, Lang hintLang, Context context)
          Read triples into a Model from the given location, with hint of language and with some parameters for the reader
static void read(Graph graph, StringReader in, String base, Lang lang)
          Read triples into a model with chars from a StringReader.
static void read(Graph graph, String uri, String base, Lang hintLang)
          Read triples into a Model from the given location, with hint of language and the with some parameters for the reader
static void read(Graph graph, String uri, String base, Lang hintLang, Context context)
          Read triples into a Model from the given location, with hint of language and the with some parameters for the reader Throws parse errors depending on the language and reader; the graph may be partially updated.
static void read(Model model, InputStream in, Lang lang)
          Read triples into a Model with bytes from an InputStream.
static void read(Model model, InputStream in, String base, Lang lang)
          Read triples into a Model with bytes from an InputStream.
static void read(Model model, Reader in, String base, Lang lang)
          Deprecated. Use an InputStream or StringReader.
static void read(Model model, String uri)
          Read triples into a Model from the given location.
static void read(Model model, String uri, Context context)
          Read triples into a Model from the given location, with some parameters for the reader
static void read(Model model, String uri, Lang hintLang)
          Read triples into a Model from the given location, with a hint of the language (MIME type)
static void read(Model model, String uri, Lang hintLang, Context context)
          Read triples into a Model from the given location, with hint of language and the with some parameters for the reader
static void read(Model model, StringReader in, String base, Lang lang)
          Read triples into a model with chars from a StringReader.
static void read(Model model, String uri, String base, Lang hintLang)
          Read triples into a Model from the given location, with hint of language and with some parameters for the reader
static void read(Model model, String uri, String base, Lang hintLang, Context context)
          Read triples into a Model from the given location, with hint of language and with some parameters for the reader.
static void write(OutputStream out, DatasetGraph dataset, Lang lang)
          Write the DatasetGraph to the output stream in the default serialization for the language.
static void write(OutputStream out, DatasetGraph dataset, RDFFormat serialization)
          Write the graph to the output stream in the default serialization for the language.
static void write(OutputStream out, Dataset dataset, Lang lang)
          Write the Dataset to the output stream in the default serialization for the language.
static void write(OutputStream out, Dataset dataset, RDFFormat serialization)
          Write the graph to the output stream in the default serialization for the language.
static void write(OutputStream out, Graph graph, Lang lang)
          Write the graph to the output stream in the default serialization for the language.
static void write(OutputStream out, Graph graph, RDFFormat serialization)
          Write the graph to the output stream in the default serialization for the language.
static void write(OutputStream out, Model model, Lang lang)
          Write the model to the output stream in the default serialization for the language.
static void write(OutputStream out, Model model, RDFFormat serialization)
          Write the model to the output stream in the default serialization for the language.
static void write(StringWriter out, DatasetGraph dataset, Lang lang)
          Write the DatasetGraph to the output stream in the default serialization for the language.
static void write(StringWriter out, DatasetGraph dataset, RDFFormat serialization)
          Write the graph to the output stream in the default serialization for the language.
static void write(StringWriter out, Dataset dataset, Lang lang)
          Write the graph to the output stream in the default serialization for the language.
static void write(StringWriter out, Dataset dataset, RDFFormat serialization)
          Write the graph to the output stream in the default serialization for the language.
static void write(StringWriter out, Graph graph, Lang lang)
          Write the graph to the output stream in the default serialization for the language.
static void write(StringWriter out, Graph graph, RDFFormat serialization)
          Write the graph to the output stream in the default serialization for the language.
static void write(StringWriter out, Model model, Lang lang)
          Write the graph to the output stream in the default serialization for the language.
static void write(StringWriter out, Model model, RDFFormat serialization)
          Write the graph to the output stream in the default serialization for the language.
static void write(Writer out, DatasetGraph dataset, RDFFormat serialization)
          Deprecated. Use of writers is deprecated - use an OutputStream
static void write(Writer out, Dataset dataset, RDFFormat serialization)
          Deprecated. Use of writers is deprecated - use an OutputStream
static void write(Writer out, Graph graph, Lang lang)
          Deprecated. Use of writers is deprecated - use an OutputStream
static void write(Writer out, Graph graph, RDFFormat serialization)
          Deprecated. Use of writers is deprecated - use an OutputStream
static void write(Writer out, Model model, Lang lang)
          Deprecated. Use of writers is deprecated - use an OutputStream
static void write(Writer out, Model model, RDFFormat serialization)
          Deprecated. Use of writers is deprecated - use an OutputStream
static void writeQuads(OutputStream out, Iterator<Quad> iterator)
          Write an iterator of quads (in N-Quads)
static void writeTriples(OutputStream out, Iterator<Triple> iterator)
          Write an iterator of triples (in N-Triples)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

streamManagerSymbol

public static Symbol streamManagerSymbol
Constructor Detail

RDFDataMgr

public RDFDataMgr()
Method Detail

read

public static void read(Model model,
                        String uri)
Read triples into a Model from the given location. The syntax is detemined from input source URI (content negotiation or extension).

Parameters:
model - Destination for the RDF read.
uri - URI to read from (includes file: and a plain file name).
Throws:
RiotNotFoundException - if the location is not found - the model is unchanged.
See Also:
read(Model,String,Lang,Context)

read

public static void read(Graph graph,
                        String uri)
Read triples into a Model from the given location. The syntax is detemined from input source URI (content negotiation or extension).

Parameters:
graph - Destination for the RDF read.
uri - URI to read from (includes file: and a plain file name).
Throws:
RiotNotFoundException - if the location is not found - the graph is unchanged.
See Also:
read(Graph,String,Lang,Context)

read

public static void read(Model model,
                        String uri,
                        Lang hintLang)
Read triples into a Model from the given location, with a hint of the language (MIME type)

Parameters:
model - Destination for the RDF read.
uri - URI to read from (includes file: and a plain file name).
hintLang - Hint for the syntax.
Throws:
RiotNotFoundException - if the location is not found - the model is unchanged.
See Also:
read(Model,String,String,Lang,Context)

read

public static void read(Graph graph,
                        String uri,
                        Lang hintLang)
Read triples into a Model from the given location, with a hint of the language (MIME type or short name)

Parameters:
graph - Destination for the RDF read.
uri - URI to read from (includes file: and a plain file name).
hintLang - Hint for the syntax.
Throws:
RiotNotFoundException - if the location is not found - the graph is unchanged.
See Also:
read(Graph,String,Lang,Context)

read

public static void read(Model model,
                        String uri,
                        String base,
                        Lang hintLang)
Read triples into a Model from the given location, with hint of language and with some parameters for the reader

Parameters:
model - Destination for the RDF read.
uri - URI to read from (includes file: and a plain file name).
base - Base URI (defaults to uri).
hintLang - Hint for the syntax
Throws:
RiotNotFoundException - if the location is not found - the model is unchanged.
See Also:
Throws parse errors depending on the language and reader; the model may be partially updated.

read

public static void read(Graph graph,
                        String uri,
                        String base,
                        Lang hintLang)
Read triples into a Model from the given location, with hint of language and the with some parameters for the reader

Parameters:
graph - Destination for the RDF read.
uri - URI to read from (includes file: and a plain file name).
base - Base URI (defaults to uri).
hintLang - Hint for the syntax
Throws:
RiotNotFoundException - if the location is not found - the graph is unchanged.
See Also:
Throws parse errors depending on the language and reader; the Model model may be partially updated.

read

public static void read(Model model,
                        String uri,
                        Context context)
Read triples into a Model from the given location, with some parameters for the reader

Parameters:
model - Destination for the RDF read
uri - URI to read from (includes file: and a plain file name).
context - Content object to control reading process.
Throws:
RiotNotFoundException - if the location is not found - the model is unchanged.
See Also:
read(Model,String,String,Lang,Context)

read

public static void read(Graph graph,
                        String uri,
                        Context context)
Read triples into a Model from the given location, with some parameters for the reader

Parameters:
graph - Destination for the RDF read
uri - URI to read from (includes file: and a plain file name).
context - Content object to control reading process.
Throws:
RiotNotFoundException - if the location is not found - the graph is unchanged.
See Also:
read(Graph,String,String,Lang,Context)

read

public static void read(Model model,
                        String uri,
                        Lang hintLang,
                        Context context)
Read triples into a Model from the given location, with hint of language and the with some parameters for the reader

Parameters:
model - Destination for the RDF read
uri - URI to read from (includes file: and a plain file name).
hintLang - Hint for the syntax
context - Content object to control reading process.
Throws:
RiotNotFoundException - if the location is not found - the model is unchanged.
See Also:
read(Model,String,String,Lang,Context)

read

public static void read(Graph graph,
                        String uri,
                        Lang hintLang,
                        Context context)
Read triples into a Model from the given location, with hint of language and with some parameters for the reader

Parameters:
graph - Destination for the RDF read
uri - URI to read from (includes file: and a plain file name).
hintLang - Hint for the syntax
context - Content object to control reading process.
Throws:
RiotNotFoundException - if the location is not found - the graph is unchanged.
See Also:
read(Graph,String,String,Lang,Context)

read

public static void read(Model model,
                        String uri,
                        String base,
                        Lang hintLang,
                        Context context)
Read triples into a Model from the given location, with hint of language and with some parameters for the reader. Throws parse errors depending on the language and reader; the model may be partially updated.

Parameters:
model - Destination for the RDF read.
uri - URI to read from (includes file: and a plain file name).
base - Base URI (defaults to uri).
hintLang - Hint for the syntax
context - Content object to control reading process.
Throws:
RiotNotFoundException - if the location is not found - the model is unchanged.

read

public static void read(Graph graph,
                        String uri,
                        String base,
                        Lang hintLang,
                        Context context)
Read triples into a Model from the given location, with hint of language and the with some parameters for the reader Throws parse errors depending on the language and reader; the graph may be partially updated.

Parameters:
graph - Destination for the RDF read.
uri - URI to read from (includes file: and a plain file name).
base - Base URI (defaults to uri).
hintLang - Hint for the syntax
context - Content object to control reading process.
Throws:
RiotNotFoundException - if the location is not found - the model is unchanged.

read

public static void read(Model model,
                        InputStream in,
                        Lang lang)
Read triples into a Model with bytes from an InputStream. A base URI and a syntax can be provided. The base URI defualts to "no base" in which case the data should have no relative URIs. The lang gives the syntax of the stream.

Parameters:
model - Destination for the RDF read.
in - InputStream
lang - Language syntax

read

public static void read(Graph graph,
                        InputStream in,
                        Lang lang)
Read triples into a Model with bytes from an InputStream. A base URI and a syntax can be provided. The base URI defualts to "no base" in which case the data should have no relative URIs. The lang gives the syntax of the stream.

Parameters:
graph - Destination for the RDF read.
in - InputStream
lang - Language syntax

read

public static void read(Model model,
                        InputStream in,
                        String base,
                        Lang lang)
Read triples into a Model with bytes from an InputStream. A base URI and a syntax can be provided. The base URI defualts to "no base" in which case the data should have no relative URIs. The lang gives the syntax of the stream.

Parameters:
model - Destination for the RDF read.
in - InputStream
base - Base URI
lang - Language syntax

read

public static void read(Graph graph,
                        InputStream in,
                        String base,
                        Lang lang)
Read triples into a Model with bytes from an InputStream. A base URI and a syntax can be provided. The base URI defualts to "no base" in which case the data should have no relative URIs. The lang gives the syntax of the stream.

Parameters:
graph - Destination for the RDF read.
in - InputStream
base - Base URI
lang - Language syntax

read

@Deprecated
public static void read(Model model,
                                   Reader in,
                                   String base,
                                   Lang lang)
Deprecated. Use an InputStream or StringReader.

Read triples into a model with chars from an Reader. Use of java.io.Readers is not encouraged - use with a StringReader is the primary use case. For files, open a FileInputStream to ensure correct character set handling.

Parameters:
model - Destination for the RDF read.
in - Reader
base - Base URI
lang - Language syntax

read

@Deprecated
public static void read(Graph graph,
                                   Reader in,
                                   String base,
                                   Lang lang)
Deprecated. Use an InputStream or StringReader.

Read triples into a model with chars from an Reader. Use of java.io.Readers is not encouraged - use with a StringReader is the primary use case. For files, open a FileInputStream to ensure correct character set handling.

Parameters:
graph - Destination for the RDF read.
in - Reader
base - Base URI
lang - Language syntax

read

public static void read(Model model,
                        StringReader in,
                        String base,
                        Lang lang)
Read triples into a model with chars from a StringReader.

Parameters:
model - Destination for the RDF read.
in - InputStream
base - Base URI
lang - Language syntax

read

public static void read(Graph graph,
                        StringReader in,
                        String base,
                        Lang lang)
Read triples into a model with chars from a StringReader.

Parameters:
graph - Destination for the RDF read.
in - InputStream
base - Base URI
lang - Language syntax

loadModel

public static Model loadModel(String uri)
Create a memory Model and read in some data

See Also:
read(Model,String)

loadModel

public static Model loadModel(String uri,
                              Lang lang)
Create a memory Model and read in some data

See Also:
read(Model,String,Lang)

loadGraph

public static Graph loadGraph(String uri)
Create a memory Graph and read in some data

See Also:
read(Graph,String)

loadGraph

public static Graph loadGraph(String uri,
                              Lang lang)
Create a memory Graph and read in some data

See Also:
read(Graph,String,Lang)

loadDataset

public static Dataset loadDataset(String uri)
Create a memory Dataset and read in some data

See Also:
read(Dataset,String)

loadDataset

public static Dataset loadDataset(String uri,
                                  Lang lang)
Create a memory Dataset and read in some data

See Also:
read(Dataset,String,Lang)

loadDatasetGraph

public static DatasetGraph loadDatasetGraph(String uri)
Create a memory DatasetGraph and read in some data

See Also:
read(DatasetGraph,String)

loadDatasetGraph

public static DatasetGraph loadDatasetGraph(String uri,
                                            Lang lang)
Create a memory DatasetGraph and read in some data

See Also:
read(DatasetGraph,String,Lang)

read

public static void read(Dataset dataset,
                        String uri)
Read quads or triples into a Dataset from the given location, with hint of language.

Parameters:
dataset - Destination
uri - URI to read from (includes file: and a plain file name).
See Also:
read(Dataset, String, String, Lang, Context)

read

public static void read(DatasetGraph dataset,
                        String uri)
Read quads or triples into a Dataset from the given location, with hint of language.

Parameters:
dataset - Destination
uri - URI to read from (includes file: and a plain file name).
See Also:
read(DatasetGraph, String, String, Lang, Context)

read

public static void read(Dataset dataset,
                        String uri,
                        Lang hintLang)
Read quads or triples into a Dataset from the given location, with hint of language.

Parameters:
dataset - Destination
uri - URI to read from (includes file: and a plain file name).
hintLang - Language syntax
See Also:
read(Dataset, String, String, Lang, Context)

read

public static void read(DatasetGraph dataset,
                        String uri,
                        Lang hintLang)
Read quads or triples into a Dataset from the given location, with hint of language.

Parameters:
dataset - Destination
uri - URI to read from (includes file: and a plain file name).
hintLang - Language syntax
See Also:
read(DatasetGraph, String, String, Lang, Context)

read

public static void read(Dataset dataset,
                        String uri,
                        String base,
                        Lang hintLang)
Read quads or triples into a Dataset from the given location, with hint of language.

Parameters:
dataset - Destination
uri - URI to read from (includes file: and a plain file name).
base - Base URI (defaults to uri).
hintLang - Language syntax
See Also:
read(Dataset, String, String, Lang, Context)

read

public static void read(DatasetGraph dataset,
                        String uri,
                        String base,
                        Lang hintLang)
Read quads or triples into a Dataset from the given location, with hint of language.

Parameters:
dataset - Destination
uri - URI to read from (includes file: and a plain file name).
base - Base URI (defaults to uri).
hintLang - Language syntax
See Also:
read(DatasetGraph, String, String, Lang, Context)

read

public static void read(Dataset dataset,
                        String uri,
                        Lang hintLang,
                        Context context)
Read quads or triples into a Dataset from the given location.

Parameters:
dataset - Destination
uri - URI to read from (includes file: and a plain file name).
hintLang - Language syntax
See Also:
read(Dataset, String, String, Lang, Context)

read

public static void read(DatasetGraph dataset,
                        String uri,
                        Lang hintLang,
                        Context context)
Read quads or triples into a Dataset from the given location.

Parameters:
dataset - Destination
uri - URI to read from (includes file: and a plain file name).
hintLang - Language syntax
See Also:
read(DatasetGraph, String, String, Lang, Context)

read

public static void read(Dataset dataset,
                        String uri,
                        String base,
                        Lang hintLang,
                        Context context)
Read quads or triples into a Dataset from the given location.

Parameters:
dataset - Destination
uri - URI to read from (includes file: and a plain file name).
base - Base URI (defaults to uri).
hintLang - Language syntax
context - Context for the reader
Throws:
RiotNotFoundException - if the location is not found - the dataset is unchanged. Throws parse errors depending on the language and reader; the dataset may be partially updated.
See Also:
read(Dataset, String, String, Lang, Context)

read

public static void read(DatasetGraph dataset,
                        String uri,
                        String base,
                        Lang hintLang,
                        Context context)
Read quads or triples into a Dataset from the given location.

Parameters:
dataset - Destination
uri - URI to read from (includes file: and a plain file name).
base - Base URI (defaults to uri).
hintLang - Language syntax
context - Context for the reader
Throws:
RiotNotFoundException - if the location is not found - the dataset is unchanged. Throws parse errors depending on the language and reader; the dataset may be partially updated.
See Also:
read(Dataset, String, String, Lang, Context)

read

public static void read(Dataset dataset,
                        InputStream in,
                        Lang lang)
Read quads or triples into a dataset with bytes from an input stream.

Parameters:
dataset - Destination
in - InputStream
lang - Language syntax

read

public static void read(DatasetGraph dataset,
                        InputStream in,
                        Lang lang)
Read quads or triples into a dataset with bytes from an input stream.

Parameters:
dataset - Destination
in - InputStream
lang - Language syntax

read

public static void read(Dataset dataset,
                        InputStream in,
                        String base,
                        Lang lang)
Read quads or triples into a dataset with bytes from an input stream.

Parameters:
dataset - Destination
in - InputStream
base - Base URI
lang - Language syntax

read

public static void read(DatasetGraph dataset,
                        InputStream in,
                        String base,
                        Lang lang)
Read quads or triples into a dataset with bytes from an input stream.

Parameters:
dataset - Destination
in - InputStream
base - Base URI
lang - Language syntax

read

@Deprecated
public static void read(Dataset dataset,
                                   Reader in,
                                   String base,
                                   Lang lang)
Deprecated. use an InputStream or a StringReader.

Read quads into a dataset with chars from an Reader. Use java.io.Readers is not encouraged - use with a StringReader is the primary use case. For files, open a FileInputStream to ensure correct character set handling.

Parameters:
dataset - Destination
in - InputStream
base - Base URI
lang - Language syntax

read

@Deprecated
public static void read(DatasetGraph dataset,
                                   Reader in,
                                   String base,
                                   Lang lang)
Deprecated. use an InputStream or a StringReader.

Read quads into a dataset with chars from an Reader. Use java.io.Readers is not encouraged - use with a StringReader is the primary use case. For files, open a FileInputStream to ensure correct character set handling.

Parameters:
dataset - Destination
in - InputStream
base - Base URI
lang - Language syntax

read

public static void read(Dataset dataset,
                        StringReader in,
                        String base,
                        Lang lang)
Read quads into a dataset with chars from a StringReader. Use java.io.Readers is not encouraged - use with a StringReader is the primary use case. For files, open a FileInputStream to ensure correct character set handling.

Parameters:
dataset - Destination
in - InputStream
base - Base URI
lang - Language syntax

read

public static void read(DatasetGraph dataset,
                        StringReader in,
                        String base,
                        Lang lang)
Read quads into a dataset with chars from a StringReader. Use java.io.Readers is not encouraged - use with a StringReader is the primary use case. For files, open a FileInputStream to ensure correct character set handling.

Parameters:
dataset - Destination
in - InputStream
base - Base URI
lang - Language syntax

parse

public static void parse(StreamRDF sink,
                         String uri)
Read RDF data.

Parameters:
sink - Destination for the RDF read.
uri - URI to read from (includes file: and a plain file name).

parse

public static void parse(StreamRDF sink,
                         String uri,
                         Lang lang)
Read RDF data.

Parameters:
sink - Destination for the RDF read.
uri - URI to read from (includes file: and a plain file name).
lang - Hint for the syntax

parse

public static void parse(StreamRDF sink,
                         String uri,
                         Lang hintLang,
                         Context context)
Read RDF data.

Parameters:
sink - Destination for the RDF read.
uri - URI to read from (includes file: and a plain file name).
hintLang - Hint for the syntax
context - Content object to control reading process.

parse

public static void parse(StreamRDF sink,
                         String uri,
                         String base,
                         Lang hintLang,
                         Context context)
Read RDF data.

Parameters:
sink - Destination for the RDF read.
uri - URI to read from (includes file: and a plain file name).
base - Base URI (defaults to uri).
hintLang - Hint for the syntax
context - Content object to control reading process.

parse

public static void parse(StreamRDF sink,
                         InputStream in,
                         Lang lang)
Read RDF data.

Parameters:
sink - Destination for the RDF read.
in - Bytes to read.
lang - Syntax for the stream.

parse

public static void parse(StreamRDF sink,
                         InputStream in,
                         String base,
                         Lang hintLang)
Read RDF data.

Parameters:
sink - Destination for the RDF read.
in - Bytes to read.
base - Base URI (defaults to uri).
hintLang - Hint for the syntax

parse

public static void parse(StreamRDF sink,
                         Reader in,
                         String base,
                         Lang hintLang,
                         Context context)
Read RDF data.

Parameters:
sink - Destination for the RDF read.
in - Reader
base - Base URI (defaults to uri).
hintLang - Hint for the syntax
context - Content object to control reading process.

parse

public static void parse(StreamRDF sink,
                         Reader in,
                         Lang lang)
Read RDF data.

Parameters:
sink - Destination for the RDF read.
in - Reader
lang - Syntax for the stream.

parse

public static void parse(StreamRDF sink,
                         Reader in,
                         String base,
                         Lang hintLang)
Read RDF data.

Parameters:
sink - Destination for the RDF read.
in - Reader
base - Base URI (defaults to uri).
hintLang - Hint for the syntax

parse

public static void parse(StreamRDF sink,
                         InputStream in,
                         String base,
                         Lang hintLang,
                         Context context)
Read RDF data.

Parameters:
sink - Destination for the RDF read.
in - Bytes to read.
base - Base URI (defaults to uri).
hintLang - Hint for the syntax
context - Content object to control reading process.

parse

public static void parse(StreamRDF sink,
                         TypedInputStream in)
Read RDF data.

Parameters:
sink - Destination for the RDF read.
in - Bytes to read. This must include the content type.

parse

public static void parse(StreamRDF sink,
                         TypedInputStream in,
                         String base)
Read RDF data.

Parameters:
sink - Destination for the RDF read.
in - Bytes to read.
base - Base URI

parse

public static void parse(StreamRDF sink,
                         TypedInputStream in,
                         String base,
                         Context context)
Read RDF data.

Parameters:
sink - Destination for the RDF read.
in - Bytes to read.
base - Base URI
context - Content object to control reading process.

open

public static TypedInputStream open(String filenameOrURI)
Open a stream to the destination (URI or filename) Performs content negotiation, including looking at file extension.

Parameters:
filenameOrURI -
Returns:
TypedInputStream

open

public static TypedInputStream open(String filenameOrURI,
                                    Context context)
Open a stream to the destination (URI or filename) Performs content negotiation, including looking at file extension.

Parameters:
filenameOrURI -
context -
Returns:
TypedInputStream

open

public static TypedInputStream open(String filenameOrURI,
                                    StreamManager streamManager)
Open a stream to the destination (URI or filename) Performs content negotiation, including looking at file extension.

Parameters:
filenameOrURI -
streamManager -
Returns:
TypedInputStream

createReader

public static ReaderRIOT createReader(Lang lang)
See Also:
to go from Jena short name to {@linkplain Lang}, to go from content type to {@linkplain Lang}

determineLang

public static Lang determineLang(String target,
                                 String ctStr,
                                 Lang hintLang)
Determine the Lang, given the URI target, any content type header string and a hint


write

public static void write(OutputStream out,
                         Model model,
                         Lang lang)
Write the model to the output stream in the default serialization for the language.

Parameters:
out - OutputStream
model - Graph to write
lang - Language for the seralization.

write

public static void write(OutputStream out,
                         Model model,
                         RDFFormat serialization)
Write the model to the output stream in the default serialization for the language.

Parameters:
out - OutputStream
model - Model to write
serialization - Serialization format

write

public static void write(StringWriter out,
                         Model model,
                         Lang lang)
Write the graph to the output stream in the default serialization for the language.

Parameters:
out - StringWriter
model - Model to write
lang - Serialization format

write

@Deprecated
public static void write(Writer out,
                                    Model model,
                                    Lang lang)
Deprecated. Use of writers is deprecated - use an OutputStream

Write the graph to the output stream in the default serialization for the language.

Parameters:
out - Writer
model - Model to write
lang - Serialization format

write

public static void write(StringWriter out,
                         Model model,
                         RDFFormat serialization)
Write the graph to the output stream in the default serialization for the language.

Parameters:
out - StringWriter
model - Model to write
serialization - Serialization format

write

@Deprecated
public static void write(Writer out,
                                    Model model,
                                    RDFFormat serialization)
Deprecated. Use of writers is deprecated - use an OutputStream

Write the graph to the output stream in the default serialization for the language.

Parameters:
out - OutputStream
model - Model to write
serialization - Serialization format

write

public static void write(OutputStream out,
                         Graph graph,
                         Lang lang)
Write the graph to the output stream in the default serialization for the language.

Parameters:
out - OutputStream
graph - Graph to write
lang - Language for the seralization.

write

public static void write(OutputStream out,
                         Graph graph,
                         RDFFormat serialization)
Write the graph to the output stream in the default serialization for the language.

Parameters:
out - OutputStream
graph - Graph to write
serialization - Serialization format

write

public static void write(StringWriter out,
                         Graph graph,
                         Lang lang)
Write the graph to the output stream in the default serialization for the language.

Parameters:
out - StringWriter
graph - Graph to write
lang - Serialization format

write

@Deprecated
public static void write(Writer out,
                                    Graph graph,
                                    Lang lang)
Deprecated. Use of writers is deprecated - use an OutputStream

Write the graph to the output stream in the default serialization for the language.

Parameters:
out - Writer
graph - Graph to write
lang - Serialization format

write

public static void write(StringWriter out,
                         Graph graph,
                         RDFFormat serialization)
Write the graph to the output stream in the default serialization for the language.

Parameters:
out - OutputStream
graph - Graph to write
serialization - Serialization format

write

@Deprecated
public static void write(Writer out,
                                    Graph graph,
                                    RDFFormat serialization)
Deprecated. Use of writers is deprecated - use an OutputStream

Write the graph to the output stream in the default serialization for the language.

Parameters:
out - OutputStream
graph - Graph to write
serialization - Serialization format

write

public static void write(OutputStream out,
                         Dataset dataset,
                         Lang lang)
Write the Dataset to the output stream in the default serialization for the language.

Parameters:
out - OutputStream
dataset - Dataset to write
lang - Language for the seralization.

write

public static void write(OutputStream out,
                         Dataset dataset,
                         RDFFormat serialization)
Write the graph to the output stream in the default serialization for the language.

Parameters:
out - OutputStream
dataset - Dataset to write
serialization - Serialization format

write

public static void write(StringWriter out,
                         Dataset dataset,
                         RDFFormat serialization)
Write the graph to the output stream in the default serialization for the language.

Parameters:
out - Writer
dataset - Dataset to write
serialization - Serialization format

write

public static void write(StringWriter out,
                         Dataset dataset,
                         Lang lang)
Write the graph to the output stream in the default serialization for the language.

Parameters:
out - StringWriter
dataset - Dataset to write
lang - Language for the seralization.

write

@Deprecated
public static void write(Writer out,
                                    Dataset dataset,
                                    RDFFormat serialization)
Deprecated. Use of writers is deprecated - use an OutputStream

Write the graph to the output stream in the default serialization for the language.

Parameters:
out - Writer
dataset - Dataset to write
serialization - Serialization format

write

public static void write(OutputStream out,
                         DatasetGraph dataset,
                         Lang lang)
Write the DatasetGraph to the output stream in the default serialization for the language.

Parameters:
out - OutputStream
dataset - DatasetGraph to write
lang - Language for the seralization.

write

public static void write(OutputStream out,
                         DatasetGraph dataset,
                         RDFFormat serialization)
Write the graph to the output stream in the default serialization for the language.

Parameters:
out - OutputStream
dataset - DatasetGraph to write
serialization - Serialization format

write

public static void write(StringWriter out,
                         DatasetGraph dataset,
                         Lang lang)
Write the DatasetGraph to the output stream in the default serialization for the language.

Parameters:
out - StringWriter
dataset - DatasetGraph to write
lang - Language for the seralization.

write

public static void write(StringWriter out,
                         DatasetGraph dataset,
                         RDFFormat serialization)
Write the graph to the output stream in the default serialization for the language.

Parameters:
out - StringWriter
dataset - DatasetGraph to write
serialization - Serialization format

write

@Deprecated
public static void write(Writer out,
                                    DatasetGraph dataset,
                                    RDFFormat serialization)
Deprecated. Use of writers is deprecated - use an OutputStream

Write the graph to the output stream in the default serialization for the language.

Parameters:
out - Writer
dataset - DatasetGraph to write
serialization - Serialization format

writeTriples

public static void writeTriples(OutputStream out,
                                Iterator<Triple> iterator)
Write an iterator of triples (in N-Triples)

Parameters:
out -
iterator -

writeQuads

public static void writeQuads(OutputStream out,
                              Iterator<Quad> iterator)
Write an iterator of quads (in N-Quads)

Parameters:
out -
iterator -

createGraphWriter

public static WriterGraphRIOT createGraphWriter(Lang lang)
Create a writer for an RDF language

Parameters:
lang - Language for the seralization.
Returns:
WriterGraphRIOT

createGraphWriter

public static WriterGraphRIOT createGraphWriter(RDFFormat serialization)
Create a writer for an RDF language

Parameters:
serialization - Serialization format
Returns:
WriterGraphRIOT

createDatasetWriter

public static WriterDatasetRIOT createDatasetWriter(Lang lang)
Create a writer for an RDF language

Parameters:
lang - Language for the seralization.
Returns:
WriterGraphRIOT

createDatasetWriter

public static WriterDatasetRIOT createDatasetWriter(RDFFormat serialization)
Create a writer for an RDF language

Parameters:
serialization - Serialization format
Returns:
WriterGraphRIOT


Licenced under the Apache License, Version 2.0