Class TrivialInferencer

java.lang.Object
org.eclipse.rdf4j.sail.helpers.SailWrapper
org.eclipse.rdf4j.sail.helpers.NotifyingSailWrapper
it.uniroma2.art.semanticturkey.trivialinference.sail.TrivialInferencer
All Implemented Interfaces:
org.eclipse.rdf4j.query.algebra.evaluation.federation.FederatedServiceResolverClient, org.eclipse.rdf4j.sail.NotifyingSail, org.eclipse.rdf4j.sail.Sail, org.eclipse.rdf4j.sail.StackableSail

public class TrivialInferencer extends org.eclipse.rdf4j.sail.helpers.NotifyingSailWrapper
A Sail implementation that manages trivial inferences (i.e. symmetric and inverse properties).

Upon the addition of a triple s p o:

  • if p is an owl:SymmetricProperty, then this sail also adds the triple o p s (swapping the subject and object of the original triple)
  • if p has inverse p' or p' has inverse p, then this sails also adds the triple o p' s (swapping the subject and object of the original triple, and using the inverse property as predicate)

Upon the deletion of a triple s p o, this sail also deletes the triple that would have been materialized according to the rules above.

Materialization of trivial inferences is done upon each triple addition/removal.

This sail caches schema-level definitions, such as the inverse of a property and the fact that it is symmetric.

Within a transaction, this sail performs its reasoning activities using a snapshot of the cache describing its state before the transaction happens. Consequently, every schema-level change within a transaction will not affect materialization during that transaction. This limitation shouldn't be a problem in most cases, in which the TBox and ABox are modified in different transactions. This limitation frees the sail from the need to store a temporary copy of all triple edits within a transaction, just in case some of these edits use a predicate whose definition is changed within the same transaction.

Author:
Manuel Fiorelli
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    protected org.eclipse.rdf4j.repository.Repository
     
    void
     
    protected void
     
    protected void
     
    void
     

    Methods inherited from class org.eclipse.rdf4j.sail.helpers.NotifyingSailWrapper

    addSailChangedListener, getBaseSail, removeSailChangedListener, setBaseSail

    Methods inherited from class org.eclipse.rdf4j.sail.helpers.SailWrapper

    getCollectionFactory, getDataDir, getDefaultIsolationLevel, getFederatedServiceResolver, getSupportedIsolationLevels, getValueFactory, isWritable, setDataDir, setFederatedServiceResolver, verifyBaseSailSet

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.eclipse.rdf4j.sail.Sail

    getCollectionFactory, getDataDir, getDefaultIsolationLevel, getSupportedIsolationLevels, getValueFactory, isWritable, setDataDir
  • Constructor Details

  • Method Details

    • init

      public void init() throws org.eclipse.rdf4j.sail.SailException
      Specified by:
      init in interface org.eclipse.rdf4j.sail.Sail
      Overrides:
      init in class org.eclipse.rdf4j.sail.helpers.SailWrapper
      Throws:
      org.eclipse.rdf4j.sail.SailException
    • shutDown

      public void shutDown() throws org.eclipse.rdf4j.sail.SailException
      Specified by:
      shutDown in interface org.eclipse.rdf4j.sail.Sail
      Overrides:
      shutDown in class org.eclipse.rdf4j.sail.helpers.SailWrapper
      Throws:
      org.eclipse.rdf4j.sail.SailException
    • getConnection

      public TrivialInferencerConnection getConnection() throws org.eclipse.rdf4j.sail.SailException
      Specified by:
      getConnection in interface org.eclipse.rdf4j.sail.NotifyingSail
      Specified by:
      getConnection in interface org.eclipse.rdf4j.sail.Sail
      Overrides:
      getConnection in class org.eclipse.rdf4j.sail.helpers.NotifyingSailWrapper
      Throws:
      org.eclipse.rdf4j.sail.SailException
    • getSchemaCache

      protected org.eclipse.rdf4j.repository.Repository getSchemaCache()
    • rebuildCache

      protected void rebuildCache()
    • invalidateCache

      protected void invalidateCache()