Class CustomGraphQueryInferencer
- java.lang.Object
-
- org.eclipse.rdf4j.sail.helpers.SailWrapper
-
- org.eclipse.rdf4j.sail.helpers.NotifyingSailWrapper
-
- org.eclipse.rdf4j.sail.inferencer.fc.CustomGraphQueryInferencer
-
- All Implemented Interfaces:
FederatedServiceResolverClient,NotifyingSail,Sail,StackableSail
public class CustomGraphQueryInferencer extends org.eclipse.rdf4j.sail.helpers.NotifyingSailWrapperA forward-chaining inferencer that infers new statements using a SPARQL graph query.- Author:
- Dale Visser
-
-
Constructor Summary
Constructors Constructor Description CustomGraphQueryInferencer()CustomGraphQueryInferencer(QueryLanguage language, String queryText, String matcherText)Create a new custom inferencer.CustomGraphQueryInferencer(NotifyingSail baseSail, QueryLanguage language, String queryText, String matcherText)Create a new custom inferencer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InferencerConnectiongetConnection()Collection<org.eclipse.rdf4j.model.Value>getWatchObjects()Exposed for test purposes.Collection<org.eclipse.rdf4j.model.Value>getWatchPredicates()Exposed for test purposes.Collection<org.eclipse.rdf4j.model.Value>getWatchSubjects()Exposed for test purposes.voidinit()voidsetFields(QueryLanguage language, String queryText, String matcherText)Called in order to set all the fields needed for the inferencer to function.-
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, shutDown, 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, shutDown
-
-
-
-
Constructor Detail
-
CustomGraphQueryInferencer
public CustomGraphQueryInferencer()
-
CustomGraphQueryInferencer
public CustomGraphQueryInferencer(QueryLanguage language, String queryText, String matcherText) throws MalformedQueryException, UnsupportedQueryLanguageException, SailException
Create a new custom inferencer.- Parameters:
language- language that queryText and matcherText are expressed inqueryText- a query that returns an RDF graph of inferred statements to be added to the underlying SailmatcherText- a query that returns an RDF graph of existing inferred statements already added previously- Throws:
MalformedQueryException- if there is a problem parsing either of the given queriesUnsupportedQueryLanguageException- if an unsupported query language is specifiedSailException- if a problem occurs interpreting the rule pattern
-
CustomGraphQueryInferencer
public CustomGraphQueryInferencer(NotifyingSail baseSail, QueryLanguage language, String queryText, String matcherText) throws MalformedQueryException, UnsupportedQueryLanguageException, SailException
Create a new custom inferencer.- Parameters:
baseSail- an underlying Sail, such as another inferencer or a SailRepositorylanguage- language that queryText and matcherText are expressed inqueryText- a query that returns an RDF graph of inferred statements to be added to the underlying SailmatcherText- a query that returns an RDF graph of existing inferred statements already added previously- Throws:
MalformedQueryException- if there is a problem parsing either of the given queriesUnsupportedQueryLanguageExceptionSailException- if a problem occurs interpreting the rule pattern
-
-
Method Detail
-
setFields
public final void setFields(QueryLanguage language, String queryText, String matcherText) throws MalformedQueryException, SailException
Called in order to set all the fields needed for the inferencer to function.- Parameters:
language- language that queryText and matcherText are expressed inqueryText- a query that returns an RDF graph of inferred statements to be added to the underlying SailmatcherText- a query that returns an RDF graph of existing inferred statements already added previously- Throws:
MalformedQueryException- if there is a problem parsing either of the given queriesSailException- if a problem occurs interpreting the rule pattern
-
getConnection
public InferencerConnection getConnection() throws SailException
- Specified by:
getConnectionin interfaceNotifyingSail- Specified by:
getConnectionin interfaceSail- Overrides:
getConnectionin classorg.eclipse.rdf4j.sail.helpers.NotifyingSailWrapper- Throws:
SailException
-
init
public void init() throws SailException- Specified by:
initin interfaceSail- Overrides:
initin classorg.eclipse.rdf4j.sail.helpers.SailWrapper- Throws:
SailException
-
getWatchSubjects
public Collection<org.eclipse.rdf4j.model.Value> getWatchSubjects()
Exposed for test purposes.- Returns:
- a computed collection of the statement subjects that, when added or removed, trigger an update of inferred statements
-
getWatchPredicates
public Collection<org.eclipse.rdf4j.model.Value> getWatchPredicates()
Exposed for test purposes.- Returns:
- a computed collection of the statement predicates that, when added or removed, trigger an update of inferred statements
-
getWatchObjects
public Collection<org.eclipse.rdf4j.model.Value> getWatchObjects()
Exposed for test purposes.- Returns:
- a computed collection of the statement objects that, when added or removed, trigger an update of inferred statements
-
-