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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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).
    static List<Shape>
    getShapesWithTargetNode(org.apache.jena.rdf.model.RDFNode focusNode, ShapesGraph shapesGraph)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RuleUtil

      public RuleUtil()
  • Method Details

    • 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 Model
      shapesModel - the shapes Model
      inferencesModel - the Model for the inferred triples or null
      monitor - 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 Model
      shapesModel - the shapes Model
      inferencesModel - the Model for the inferred triples or null
      monitor - 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)