Class RDF4JService

java.lang.Object
com.inrupt.client.rdf4j.RDF4JService
All Implemented Interfaces:
RdfService

public class RDF4JService extends Object implements RdfService
An RdfService that uses the RDF4J library.
  • Constructor Details

    • RDF4JService

      public RDF4JService()
  • Method Details

    • fromDataset

      public void fromDataset(Dataset dataset, RDFSyntax syntax, OutputStream output) throws IOException
      Description copied from interface: RdfService
      Serialize a dataset to an output stream.
      Specified by:
      fromDataset in interface RdfService
      Parameters:
      dataset - the dataset
      syntax - the concrete RDF syntax
      output - the output stream
      Throws:
      IOException - when there is an error serializing the dataset
    • fromGraph

      public void fromGraph(Graph graph, RDFSyntax syntax, OutputStream output) throws IOException
      Description copied from interface: RdfService
      Serialize a graph to an output stream.
      Specified by:
      fromGraph in interface RdfService
      Parameters:
      graph - the graph
      syntax - the concrete RDF syntax
      output - the output stream
      Throws:
      IOException - when there is an error serializing the graph
    • toDataset

      public Dataset toDataset(RDFSyntax syntax, InputStream input, String baseUri) throws IOException
      Description copied from interface: RdfService
      Parse an input stream into a Dataset.
      Specified by:
      toDataset in interface RdfService
      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

      public Graph toGraph(RDFSyntax syntax, InputStream input, String baseUri) throws IOException
      Description copied from interface: RdfService
      Parse an input stream into a Graph.
      Specified by:
      toGraph in interface RdfService
      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