Package org.topbraid.shacl.rules
Class RuleEngine
java.lang.Object
org.topbraid.shacl.engine.AbstractEngine
org.topbraid.shacl.rules.RuleEngine
- All Implemented Interfaces:
NodeExpressionContext
A SHACL Rules engine with a pluggable architecture for different execution languages
including Triple rules, SPARQL rules and JavaScript rules.
In preparation for inclusion into SHACL 1.1, this engine also supports sh:values rules,
see https://www.topquadrant.com/graphql/values.html and treats sh:defaultValues as inferences.
- Author:
- Holger Knublauch
-
Field Summary
Fields inherited from class org.topbraid.shacl.engine.AbstractEngine
dataset, monitor, shapesGraph, shapesGraphURI -
Constructor Summary
ConstructorsConstructorDescriptionRuleEngine(org.apache.jena.query.Dataset dataset, URI shapesGraphURI, ShapesGraph shapesGraph, org.apache.jena.rdf.model.Model inferences) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidexecuteShape(Shape shape, String baseMessage, org.apache.jena.rdf.model.RDFNode focusNode) voidexecuteShapes(List<Shape> ruleShapes, org.apache.jena.rdf.model.RDFNode focusNode) Executes the rules attached to a given list of shapes, either for a dedicated focus node or all target nodes of the shapes.org.apache.jena.rdf.model.Modelorg.apache.jena.rdf.model.ModelvoidvoidsetExcludeNeverMaterialize(boolean value) If set to true then all sh:values rules in property shapes marked with dash:neverMaterialize will be skipped.voidsetExcludeValues(boolean value) If set to true then all sh:values rules will be skipped.voidMethods inherited from class org.topbraid.shacl.engine.AbstractEngine
applyEntailments, checkCanceled, getDataset, getProgressMonitor, getShapesGraph, getShapesGraphURI
-
Constructor Details
-
RuleEngine
public RuleEngine(org.apache.jena.query.Dataset dataset, URI shapesGraphURI, ShapesGraph shapesGraph, org.apache.jena.rdf.model.Model inferences)
-
-
Method Details
-
executeAll
- Throws:
InterruptedException
-
executeAllDefaultValues
- Throws:
InterruptedException
-
executeShapes
public void executeShapes(List<Shape> ruleShapes, org.apache.jena.rdf.model.RDFNode focusNode) throws InterruptedException Executes the rules attached to a given list of shapes, either for a dedicated focus node or all target nodes of the shapes.- Parameters:
ruleShapes- the shapes to executefocusNode- the (optional) focus node or null for all target nodes- Throws:
InterruptedException- if the monitor has canceled this
-
executeShape
public void executeShape(Shape shape, String baseMessage, org.apache.jena.rdf.model.RDFNode focusNode) throws InterruptedException - Throws:
InterruptedException
-
getInferencesModel
public org.apache.jena.rdf.model.Model getInferencesModel() -
getShapesModel
public org.apache.jena.rdf.model.Model getShapesModel()- Overrides:
getShapesModelin classAbstractEngine
-
infer
-
setExcludeNeverMaterialize
public void setExcludeNeverMaterialize(boolean value) If set to true then all sh:values rules in property shapes marked with dash:neverMaterialize will be skipped.- Parameters:
value- the new flag (defaults to false)
-
setExcludeValues
public void setExcludeValues(boolean value) If set to true then all sh:values rules will be skipped.- Parameters:
value- the new flag (defaults to false)
-
setProgressMonitor
- Overrides:
setProgressMonitorin classAbstractEngine
-