public class ValidationEngine extends AbstractEngine implements ConfigurableEngine
dataset, monitor, shapesGraph, shapesGraphURI| Modifier | Constructor and Description |
|---|---|
protected |
ValidationEngine(org.apache.jena.query.Dataset dataset,
URI shapesGraphURI,
ShapesGraph shapesGraph,
org.apache.jena.rdf.model.Resource report)
Constructs a new ValidationEngine.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addResultMessage(org.apache.jena.rdf.model.Resource result,
org.apache.jena.rdf.model.Literal message,
org.apache.jena.query.QuerySolution bindings) |
org.apache.jena.rdf.model.Resource |
createResult(org.apache.jena.rdf.model.Resource type,
Constraint constraint,
org.apache.jena.rdf.model.RDFNode focusNode) |
org.apache.jena.rdf.model.Resource |
createValidationResult(Constraint constraint,
org.apache.jena.rdf.model.RDFNode focusNode,
org.apache.jena.rdf.model.RDFNode value,
Supplier<String> defaultMessage) |
ClassesCache |
getClassesCache() |
ValidationEngineConfiguration |
getConfiguration() |
static ValidationEngine |
getCurrent() |
String |
getLabel(org.apache.jena.rdf.model.RDFNode node) |
Function<org.apache.jena.rdf.model.RDFNode,String> |
getLabelFunction() |
org.apache.jena.rdf.model.Resource |
getReport()
Gets the validation report as a Resource in the report Model.
|
ValidationReport |
getValidationReport() |
Collection<org.apache.jena.rdf.model.RDFNode> |
getValueNodes(Constraint constraint,
org.apache.jena.rdf.model.RDFNode focusNode) |
boolean |
nodesConformToShape(List<org.apache.jena.rdf.model.RDFNode> focusNodes,
org.apache.jena.graph.Node shape)
Validates a given list of focus node against a given Shape, and stops as soon
as one validation result is reported.
|
void |
setClassesCache(ClassesCache value) |
void |
setConfiguration(ValidationEngineConfiguration configuration) |
static void |
setCurrent(ValidationEngine value) |
void |
setFocusNodeFilter(Predicate<org.apache.jena.rdf.model.RDFNode> value)
Sets a filter that can be used to skip certain focus node from validation.
|
void |
setLabelFunction(Function<org.apache.jena.rdf.model.RDFNode,String> value) |
void |
updateConforms() |
org.apache.jena.rdf.model.Resource |
validateAll()
Validates all target nodes against all of their shapes.
|
org.apache.jena.rdf.model.Resource |
validateNode(org.apache.jena.graph.Node focusNode)
Validates a given focus node against all of the shapes that have matching targets.
|
protected void |
validateNodesAgainstConstraint(Collection<org.apache.jena.rdf.model.RDFNode> focusNodes,
Constraint constraint) |
org.apache.jena.rdf.model.Resource |
validateNodesAgainstShape(List<org.apache.jena.rdf.model.RDFNode> focusNodes,
org.apache.jena.graph.Node shape)
Validates a given list of focus node against a given Shape.
|
applyEntailments, checkCanceled, getDataset, getProgressMonitor, getShapesGraph, getShapesGraphURI, getShapesModel, setProgressMonitorprotected ValidationEngine(org.apache.jena.query.Dataset dataset,
URI shapesGraphURI,
ShapesGraph shapesGraph,
org.apache.jena.rdf.model.Resource report)
dataset - the Dataset to operate onshapesGraphURI - the URI of the shapes graph (must be in the dataset)shapesGraph - the ShapesGraph with the shapes to validate againstreport - the sh:ValidationReport object in the results Model, or null to create a new onepublic static ValidationEngine getCurrent()
public static void setCurrent(ValidationEngine value)
public void setLabelFunction(Function<org.apache.jena.rdf.model.RDFNode,String> value)
public void addResultMessage(org.apache.jena.rdf.model.Resource result,
org.apache.jena.rdf.model.Literal message,
org.apache.jena.query.QuerySolution bindings)
public org.apache.jena.rdf.model.Resource createResult(org.apache.jena.rdf.model.Resource type,
Constraint constraint,
org.apache.jena.rdf.model.RDFNode focusNode)
public org.apache.jena.rdf.model.Resource createValidationResult(Constraint constraint, org.apache.jena.rdf.model.RDFNode focusNode, org.apache.jena.rdf.model.RDFNode value, Supplier<String> defaultMessage)
public ClassesCache getClassesCache()
public String getLabel(org.apache.jena.rdf.model.RDFNode node)
public org.apache.jena.rdf.model.Resource getReport()
public ValidationReport getValidationReport()
public Collection<org.apache.jena.rdf.model.RDFNode> getValueNodes(Constraint constraint, org.apache.jena.rdf.model.RDFNode focusNode)
public void setClassesCache(ClassesCache value)
public void setFocusNodeFilter(Predicate<org.apache.jena.rdf.model.RDFNode> value)
value - the new filterpublic void updateConforms()
public org.apache.jena.rdf.model.Resource validateAll()
throws InterruptedException
setFocusNodeFilter(Predicate).InterruptedException - if the monitor has canceled thispublic org.apache.jena.rdf.model.Resource validateNode(org.apache.jena.graph.Node focusNode)
throws InterruptedException
focusNode - the node to validateInterruptedException - if the monitor has canceled thispublic org.apache.jena.rdf.model.Resource validateNodesAgainstShape(List<org.apache.jena.rdf.model.RDFNode> focusNodes, org.apache.jena.graph.Node shape)
focusNodes - the nodes to validateshape - the sh:Shape to validate againstpublic boolean nodesConformToShape(List<org.apache.jena.rdf.model.RDFNode> focusNodes, org.apache.jena.graph.Node shape)
focusNodes - the nodes to validateshape - the sh:Shape to validate againstprotected void validateNodesAgainstConstraint(Collection<org.apache.jena.rdf.model.RDFNode> focusNodes, Constraint constraint)
public ValidationEngineConfiguration getConfiguration()
getConfiguration in interface ConfigurableEnginepublic void setConfiguration(ValidationEngineConfiguration configuration)
setConfiguration in interface ConfigurableEngineCopyright © 2019 TopQuadrant, Inc.. All rights reserved.