public class SchemaCachingRDFSInferencer extends NotifyingSailWrapper
The SchemaCachingRDFSInferencer is an RDFS reasoner that caches all schema (TBox) statements and calculates an inference map to quickly determine inferred statements. The reasoner can also be instantiated with a predefined schema for improved performance.
This reasoner is not a rule based reasoner and will be up to 80x faster than the
ForwardChainingRDFSInferencer
, as well as being more complete.
The sail puts no limitations on isolation level for read transactions, however all write/delete/update transactions are serializable with exclusive locks. This limits write/delete/update transactions to one transaction at a time.
Modifier and Type | Field and Description |
---|---|
protected boolean |
useInferredToCreateSchema |
Constructor and Description |
---|
SchemaCachingRDFSInferencer()
Instantiate a new SchemaCachingRDFSInferencer
|
SchemaCachingRDFSInferencer(NotifyingSail data)
Instantiate a SchemaCachingRDFSInferencer.
|
SchemaCachingRDFSInferencer(NotifyingSail data,
boolean useAllRdfsRules)
Instantiate a SchemaCachingRDFSInferencer.
|
SchemaCachingRDFSInferencer(NotifyingSail data,
Repository schema)
Instantiate a SchemaCachingRDFSInferencer with a predefined schema.
|
SchemaCachingRDFSInferencer(NotifyingSail data,
Repository schema,
boolean useAllRdfsRules)
Instantiate a SchemaCachingRDFSInferencer with a predefined schema.
|
Modifier and Type | Method and Description |
---|---|
static SchemaCachingRDFSInferencer |
fastInstantiateFrom(SchemaCachingRDFSInferencer sailToInstantiateFrom,
NotifyingSail store)
Instantiate a new SchemaCachingRDFSInferencer from an existing one.
|
static SchemaCachingRDFSInferencer |
fastInstantiateFrom(SchemaCachingRDFSInferencer sailToInstantiateFrom,
NotifyingSail store,
boolean useAllRdfsRules)
Instantiate a new SchemaCachingRDFSInferencer from an existing one.
|
SchemaCachingRDFSInferencerConnection |
getConnection()
Opens a connection on the Sail which can be used to query and update data.
|
IsolationLevel |
getDefaultIsolationLevel()
Retrieves the default
IsolationLevel level on which transactions in this Sail operate. |
List<IsolationLevel> |
getSupportedIsolationLevels()
Retrieve the
IsolationLevel s supported by this SAIL, ordered by increasing complexity. |
ValueFactory |
getValueFactory()
Gets a ValueFactory object that can be used to create IRI-, blank node-, literal- and statement objects.
|
void |
initialize()
Initializes the Sail.
|
boolean |
isAddInferredStatementsToDefaultContext()
Inferred statements can either be added to the default context or to the context that the original inserted
statement has.
|
void |
setAddInferredStatementsToDefaultContext(boolean addInferredStatementsToDefaultContext)
Inferred statements can either be added to the default context or to the context that the original inserted
statement has.
|
addSailChangedListener, getBaseSail, removeSailChangedListener, setBaseSail
getDataDir, isWritable, setDataDir, setFederatedServiceResolver, shutDown, verifyBaseSailSet
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDataDir, init, isWritable, setDataDir, shutDown
public SchemaCachingRDFSInferencer()
public SchemaCachingRDFSInferencer(NotifyingSail data)
data
- Base sail for storing data.public SchemaCachingRDFSInferencer(NotifyingSail data, Repository schema)
data
- Base sail for storing data.schema
- Repository containing the schema.public SchemaCachingRDFSInferencer(NotifyingSail data, boolean useAllRdfsRules)
data
- Base sail for storing data.useAllRdfsRules
- Usel all RDFS rules. If set to false rule rdf4a and rdfs4b will be ignorepublic SchemaCachingRDFSInferencer(NotifyingSail data, Repository schema, boolean useAllRdfsRules)
data
- Base sail for storing data.schema
- Repository containing the schema.useAllRdfsRules
- Usel all RDFS rules. If set to false rule rdf4a and rdfs4b will be ignorepublic void initialize() throws SailException
Sail
initialize
in interface Sail
initialize
in class SailWrapper
SailException
- If the Sail could not be initialized.public SchemaCachingRDFSInferencerConnection getConnection() throws SailException
Sail
getConnection
in interface NotifyingSail
getConnection
in interface Sail
getConnection
in class NotifyingSailWrapper
SailException
- If no transaction could be started, for example because the Sail is not writable.public ValueFactory getValueFactory()
Sail
getValueFactory
in interface Sail
getValueFactory
in class SailWrapper
public static SchemaCachingRDFSInferencer fastInstantiateFrom(SchemaCachingRDFSInferencer sailToInstantiateFrom, NotifyingSail store)
sailToInstantiateFrom
- The SchemaCachingRDFSInferencer to extract the lookup tables from.store
- Base sail for storing data.public static SchemaCachingRDFSInferencer fastInstantiateFrom(SchemaCachingRDFSInferencer sailToInstantiateFrom, NotifyingSail store, boolean useAllRdfsRules)
sailToInstantiateFrom
- The SchemaCachingRDFSInferencer to extract the lookup tables from.store
- Base sail for storing data.useAllRdfsRules
- Use all RDFS rules. If set to false rule rdf4a and rdfs4b will be ignorepublic IsolationLevel getDefaultIsolationLevel()
Sail
IsolationLevel
level on which transactions in this Sail operate.getDefaultIsolationLevel
in interface Sail
getDefaultIsolationLevel
in class SailWrapper
IsolationLevel
that will be used with SailConnection.begin()
, for SAIL connections
returned by Sail.getConnection()
.public List<IsolationLevel> getSupportedIsolationLevels()
Sail
IsolationLevel
s supported by this SAIL, ordered by increasing complexity.getSupportedIsolationLevels
in interface Sail
getSupportedIsolationLevels
in class SailWrapper
IsolationLevel
.public boolean isAddInferredStatementsToDefaultContext()
Inferred statements can either be added to the default context or to the context that the original inserted statement has.
public void setAddInferredStatementsToDefaultContext(boolean addInferredStatementsToDefaultContext)
Inferred statements can either be added to the default context or to the context that the original inserted statement has. setAddInferredStatementsToDefaultContext(true) will add all inferred statements to the default context.
Which context a tbox statement is added to is undefined.
Before 3.0 default value for addInferredStatementsToDefaultContext was true. From 3.0 the default value is false.
addInferredStatementsToDefaultContext
- Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.