Class RDFLinkAdapter

java.lang.Object
org.apache.jena.rdflink.RDFLinkAdapter
All Implemented Interfaces:
AutoCloseable, LinkDatasetGraph, LinkDatasetGraphAccess, LinkSparqlQuery, LinkSparqlUpdate, RDFLink, org.apache.jena.sparql.core.Transactional

public class RDFLinkAdapter extends Object implements RDFLink
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional

    org.apache.jena.sparql.core.Transactional.Promote
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    static RDFLink
     
    void
    begin(org.apache.jena.query.ReadWrite readWrite)
     
    void
    begin(org.apache.jena.query.TxnType type)
     
    void
    Clear the dataset - remove all named graphs, clear the default graph.
    void
    Close this connection.
    void
     
    void
    Remove all data from the default graph.
    void
    delete(org.apache.jena.graph.Node graphName)
    Delete a graph from the dataset.
    void
    end()
     
    org.apache.jena.graph.Graph
    get()
    Fetch the default graph.
    org.apache.jena.graph.Graph
    get(org.apache.jena.graph.Node graphName)
    Fetch a named graph.
    org.apache.jena.sparql.core.DatasetGraph
    Fetch the contents of the dataset
    boolean
    Test whether this connection is closed or not
    boolean
     
    void
    load(String file)
    Send file - this merges the file RDF into the default graph of a dataset.
    void
    load(org.apache.jena.graph.Graph graph)
    Load (add, append) RDF into the default graph of a dataset.
    void
    load(org.apache.jena.graph.Node graphName, String file)
    Load (add, append) RDF into a named graph in a dataset.
    void
    load(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph graph)
    Load (add, append) RDF into a named graph in a dataset.
    void
     
    void
    loadDataset(org.apache.jena.sparql.core.DatasetGraph dataset)
     
    org.apache.jena.sparql.exec.QueryExecBuilder
    Return a QueryExecBuilder that is initially configured for this link setup and type.
    org.apache.jena.sparql.exec.UpdateExecBuilder
    Return a UpdateExecBuilder that is initially configured for this link setup and type.
    boolean
    promote(org.apache.jena.sparql.core.Transactional.Promote mode)
     
    void
    put(String file)
    Set the contents of the default graph of a dataset.
    void
    put(org.apache.jena.graph.Graph graph)
    Set the contents of the default graph of a dataset.
    void
    put(org.apache.jena.graph.Node graphName, String file)
    Set the contents of a named graph of a dataset.
    void
    put(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph graph)
    Set the contents of a named graph of a dataset.
    void
     
    void
    putDataset(org.apache.jena.sparql.core.DatasetGraph dataset)
     
    org.apache.jena.sparql.exec.QueryExec
    query(String queryString)
    Setup a SPARQL query execution.
    org.apache.jena.sparql.exec.QueryExec
    query(org.apache.jena.query.Query query)
    Setup a SPARQL query execution.
    org.apache.jena.query.ReadWrite
     
    org.apache.jena.query.TxnType
     
    void
    update(String update)
    Execute a SPARQL Update.
    void
    update(org.apache.jena.update.UpdateRequest update)
    Execute a SPARQL Update.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.jena.sparql.core.Transactional

    begin, calc, calculate, calculateRead, calculateWrite, exec, execute, executeRead, executeWrite, promote
  • Constructor Details

  • Method Details

    • adapt

      public static RDFLink adapt(RDFConnection conn)
    • begin

      public void begin(org.apache.jena.query.TxnType type)
      Specified by:
      begin in interface org.apache.jena.sparql.core.Transactional
    • begin

      public void begin(org.apache.jena.query.ReadWrite readWrite)
      Specified by:
      begin in interface org.apache.jena.sparql.core.Transactional
    • promote

      public boolean promote(org.apache.jena.sparql.core.Transactional.Promote mode)
      Specified by:
      promote in interface org.apache.jena.sparql.core.Transactional
    • commit

      public void commit()
      Specified by:
      commit in interface org.apache.jena.sparql.core.Transactional
    • abort

      public void abort()
      Specified by:
      abort in interface org.apache.jena.sparql.core.Transactional
    • end

      public void end()
      Specified by:
      end in interface org.apache.jena.sparql.core.Transactional
    • transactionMode

      public org.apache.jena.query.ReadWrite transactionMode()
      Specified by:
      transactionMode in interface org.apache.jena.sparql.core.Transactional
    • transactionType

      public org.apache.jena.query.TxnType transactionType()
      Specified by:
      transactionType in interface org.apache.jena.sparql.core.Transactional
    • isInTransaction

      public boolean isInTransaction()
      Specified by:
      isInTransaction in interface org.apache.jena.sparql.core.Transactional
    • getDataset

      public org.apache.jena.sparql.core.DatasetGraph getDataset()
      Description copied from interface: LinkDatasetGraphAccess
      Fetch the contents of the dataset
      Specified by:
      getDataset in interface LinkDatasetGraphAccess
    • query

      public org.apache.jena.sparql.exec.QueryExec query(org.apache.jena.query.Query query)
      Description copied from interface: RDFLink
      Setup a SPARQL query execution. See also RDFLink.querySelect(Query, Consumer), RDFLink.queryConstruct(Query), RDFLink.queryDescribe(Query), RDFLink.queryAsk(Query) for ways to execute queries for of a specific form.
      Specified by:
      query in interface LinkSparqlQuery
      Specified by:
      query in interface RDFLink
      Returns:
      QueryExecution
    • query

      public org.apache.jena.sparql.exec.QueryExec query(String queryString)
      Description copied from interface: RDFLink
      Setup a SPARQL query execution.

      This is a low-level operation. Handling the QueryExecution should be done with try-resource. Some QueryExecutions, such as ones connecting to a remote server, need to be properly closed to release system resources.

      See also RDFLink.querySelect(String, Consumer), RDFLink.queryConstruct(String), RDFLink.queryDescribe(String), RDFLink.queryAsk(String) for ways to execute queries of a specific form.

      Specified by:
      query in interface LinkSparqlQuery
      Specified by:
      query in interface RDFLink
      Returns:
      QueryExecution
    • newQuery

      public org.apache.jena.sparql.exec.QueryExecBuilder newQuery()
      Description copied from interface: RDFLink
      Return a QueryExecBuilder that is initially configured for this link setup and type. The query built will be set to go to the same dataset/remote endpoint as the other RDFLink operations.
      Specified by:
      newQuery in interface LinkSparqlQuery
      Specified by:
      newQuery in interface RDFLink
      Returns:
      QueryExecBuilder
    • newUpdate

      public org.apache.jena.sparql.exec.UpdateExecBuilder newUpdate()
      Description copied from interface: RDFLink
      Return a UpdateExecBuilder that is initially configured for this link setup and type. The update built will be set to go to the same dataset/remote endpoint as the other RDFLink operations.
      Specified by:
      newUpdate in interface LinkSparqlUpdate
      Specified by:
      newUpdate in interface RDFLink
      Returns:
      UpdateExecBuilder
    • update

      public void update(org.apache.jena.update.UpdateRequest update)
      Description copied from interface: RDFLink
      Execute a SPARQL Update.
      Specified by:
      update in interface LinkSparqlUpdate
      Specified by:
      update in interface RDFLink
    • update

      public void update(String update)
      Description copied from interface: RDFLink
      Execute a SPARQL Update.
      Specified by:
      update in interface LinkSparqlUpdate
      Specified by:
      update in interface RDFLink
    • get

      public org.apache.jena.graph.Graph get()
      Description copied from interface: RDFLink
      Fetch the default graph. This is SPARQL Graph Store Protocol HTTP GET or equivalent.
      Specified by:
      get in interface LinkDatasetGraphAccess
      Specified by:
      get in interface RDFLink
      Returns:
      Graph
    • get

      public org.apache.jena.graph.Graph get(org.apache.jena.graph.Node graphName)
      Description copied from interface: RDFLink
      Fetch a named graph. This is SPARQL Graph Store Protocol HTTP GET or equivalent.
      Specified by:
      get in interface LinkDatasetGraphAccess
      Specified by:
      get in interface RDFLink
      Parameters:
      graphName - URI string for the graph name (null or Quad.defaultGraphIRI for the default graph)
      Returns:
      Graph
    • load

      public void load(String file)
      Description copied from interface: RDFLink
      Send file - this merges the file RDF into the default graph of a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.

      If this is a remote connection:

      • The file is sent as-is and not parsed in the RDFLink
      • The Content-Type is determined by the filename
      Specified by:
      load in interface LinkDatasetGraph
      Specified by:
      load in interface RDFLink
      Parameters:
      file - File of the data.
    • load

      public void load(org.apache.jena.graph.Node graphName, String file)
      Description copied from interface: RDFLink
      Load (add, append) RDF into a named graph in a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.

      If this is a remote connection:

      • The file is sent as-is and not parsed in the RDFLink
      • The Content-Type is determined by the filename
      Specified by:
      load in interface LinkDatasetGraph
      Specified by:
      load in interface RDFLink
      Parameters:
      graphName - Graph name (null or Quad.defaultGraphIRI for the default graph)
      file - File of the data.
    • load

      public void load(org.apache.jena.graph.Graph graph)
      Description copied from interface: RDFLink
      Load (add, append) RDF into the default graph of a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.
      Specified by:
      load in interface LinkDatasetGraph
      Specified by:
      load in interface RDFLink
      Parameters:
      graph - Data.
    • load

      public void load(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph graph)
      Description copied from interface: RDFLink
      Load (add, append) RDF into a named graph in a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.
      Specified by:
      load in interface LinkDatasetGraph
      Specified by:
      load in interface RDFLink
      Parameters:
      graphName - Graph name (null or Quad.defaultGraphIRI for the default graph)
      graph - Data.
    • put

      public void put(String file)
      Description copied from interface: RDFLink
      Set the contents of the default graph of a dataset. Any existing data is lost. This is SPARQL Graph Store Protocol HTTP PUT or equivalent.

      If this is a remote connection:

      • The file is sent as-is and not parsed in the RDFLink
      • The Content-Type is determined by the filename
      Specified by:
      put in interface LinkDatasetGraph
      Specified by:
      put in interface RDFLink
      Parameters:
      file - File of the data.
    • put

      public void put(org.apache.jena.graph.Node graphName, String file)
      Description copied from interface: RDFLink
      Set the contents of a named graph of a dataset. Any existing data is lost. This is SPARQL Graph Store Protocol HTTP PUT or equivalent.
      Specified by:
      put in interface LinkDatasetGraph
      Specified by:
      put in interface RDFLink
      Parameters:
      graphName - Graph name (null or Quad.defaultGraphIRI for the default graph)
      file - File of the data.
    • put

      public void put(org.apache.jena.graph.Graph graph)
      Description copied from interface: RDFLink
      Set the contents of the default graph of a dataset. Any existing data is lost. This is SPARQL Graph Store Protocol HTTP PUT or equivalent.

      If this is a remote connection:

      • The file is sent as-is and not parsed in the RDFLink
      • The Content-Type is determined by the filename
      Specified by:
      put in interface LinkDatasetGraph
      Specified by:
      put in interface RDFLink
      Parameters:
      graph - Data.
    • put

      public void put(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph graph)
      Description copied from interface: RDFLink
      Set the contents of a named graph of a dataset. Any existing data is lost. This is SPARQL Graph Store Protocol HTTP PUT or equivalent.
      Specified by:
      put in interface LinkDatasetGraph
      Specified by:
      put in interface RDFLink
      Parameters:
      graphName - Graph name (null or Quad.defaultGraphIRI for the default graph)
      graph - Data.
    • delete

      public void delete(org.apache.jena.graph.Node graphName)
      Description copied from interface: RDFLink
      Delete a graph from the dataset. Null or Quad.defaultGraphIRI means the default graph, which is cleared, not removed.
      Specified by:
      delete in interface LinkDatasetGraph
      Specified by:
      delete in interface RDFLink
    • delete

      public void delete()
      Description copied from interface: RDFLink
      Remove all data from the default graph.
      Specified by:
      delete in interface LinkDatasetGraph
      Specified by:
      delete in interface RDFLink
    • loadDataset

      public void loadDataset(String file)
      Specified by:
      loadDataset in interface LinkDatasetGraph
      Specified by:
      loadDataset in interface RDFLink
    • loadDataset

      public void loadDataset(org.apache.jena.sparql.core.DatasetGraph dataset)
      Specified by:
      loadDataset in interface LinkDatasetGraph
      Specified by:
      loadDataset in interface RDFLink
    • putDataset

      public void putDataset(String file)
      Specified by:
      putDataset in interface LinkDatasetGraph
      Specified by:
      putDataset in interface RDFLink
    • putDataset

      public void putDataset(org.apache.jena.sparql.core.DatasetGraph dataset)
      Specified by:
      putDataset in interface LinkDatasetGraph
      Specified by:
      putDataset in interface RDFLink
    • clearDataset

      public void clearDataset()
      Description copied from interface: RDFLink
      Clear the dataset - remove all named graphs, clear the default graph.
      Specified by:
      clearDataset in interface LinkDatasetGraph
      Specified by:
      clearDataset in interface RDFLink
    • isClosed

      public boolean isClosed()
      Description copied from interface: RDFLink
      Test whether this connection is closed or not
      Specified by:
      isClosed in interface LinkDatasetGraph
      Specified by:
      isClosed in interface LinkDatasetGraphAccess
      Specified by:
      isClosed in interface RDFLink
    • close

      public void close()
      Description copied from interface: RDFLink
      Close this connection. Use with try-resource.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface LinkDatasetGraph
      Specified by:
      close in interface LinkDatasetGraphAccess
      Specified by:
      close in interface LinkSparqlQuery
      Specified by:
      close in interface LinkSparqlUpdate
      Specified by:
      close in interface RDFLink