public abstract class ValidationAlgorithmAbstract extends Object implements ValidationAlgorithm
ValidationAlgorithm
that offers some common utilities.Modifier and Type | Field and Description |
---|---|
protected DynamicCollectorOfTripleConstraints |
collectorTC |
protected ComputationController |
compController |
protected org.apache.commons.rdf.api.Graph |
graph |
protected ShexSchema |
schema |
Constructor and Description |
---|
ValidationAlgorithmAbstract(ShexSchema schema,
org.apache.commons.rdf.api.Graph graph) |
Modifier and Type | Method and Description |
---|---|
void |
addMatchingObserver(MatchingCollector o) |
protected ComputationController |
getCompController() |
void |
notifyMatchingFound(org.apache.commons.rdf.api.RDFTerm focusNode,
Label label,
LocalMatching matching)
Notifies all observers that a matching was found, or that no matching is known for the given focusNode and label.
|
void |
notifyStartValidation()
Notifies all observers that a validation just started.
|
void |
notifyValidationComplete()
Notifies all observers that a validation just ended.
|
protected abstract boolean |
performValidation(org.apache.commons.rdf.api.RDFTerm focusNode,
Label label) |
void |
removeMatchingObserver(MatchingCollector o) |
ResultShapeMap |
validate(BaseShapeMap shapeMap)
Constructs a shape map that allows to validate a focus node against a type.
|
ResultShapeMap |
validate(BaseShapeMap shapeMap,
ComputationController compController)
Constructs a shape map that allows to validate a focus node against a type.
|
boolean |
validate(org.apache.commons.rdf.api.RDFTerm focusNode,
Label label)
(non-Javadoc)
|
boolean |
validate(org.apache.commons.rdf.api.RDFTerm focusNode,
Label label,
ComputationController compController)
Constructs a shape map that allows to validate a focus node against a type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTyping, resetTyping
protected org.apache.commons.rdf.api.Graph graph
protected ShexSchema schema
protected ComputationController compController
protected DynamicCollectorOfTripleConstraints collectorTC
public ValidationAlgorithmAbstract(ShexSchema schema, org.apache.commons.rdf.api.Graph graph)
protected abstract boolean performValidation(org.apache.commons.rdf.api.RDFTerm focusNode, Label label) throws Exception
Exception
public boolean validate(org.apache.commons.rdf.api.RDFTerm focusNode, Label label)
validate
in interface ValidationAlgorithm
focusNode
- The focus node for which the shape map is to be complete. The node must belong to the graph.label
- The label against which the node is being tested.Typing#getStatus
returns Status.CONFORMANT
ValidationAlgorithm.validate(org.apache.commons.rdf.api.RDFTerm, fr.inria.lille.shexjava.schema.Label)
public boolean validate(org.apache.commons.rdf.api.RDFTerm focusNode, Label label, ComputationController compController) throws Exception
ValidationAlgorithm
validate
in interface ValidationAlgorithm
focusNode
- The focus node for which the shape map is to be complete. The node must belong to the graph.label
- The label against which the node is being tested.Typing#getStatus
returns Status.CONFORMANT
IllegalArgumentException
- if the label does not belong to the schemaException
public ResultShapeMap validate(BaseShapeMap shapeMap)
ValidationAlgorithm
validate
in interface ValidationAlgorithm
shapeMap
- The shapeMap with the asociations requested.public ResultShapeMap validate(BaseShapeMap shapeMap, ComputationController compController) throws Exception
ValidationAlgorithm
validate
in interface ValidationAlgorithm
shapeMap
- The shapeMap with the asociations requested.IllegalArgumentException
- if the label does not belong to the schemaException
public void notifyMatchingFound(org.apache.commons.rdf.api.RDFTerm focusNode, Label label, LocalMatching matching)
ValidationAlgorithm
ValidationAlgorithm.getTyping()
.
The ValidationAlgorithm
guarantees however that for any given focusNode and label, the notification regarding these focusNode and label that is the last one between two consecutive calls of ValidationAlgorithm.notifyStartValidation()
and ValidationAlgorithm.notifyValidationComplete()
, contains a matching that is valid within the typing returned by ValidationAlgorithm.getTyping()
.notifyMatchingFound
in interface ValidationAlgorithm
matching
- null means that no matching is knownpublic void notifyStartValidation()
ValidationAlgorithm
ValidationAlgorithm.validate(RDFTerm, Label)
notifyStartValidation
in interface ValidationAlgorithm
public void notifyValidationComplete()
ValidationAlgorithm
notifyValidationComplete
in interface ValidationAlgorithm
public void addMatchingObserver(MatchingCollector o)
addMatchingObserver
in interface ValidationAlgorithm
public void removeMatchingObserver(MatchingCollector o)
removeMatchingObserver
in interface ValidationAlgorithm
protected ComputationController getCompController()
Copyright © 2019. All rights reserved.