public class SPINInferences extends Object
| Constructor and Description |
|---|
SPINInferences() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addOptimizer(SPINInferencesOptimizer optimizer) |
static boolean |
isRuleProperty(org.apache.jena.rdf.model.Property property)
Checks if a given property is a SPIN rule property.
|
static void |
removeOptimizer(SPINInferencesOptimizer optimizer) |
static int |
run(org.apache.jena.rdf.model.Model queryModel,
org.apache.jena.rdf.model.Model newTriples,
Map<org.apache.jena.rdf.model.Resource,List<CommandWrapper>> class2Query,
Map<org.apache.jena.rdf.model.Resource,List<CommandWrapper>> class2Constructor,
SPINExplanations explanations,
List<SPINStatistics> statistics,
boolean singlePass,
org.apache.jena.rdf.model.Property rulePredicate,
SPINRuleComparator comparator,
ProgressMonitor monitor)
Iterates over a provided collection of SPIN rules and adds all constructed
triples to a given Model (newTriples) until no further changes have been
made within one iteration.
|
static int |
run(org.apache.jena.rdf.model.Model queryModel,
org.apache.jena.rdf.model.Model newTriples,
SPINExplanations explanations,
List<SPINStatistics> statistics,
boolean singlePass,
ProgressMonitor monitor)
See the other run method for help - this is using spin:rule as rulePredicate.
|
static int |
run(org.apache.jena.rdf.model.Model queryModel,
org.apache.jena.rdf.model.Property rulePredicate,
org.apache.jena.rdf.model.Model newTriples,
SPINExplanations explanations,
List<SPINStatistics> statistics,
boolean singlePass,
ProgressMonitor monitor)
Iterates over all SPIN rules in a (query) Model and adds all constructed
triples to a given Model (newTriples) until no further changes have been
made within one iteration.
|
static boolean |
runQueryOnInstance(QueryWrapper queryWrapper,
org.apache.jena.rdf.model.Model queryModel,
org.apache.jena.rdf.model.Model newTriples,
org.apache.jena.rdf.model.Resource instance,
boolean checkContains)
Runs a given Jena Query on a given instance and adds the inferred triples
to a given Model.
|
public static void addOptimizer(SPINInferencesOptimizer optimizer)
public static void removeOptimizer(SPINInferencesOptimizer optimizer)
public static boolean isRuleProperty(org.apache.jena.rdf.model.Property property)
property - the property to checkpublic static int run(org.apache.jena.rdf.model.Model queryModel,
org.apache.jena.rdf.model.Model newTriples,
SPINExplanations explanations,
List<SPINStatistics> statistics,
boolean singlePass,
ProgressMonitor monitor)
queryModel - the Model to querynewTriples - the Model to add the new triples toexplanations - an optional object to write explanations tostatistics - optional list to add statistics about which queries were slowsinglePass - true to just do a single pass (don't iterate)monitor - an optional ProgressMonitorrun(Model, Property, Model, SPINExplanations, List, boolean, ProgressMonitor)public static int run(org.apache.jena.rdf.model.Model queryModel,
org.apache.jena.rdf.model.Property rulePredicate,
org.apache.jena.rdf.model.Model newTriples,
SPINExplanations explanations,
List<SPINStatistics> statistics,
boolean singlePass,
ProgressMonitor monitor)
queryModel - the Model to queryrulePredicate - the rule predicate (spin:rule or a sub-property thereof)newTriples - the Model to add the new triples toexplanations - an optional object to write explanations tostatistics - optional list to add statistics about which queries were slowsinglePass - true to just do a single pass (don't iterate)monitor - an optional ProgressMonitorpublic static int run(org.apache.jena.rdf.model.Model queryModel,
org.apache.jena.rdf.model.Model newTriples,
Map<org.apache.jena.rdf.model.Resource,List<CommandWrapper>> class2Query,
Map<org.apache.jena.rdf.model.Resource,List<CommandWrapper>> class2Constructor,
SPINExplanations explanations,
List<SPINStatistics> statistics,
boolean singlePass,
org.apache.jena.rdf.model.Property rulePredicate,
SPINRuleComparator comparator,
ProgressMonitor monitor)
queryModel - the Model to querynewTriples - the Model to add the new triples toclass2Query - the map of queries to run (see SPINQueryFinder)class2Constructor - the map of constructors to runexplanations - an optional object to write explanations tostatistics - optional list to add statistics about which queries were slowsinglePass - true to just do a single pass (don't iterate)rulePredicate - the predicate used (e.g. spin:rule)comparator - optional comparator to determine the order of rule executionmonitor - an optional ProgressMonitorpublic static boolean runQueryOnInstance(QueryWrapper queryWrapper, org.apache.jena.rdf.model.Model queryModel, org.apache.jena.rdf.model.Model newTriples, org.apache.jena.rdf.model.Resource instance, boolean checkContains)
queryWrapper - the wrapper of the CONSTRUCT query to executequeryModel - the query ModelnewTriples - the Model to write the triples toinstance - the instance to run the inferences oncheckContains - true to only call add if a Triple wasn't there yetCopyright © 2017 TopQuadrant, Inc.. All rights reserved.