Interface RdfService

All Known Implementing Classes:
JenaService, RDF4JService

public interface RdfService
A generic abstraction for interacting with different underlying RDF libraries.
  • Method Details

    • fromDataset

      void fromDataset(Dataset dataset, RDFSyntax syntax, OutputStream output) throws IOException
      Serialize a dataset to an output stream.
      Parameters:
      dataset - the dataset
      syntax - the concrete RDF syntax
      output - the output stream
      Throws:
      IOException - when there is an error serializing the dataset
    • fromGraph

      void fromGraph(Graph graph, RDFSyntax syntax, OutputStream output) throws IOException
      Serialize a graph to an output stream.
      Parameters:
      graph - the graph
      syntax - the concrete RDF syntax
      output - the output stream
      Throws:
      IOException - when there is an error serializing the graph
    • toDataset

      Dataset toDataset(RDFSyntax syntax, InputStream input, String baseUri) throws IOException
      Parse an input stream into a Dataset.
      Parameters:
      syntax - the concrete RDF syntax
      input - the input stream
      baseUri - the base URI to use in case of relative URIs, may be null
      Returns:
      a dataset
      Throws:
      IOException - when there is an error parsing the dataset
    • toGraph

      Graph toGraph(RDFSyntax syntax, InputStream input, String baseUri) throws IOException
      Parse an input stream into a Graph.
      Parameters:
      syntax - the concrete RDF syntax
      input - the input stream
      baseUri - the base URI to use in case of relative URIs, may be null
      Returns:
      a graph
      Throws:
      IOException - when there is an error parsing the graph