Package org.topbraid.shacl.validation
Class ValidationUtil
java.lang.Object
org.topbraid.shacl.validation.ValidationUtil
Convenience methods to perform SHACL validation.
These methods are provided for convenience of simple use cases only but are often not the most efficient way
of working with SHACL. It is typically better to separate the creation of the ShapesGraph object from
the ValidationEngine because the ShapesGraph can be reused across multiple validations, and serves as a "pre-compiled"
data structure that is expensive to rebuild for each run.
Having separate calls also provides access to the other functions of the ValidationEngine object, such as
validateNode and getValidationReport.- Author:
- Holger Knublauch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ValidationEnginecreateValidationEngine(org.apache.jena.rdf.model.Model dataModel, org.apache.jena.rdf.model.Model shapesModel, boolean validateShapes) static ValidationEnginecreateValidationEngine(org.apache.jena.rdf.model.Model dataModel, org.apache.jena.rdf.model.Model shapesModel, ValidationEngineConfiguration configuration) static org.apache.jena.rdf.model.ModelensureToshTriplesExist(org.apache.jena.rdf.model.Model shapesModel) static org.apache.jena.rdf.model.ResourcevalidateModel(org.apache.jena.rdf.model.Model dataModel, org.apache.jena.rdf.model.Model shapesModel, boolean validateShapes) Validates a given data Model against all shapes from a given shapes Model.static org.apache.jena.rdf.model.ResourcevalidateModel(org.apache.jena.rdf.model.Model dataModel, org.apache.jena.rdf.model.Model shapesModel, ValidationEngineConfiguration configuration) Validates a given data Model against all shapes from a given shapes Model.
-
Constructor Details
-
ValidationUtil
public ValidationUtil()
-
-
Method Details
-
createValidationEngine
public static ValidationEngine createValidationEngine(org.apache.jena.rdf.model.Model dataModel, org.apache.jena.rdf.model.Model shapesModel, boolean validateShapes) -
createValidationEngine
public static ValidationEngine createValidationEngine(org.apache.jena.rdf.model.Model dataModel, org.apache.jena.rdf.model.Model shapesModel, ValidationEngineConfiguration configuration) -
ensureToshTriplesExist
public static org.apache.jena.rdf.model.Model ensureToshTriplesExist(org.apache.jena.rdf.model.Model shapesModel) -
validateModel
public static org.apache.jena.rdf.model.Resource validateModel(org.apache.jena.rdf.model.Model dataModel, org.apache.jena.rdf.model.Model shapesModel, boolean validateShapes) Validates a given data Model against all shapes from a given shapes Model. If the shapesModel does not include the system graph triples then these will be added. Entailment regimes are applied prior to validation.- Parameters:
dataModel- the data ModelshapesModel- the shapes ModelvalidateShapes- true to also validate any shapes in the data Model (false is faster)- Returns:
- an instance of sh:ValidationReport in a results Model
-
validateModel
public static org.apache.jena.rdf.model.Resource validateModel(org.apache.jena.rdf.model.Model dataModel, org.apache.jena.rdf.model.Model shapesModel, ValidationEngineConfiguration configuration) Validates a given data Model against all shapes from a given shapes Model. If the shapesModel does not include the system graph triples then these will be added. Entailment regimes are applied prior to validation.- Parameters:
dataModel- the data ModelshapesModel- the shapes Modelconfiguration- configuration for the validation engine- Returns:
- an instance of sh:ValidationReport in a results Model
-