Package org.topbraid.shacl.rules
Class RuleUtil
- java.lang.Object
-
- org.topbraid.shacl.rules.RuleUtil
-
public class RuleUtil extends Object
Convenience methods to execute SHACL rules.- Author:
- Holger Knublauch
-
-
Constructor Summary
Constructors Constructor Description RuleUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.jena.rdf.model.ModelexecuteRules(org.apache.jena.rdf.model.Model dataModel, org.apache.jena.rdf.model.Model shapesModel, org.apache.jena.rdf.model.Model inferencesModel, ProgressMonitor monitor)Executes all rules from a given shapes Model on a given data Model.static org.apache.jena.rdf.model.ModelexecuteRules(org.apache.jena.rdf.model.RDFNode focusNode, org.apache.jena.rdf.model.Model shapesModel, org.apache.jena.rdf.model.Model inferencesModel, ProgressMonitor monitor)Executes all rules from a given shapes Model on a given focus node (in its data Model).static List<Shape>getShapesWithTargetNode(org.apache.jena.rdf.model.RDFNode focusNode, ShapesGraph shapesGraph)
-
-
-
Method Detail
-
executeRules
public static org.apache.jena.rdf.model.Model executeRules(org.apache.jena.rdf.model.Model dataModel, org.apache.jena.rdf.model.Model shapesModel, org.apache.jena.rdf.model.Model inferencesModel, ProgressMonitor monitor)Executes all rules from a given shapes Model on a given data Model. If the shapesModel does not include the system graph triples then these will be added. If inferencesModel is not null then it must be part of the dataModel (e.g. a sub-graph) of a Jena MultiUnion object. Otherwise, the function will create a new inferences Model which is merged with the dataModel for the duration of the execution.- Parameters:
dataModel- the data ModelshapesModel- the shapes ModelinferencesModel- the Model for the inferred triples or nullmonitor- an optional progress monitor- Returns:
- the Model of inferred triples (i.e. inferencesModel if not null, or a new Model)
-
executeRules
public static org.apache.jena.rdf.model.Model executeRules(org.apache.jena.rdf.model.RDFNode focusNode, org.apache.jena.rdf.model.Model shapesModel, org.apache.jena.rdf.model.Model inferencesModel, ProgressMonitor monitor)Executes all rules from a given shapes Model on a given focus node (in its data Model). This only executes the rules from the shapes that have the focus node in their target. If the shapesModel does not include the system graph triples then these will be added. If inferencesModel is not null then it must be part of the dataModel (e.g. a sub-graph) of a Jena MultiUnion object. Otherwise, the function will create a new inferences Model which is merged with the dataModel for the duration of the execution.- Parameters:
focusNode- the focus node in the data ModelshapesModel- the shapes ModelinferencesModel- the Model for the inferred triples or nullmonitor- an optional progress monitor- Returns:
- the Model of inferred triples (i.e. inferencesModel if not null, or a new Model)
-
getShapesWithTargetNode
public static List<Shape> getShapesWithTargetNode(org.apache.jena.rdf.model.RDFNode focusNode, ShapesGraph shapesGraph)
-
-