Package org.topbraid.shacl.rules
Class RuleEngine
- java.lang.Object
-
- org.topbraid.shacl.engine.AbstractEngine
-
- org.topbraid.shacl.rules.RuleEngine
-
- All Implemented Interfaces:
NodeExpressionContext
public class RuleEngine extends AbstractEngine
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
Constructors Constructor Description RuleEngine(org.apache.jena.query.Dataset dataset, URI shapesGraphURI, ShapesGraph shapesGraph, org.apache.jena.rdf.model.Model inferences)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecuteAll()voidexecuteAllDefaultValues()voidexecuteShape(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.ModelgetInferencesModel()org.apache.jena.rdf.model.ModelgetShapesModel()voidinfer(org.apache.jena.graph.Triple triple, Rule rule, Shape shape)voidsetExcludeNeverMaterialize(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.voidsetProgressMonitor(ProgressMonitor value)-
Methods inherited from class org.topbraid.shacl.engine.AbstractEngine
applyEntailments, checkCanceled, getDataset, getProgressMonitor, getShapesGraph, getShapesGraphURI
-
-
-
-
Constructor Detail
-
RuleEngine
public RuleEngine(org.apache.jena.query.Dataset dataset, URI shapesGraphURI, ShapesGraph shapesGraph, org.apache.jena.rdf.model.Model inferences)
-
-
Method Detail
-
executeAll
public void executeAll() throws InterruptedException- Throws:
InterruptedException
-
executeAllDefaultValues
public void executeAllDefaultValues() throws InterruptedException- 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
-
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
public void setProgressMonitor(ProgressMonitor value)
- Overrides:
setProgressMonitorin classAbstractEngine
-
-