Interface StorageConnector

All Superinterfaces:
Closeable, StatementExecutor, Wrapper
All Known Implementing Classes:
ChangeTrackingStorageConnector, SharedStorageConnector, SnapshotStorageConnector

public interface StorageConnector extends Closeable, Wrapper, StatementExecutor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(List<org.apache.jena.rdf.model.Statement> statements, String context)
    Adds the specified statements to the specified context in the storage.
    void
    Begins a transaction.
    void
    Closes this resource releasing any sub-resources it holds.
    void
    Commits the current transaction.
    boolean
    contains(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode value, Collection<String> contexts)
    Checks whether the specified context (named graph) contains any statements matching the specified criteria.
    Collection<org.apache.jena.rdf.model.Statement>
    find(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode value, Collection<String> contexts)
    Retrieves statements corresponding to the specified criteria from the specified named graph.
    Lists all contexts (named graph) in the repository (including the transactional ones).
    void
    remove(List<org.apache.jena.rdf.model.Statement> statements, String context)
    Removes the specified statements from the specified context in the storage.
    void
    remove(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode object, String context)
    Removes statements matching the specified pattern from the specified storage context.
    void
    Removes all property values specified by the provided argument for the specified subject(s).
    void
    Rolls back the current transaction.

    Methods inherited from interface cz.cvut.kbss.ontodriver.Closeable

    isOpen

    Methods inherited from interface cz.cvut.kbss.ontodriver.jena.connector.StatementExecutor

    executeAskQuery, executeSelectQuery, executeUpdate

    Methods inherited from interface cz.cvut.kbss.ontodriver.Wrapper

    unwrap
  • Method Details

    • begin

      void begin()
      Begins a transaction.
    • commit

      void commit() throws JenaDriverException
      Commits the current transaction.
      Throws:
      JenaDriverException - If commit fails
    • rollback

      void rollback()
      Rolls back the current transaction.
    • find

      Collection<org.apache.jena.rdf.model.Statement> find(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode value, Collection<String> contexts)
      Retrieves statements corresponding to the specified criteria from the specified named graph.

      The first three parameters are optional, their absence signifies that any value in that position is acceptable.

      contexts are also optional, their absence means that the default graph should be used.

      Parameters:
      subject - Statement subject, optional
      property - Property, optional
      value - Value, optional
      contexts - Named graph IRIs, optional. If empty, the default graph will be used
      Returns:
      Collection of matching statements
    • contains

      boolean contains(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode value, Collection<String> contexts)
      Checks whether the specified context (named graph) contains any statements matching the specified criteria.

      The first three parameters are optional, their absence signifies that any value in that position is acceptable.

      context is also optional, its absence means that the default graph should be used.

      Parameters:
      subject - Subject, optional
      property - Property, optional
      value - Value, optional
      contexts - Named graph IRIs, optional. If empty, the default graph will be used
      Returns:
      true if at least one statement matches the criteria, false otherwise
    • getContexts

      List<String> getContexts()
      Lists all contexts (named graph) in the repository (including the transactional ones).
      Returns:
      List of named graph URIs
    • add

      void add(List<org.apache.jena.rdf.model.Statement> statements, String context)
      Adds the specified statements to the specified context in the storage.

      Requires an active transaction.

      context is optional, its absence means that the statements will be added into the the default graph.

      Parameters:
      statements - Statements to add
      context - Target context, optional
    • remove

      void remove(List<org.apache.jena.rdf.model.Statement> statements, String context)
      Removes the specified statements from the specified context in the storage.

      Requires an active transaction.

      context is optional, its absence means that the statements will be removed from the the default graph.

      Parameters:
      statements - Statements to remove
      context - Target context, optional
    • remove

      void remove(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode object, String context)
      Removes statements matching the specified pattern from the specified storage context.

      context is optional, its absence means that the statements will be removed from the the default graph.

      Parameters:
      subject - Statement subject, optional
      property - Statement property, optional
      object - Statement object, optional
      context - Repository context IRI, optional
    • removePropertyValues

      void removePropertyValues(Collection<SubjectPredicateContext> spc)
      Removes all property values specified by the provided argument for the specified subject(s).
      Parameters:
      spc - Subject-predicate-contexts tuples
    • close

      void close() throws JenaDriverException
      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:
      JenaDriverException