@ApiStability.Stable
public interface ValidationAlgorithm
ValidationAlgorithm
must be initialized with an Graph
and a ShexSchema
.
Then the validate(RDFTerm, Label)
method tests whether a node satisfies the expression corresponding to a label.
A call to validate(RDFTerm, Label)
also constructs a Typing
that allows to prove or disprove the result returned by the method,
and that can be retrieved using getTyping()
.
Successive calls to validate(RDFTerm, Label)
enrich the constructed Typing
, unless it is reinitialized using resetTyping()
.Modifier and Type | Method and Description |
---|---|
void |
addMatchingObserver(MatchingCollector o) |
Typing |
getTyping()
The typing that proves the result returned by previous validations.
|
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.
|
void |
removeMatchingObserver(MatchingCollector o) |
void |
resetTyping()
Resets the typing, thus erasing all previously computed validation results.
|
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)
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,
ComputationController compController)
Constructs a shape map that allows to validate a focus node against a type.
|
@ApiStability.Stable boolean validate(org.apache.commons.rdf.api.RDFTerm focusNode, Label label)
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 schemaboolean validate(org.apache.commons.rdf.api.RDFTerm focusNode, Label label, ComputationController compController) throws Exception
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.time
- Typing#getStatus
returns Status.CONFORMANT
IllegalArgumentException
- if the label does not belong to the schemaException
ResultShapeMap validate(BaseShapeMap shapeMap)
shapeMap
- The shapeMap with the asociations requested.IllegalArgumentException
- if the label does not belong to the schemaResultShapeMap validate(BaseShapeMap shapeMap, ComputationController compController) throws Exception
shapeMap
- The shapeMap with the asociations requested.IllegalArgumentException
- if the label does not belong to the schemaException
@ApiStability.Stable Typing getTyping()
@ApiStability.Stable void resetTyping()
void notifyMatchingFound(org.apache.commons.rdf.api.RDFTerm focusNode, Label label, LocalMatching matching)
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 notifyStartValidation()
and notifyValidationComplete()
, contains a matching that is valid within the typing returned by getTyping()
.focusNode
- label
- matching
- null means that no matching is knownvoid notifyStartValidation()
validate(RDFTerm, Label)
void notifyValidationComplete()
void addMatchingObserver(MatchingCollector o)
void removeMatchingObserver(MatchingCollector o)
Copyright © 2019. All rights reserved.