Class Rdf4jAdapter

java.lang.Object
cz.cvut.kbss.ontodriver.rdf4j.Rdf4jAdapter
All Implemented Interfaces:
Closeable, StatementExecutor, Wrapper

public class Rdf4jAdapter extends Object implements StatementExecutor, Closeable, Wrapper
  • Constructor Details

  • Method Details

    • close

      public void close() throws OntoDriverException
      Description copied from interface: Closeable
      Closes this resource releasing any sub-resources it holds.

      After closing the resource is not usable any more and calling methods on it (except close and isOpen) will result in IllegalStateException.

      Calling close on already closed resource does nothing.

      Specified by:
      close in interface Closeable
      Throws:
      OntoDriverException - If an ontology access error occurs.
    • isOpen

      public boolean isOpen()
      Description copied from interface: Closeable
      Retrieves status of this resource.
      Specified by:
      isOpen in interface Closeable
      Returns:
      true if the resource is open, false otherwise
    • getRepositoryMetadata

      public RepositoryMetadata getRepositoryMetadata()
    • unwrap

      public <T> T unwrap(Class<T> cls) throws OntoDriverException
      Description copied from interface: Wrapper
      Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. If the receiver implements the interface then the result is the receiver or a proxy for the receiver. If the receiver is a wrapper and the wrapped object implements the interface then the result is the wrapped object or a proxy for the wrapped object. Otherwise return the the result of calling unwrap recursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then an OntoDriverException is thrown.
      Specified by:
      unwrap in interface Wrapper
      Type Parameters:
      T - The type of the class modeled by this Class object
      Parameters:
      cls - The type of the required result
      Returns:
      An object implementing the interface
      Throws:
      OntoDriverException - If no matching object is found
    • executeSelectQuery

      public org.eclipse.rdf4j.query.TupleQueryResult executeSelectQuery(QuerySpecification query) throws Rdf4jDriverException
      Description copied from interface: StatementExecutor
      Executes the specified query and returns result in form of a RDF4J query result.
      Specified by:
      executeSelectQuery in interface StatementExecutor
      Parameters:
      query - The query to execute
      Returns:
      Tuple query result
      Throws:
      Rdf4jDriverException - When things go wrong with query execution
    • executeBooleanQuery

      public boolean executeBooleanQuery(QuerySpecification query) throws Rdf4jDriverException
      Description copied from interface: StatementExecutor
      Executes the specified boolean query.

      This method is intended mostly for SPARQL ASK queries.

      Specified by:
      executeBooleanQuery in interface StatementExecutor
      Parameters:
      query - The query to execute
      Returns:
      Boolean result of the query
      Throws:
      Rdf4jDriverException - When things go wrong with query execution
    • executeUpdate

      public void executeUpdate(QuerySpecification query) throws Rdf4jDriverException
      Description copied from interface: StatementExecutor
      Executes the specified update query.
      Specified by:
      executeUpdate in interface StatementExecutor
      Parameters:
      query - The query to execute
      Throws:
      Rdf4jDriverException - When things go wrong with query execution