Module org.apache.jena.core
Class TransitiveEngine
java.lang.Object
org.apache.jena.reasoner.transitiveReasoner.TransitiveEngine
Uses two transitive graph caches to store a subclass and a subproperty
lattice and use them within a larger inference graph.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTransitiveEngine
(TransitiveEngine tengine) Constructor.TransitiveEngine
(TransitiveGraphCache subClassCache, TransitiveGraphCache subPropertyCache) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Add one triple to caches if it is relevant.static boolean
cacheSubClassUtility
(Finder graph, TransitiveGraphCache spCache, TransitiveGraphCache scCache) Caches all subClass declarations, including those that are defined via subProperties of subClassOf.static boolean
cacheSubPropUtility
(Finder graph, TransitiveGraphCache spCache) Caches all subPropertyOf declarations, including any meta level ones (subPropertyOf subPropertyOf).boolean
checkOccurance
(Node prop, Graph graph) Test if there are any usages of prop within the given graph.boolean
Removes the triple t (if relevant) from the caches.getFinder
(TriplePattern pattern, Finder continuation) Return a Finder instance appropriate for the given query.Return the cache of the subclass lattice.Return the cache of the subclass lattice.Prepare the engine by inserting any new data not already included in the existing caches.void
setCaching
(boolean cacheSP, boolean cacheSC) Set the closure caching flags.
-
Field Details
-
directSubPropertyOf
The direct (minimal) version of the subPropertyOf property -
directSubClassOf
The direct (minimal) version of the subClassOf property -
subPropertyOf
The normal subPropertyOf property -
subClassOf
The normal subClassOf property
-
-
Constructor Details
-
TransitiveEngine
Constructor.- Parameters:
subClassCache
- pre-initialized subclass TGCsubPropertyCache
- pre-initialized subproperty TGC
-
TransitiveEngine
Constructor.- Parameters:
tengine
- an instance of TransitiveEngine to be cloned
-
-
Method Details
-
insert
Prepare the engine by inserting any new data not already included in the existing caches.- Parameters:
baseData
- the base dataset on which the initial caches were based, could be nullnewData
- a dataset to be added to the engine, not known to be already included in the caches from construction time- Returns:
- a concatenation of the inserted data and the original data
-
getSubClassCache
Return the cache of the subclass lattice. -
getSubPropertyCache
Return the cache of the subclass lattice. -
setCaching
public void setCaching(boolean cacheSP, boolean cacheSC) Set the closure caching flags.- Parameters:
cacheSP
- true if caching of subPropertyOf closure is wantedcacheSC
- true if caching of subClassOf closure is wanted
-
getFinder
Return a Finder instance appropriate for the given query. -
add
Add one triple to caches if it is relevant.- Returns:
- true if the triple affected the caches
-
delete
Removes the triple t (if relevant) from the caches.- Returns:
- true if the triple affected the caches
-
checkOccurance
Test if there are any usages of prop within the given graph. This includes indirect usages incurred by subProperties of prop.- Parameters:
prop
- the property to be checked forgraph
- the graph to be check- Returns:
- true if there is a triple using prop or one of its sub properties
-
cacheSubClassUtility
public static boolean cacheSubClassUtility(Finder graph, TransitiveGraphCache spCache, TransitiveGraphCache scCache) Caches all subClass declarations, including those that are defined via subProperties of subClassOf. Public to allow other reasoners to use it but not of interest to end users.- Parameters:
graph
- a graph whose declarations are to be cachedspCache
- the existing state of the subPropertyOf cachescCache
- the existing state of the subClassOf cache, will be updated- Returns:
- true if there were new metalevel declarations discovered.
-
cacheSubPropUtility
Caches all subPropertyOf declarations, including any meta level ones (subPropertyOf subPropertyOf). Public to allow other reasoners to use it but not of interest to end users.- Parameters:
graph
- a graph whose declarations are to be cachedspCache
- the existing state of the subPropertyOf cache, will be updated- Returns:
- true if there were new metalevel declarations discovered.
-