org.eclipse.rdf4j.sail.inferencer

## Interface InferencerConnection

- All Superinterfaces:
    AutoCloseable, NotifyingSailConnection, SailConnection
  All Known Implementing Classes:
    AbstractForwardChainingInferencerConnection, DedupingInferencerConnection, ElasticsearchStoreConnection, ExtensibleStoreConnection, InferencerConnectionWrapper, LimitedSizeNativeStoreConnection, MemoryStoreConnection, NativeStoreConnection, SailSourceConnection, SchemaCachingRDFSInferencerConnection

      public interface InferencerConnection
      extends NotifyingSailConnection

  An extension of the `SailConnection` interface offering methods that can be used by inferencers to store and remove inferred statements.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addInferredStatement(Resource subj, IRI pred, Value obj, Resource... contexts)` Adds an inferred statement to a specific context.
    `void` | `clearInferred(Resource... contexts)` Removes all inferred statements from the specified/all contexts.
    `void` | `flushUpdates()` Flushes any pending updates to be processed and the resulting changes to be reported to registered `SailConnectionListener`s.
    `boolean` | `removeInferredStatement(Resource subj, IRI pred, Value obj, Resource... contexts)` Removes an inferred statement from a specific context.

    - ### Methods inherited from interface org.eclipse.rdf4j.sail.NotifyingSailConnection

      `addConnectionListener, removeConnectionListener`

    - ### Methods inherited from interface org.eclipse.rdf4j.sail.SailConnection

      `addStatement, addStatement, addStatement, addStatement, begin, begin, clear, clearNamespaces, close, commit, endUpdate, evaluate, explain, flush, getContextIDs, getNamespace, getNamespaces, getStatements, getStatements, hasStatement, isActive, isOpen, pendingRemovals, prepare, prepareQuery, removeNamespace, removeStatement, removeStatement, removeStatements, removeStatements, rollback, setNamespace, setTransactionSettings, size, startUpdate`

- - ### Method Detail

    - #### addInferredStatement

          boolean addInferredStatement(Resource subj,
                                       IRI pred,
                                       Value obj,
                                       Resource... contexts)
                                throws SailException

      Adds an inferred statement to a specific context.
      Parameters:
        `subj` - The subject of the statement to add.
        `pred` - The predicate of the statement to add.
        `obj` - The object of the statement to add.
        `contexts` - The context(s) to add the statement to. Note that this parameter is a vararg and as such is optional. If no contexts are supplied the method operates on the entire repository.
      Throws:
        `SailException` - If the statement could not be added.
        `IllegalStateException` - If the connection has been closed.

    - #### removeInferredStatement

          boolean removeInferredStatement(Resource subj,
                                          IRI pred,
                                          Value obj,
                                          Resource... contexts)
                                   throws SailException

      Removes an inferred statement from a specific context.
      Parameters:
        `subj` - The subject of the statement that should be removed.
        `pred` - The predicate of the statement that should be removed.
        `obj` - The object of the statement that should be removed.
        `contexts` - The context(s) from which to remove the statements. Note that this parameter is a vararg and as such is optional. If no contexts are supplied the method operates on the entire repository.
      Throws:
        `SailException` - If the statement could not be removed.
        `IllegalStateException` - If the connection has been closed.

    - #### clearInferred

          void clearInferred(Resource... contexts)
                      throws SailException

      Removes all inferred statements from the specified/all contexts. If no contexts are specified the method operates on the entire repository.
      Parameters:
        `contexts` - The context(s) from which to remove the statements. Note that this parameter is a vararg and as such is optional. If no contexts are supplied the method operates on the entire repository.
      Throws:
        `SailException` - If the statements could not be removed.
        `IllegalStateException` - If the connection has been closed.

    - #### flushUpdates

          void flushUpdates()
                     throws SailException

      Flushes any pending updates to be processed and the resulting changes to be reported to registered `SailConnectionListener`s.
      Throws:
        `SailException` - If the updates could not be processed.
        `IllegalStateException` - If the connection has been closed.

Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.