Package com.inrupt.client.spi
Interface RdfService
- All Known Implementing Classes:
JenaService
,RDF4JService
public interface RdfService
A generic abstraction for interacting with different underlying RDF libraries.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
fromDataset
(Dataset dataset, RDFSyntax syntax, OutputStream output) Serialize a dataset to an output stream.void
fromGraph
(Graph graph, RDFSyntax syntax, OutputStream output) Serialize a graph to an output stream.toDataset
(RDFSyntax syntax, InputStream input, String baseUri) Parse an input stream into a Dataset.toGraph
(RDFSyntax syntax, InputStream input, String baseUri) Parse an input stream into a Graph.
-
Method Details
-
fromDataset
Serialize a dataset to an output stream.- Parameters:
dataset
- the datasetsyntax
- the concrete RDF syntaxoutput
- the output stream- Throws:
IOException
- when there is an error serializing the dataset
-
fromGraph
Serialize a graph to an output stream.- Parameters:
graph
- the graphsyntax
- the concrete RDF syntaxoutput
- the output stream- Throws:
IOException
- when there is an error serializing the graph
-
toDataset
Parse an input stream into a Dataset.- Parameters:
syntax
- the concrete RDF syntaxinput
- the input streambaseUri
- the base URI to use in case of relative URIs, may benull
- Returns:
- a dataset
- Throws:
IOException
- when there is an error parsing the dataset
-
toGraph
Parse an input stream into a Graph.- Parameters:
syntax
- the concrete RDF syntaxinput
- the input streambaseUri
- the base URI to use in case of relative URIs, may benull
- Returns:
- a graph
- Throws:
IOException
- when there is an error parsing the graph
-