Class SimpleAbstractConstraintComponent
- java.lang.Object
-
- org.eclipse.rdf4j.sail.shacl.ast.constraintcomponents.AbstractConstraintComponent
-
- org.eclipse.rdf4j.sail.shacl.ast.constraintcomponents.SimpleAbstractConstraintComponent
-
- All Implemented Interfaces:
ConstraintComponent
,Exportable
,TargetChainInterface
- Direct Known Subclasses:
DatatypeConstraintComponent
,InConstraintComponent
,LanguageInConstraintComponent
,MaxExclusiveConstraintComponent
,MaxInclusiveConstraintComponent
,MaxLengthConstraintComponent
,MinExclusiveConstraintComponent
,MinInclusiveConstraintComponent
,MinLengthConstraintComponent
,NodeKindConstraintComponent
,PatternConstraintComponent
public abstract class SimpleAbstractConstraintComponent extends AbstractConstraintComponent
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.rdf4j.sail.shacl.ast.constraintcomponents.ConstraintComponent
ConstraintComponent.Scope
-
-
Field Summary
Fields Modifier and Type Field Description private Resource
id
private static org.slf4j.Logger
logger
(package private) TargetChain
targetChain
-
Fields inherited from class org.eclipse.rdf4j.sail.shacl.ast.constraintcomponents.AbstractConstraintComponent
VALUES_INJECTION_POINT
-
-
Constructor Summary
Constructors Constructor Description SimpleAbstractConstraintComponent()
SimpleAbstractConstraintComponent(Resource id)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ValidationQuery
generateSparqlValidationQuery(ConnectionsGroup connectionsGroup, ValidationSettings validationSettings, boolean negatePlan, boolean negateChildren, ConstraintComponent.Scope scope)
PlanNode
generateTransactionalValidationPlan(ConnectionsGroup connectionsGroup, ValidationSettings validationSettings, PlanNodeProvider overrideTargetNode, ConstraintComponent.Scope scope)
PlanNode
getAllTargetsPlan(ConnectionsGroup connectionsGroup, Resource[] dataGraph, ConstraintComponent.Scope scope, StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider)
SourceConstraintComponent
getConstraintComponent()
(package private) abstract java.util.function.Function<PlanNode,FilterPlanNode>
getFilterAttacher()
private PlanNode
getFilterAttacherWithNegation(boolean negatePlan, PlanNode allTargets)
Resource
getId()
ValidationApproach
getOptimalBulkValidationApproach()
Should return the fastest validation approach for bulk validation.private PlanNode
getPlanNodeForOverrideTargetNode(ConnectionsGroup connectionsGroup, ValidationSettings validationSettings, PlanNodeProvider overrideTargetNode, ConstraintComponent.Scope scope, boolean negatePlan, StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider, EffectiveTarget effectiveTarget, java.util.Optional<Path> path)
ValidationApproach
getPreferredValidationApproach(ConnectionsGroup connectionsGroup)
A constraint component should decide which validation approach is going to be the optimal performance wise based on the state of the transaction and base sail.private java.lang.String
getSparqlFilter(boolean negatePlan, StatementMatcher.Variable<Value> variable, StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider)
(package private) abstract java.lang.String
getSparqlFilterExpression(StatementMatcher.Variable<Value> variable, boolean negated)
Simple constraints need only implement this method to support SPARQL based validation.TargetChain
getTargetChain()
(package private) java.lang.String
literalToString(Literal literal)
void
setTargetChain(TargetChain targetChain)
-
Methods inherited from class org.eclipse.rdf4j.sail.shacl.ast.constraintcomponents.AbstractConstraintComponent
buildSparqlValidNodes_rsx_targetShape, requiresEvaluation, stringRepresentationOfValue, trim
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.sail.shacl.ast.constraintcomponents.ConstraintComponent
deepClone, getDefaultMessage
-
Methods inherited from interface org.eclipse.rdf4j.sail.shacl.ast.Exportable
toModel
-
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
id
private Resource id
-
targetChain
TargetChain targetChain
-
-
Constructor Detail
-
SimpleAbstractConstraintComponent
public SimpleAbstractConstraintComponent(Resource id)
-
SimpleAbstractConstraintComponent
public SimpleAbstractConstraintComponent()
-
-
Method Detail
-
getId
public Resource getId()
- Overrides:
getId
in classAbstractConstraintComponent
-
getTargetChain
public TargetChain getTargetChain()
- Specified by:
getTargetChain
in interfaceTargetChainInterface
- Overrides:
getTargetChain
in classAbstractConstraintComponent
-
setTargetChain
public void setTargetChain(TargetChain targetChain)
- Specified by:
setTargetChain
in interfaceTargetChainInterface
- Overrides:
setTargetChain
in classAbstractConstraintComponent
-
generateTransactionalValidationPlan
public PlanNode generateTransactionalValidationPlan(ConnectionsGroup connectionsGroup, ValidationSettings validationSettings, PlanNodeProvider overrideTargetNode, ConstraintComponent.Scope scope)
- Specified by:
generateTransactionalValidationPlan
in interfaceConstraintComponent
- Overrides:
generateTransactionalValidationPlan
in classAbstractConstraintComponent
-
getPlanNodeForOverrideTargetNode
private PlanNode getPlanNodeForOverrideTargetNode(ConnectionsGroup connectionsGroup, ValidationSettings validationSettings, PlanNodeProvider overrideTargetNode, ConstraintComponent.Scope scope, boolean negatePlan, StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider, EffectiveTarget effectiveTarget, java.util.Optional<Path> path)
-
generateSparqlValidationQuery
public ValidationQuery generateSparqlValidationQuery(ConnectionsGroup connectionsGroup, ValidationSettings validationSettings, boolean negatePlan, boolean negateChildren, ConstraintComponent.Scope scope)
- Specified by:
generateSparqlValidationQuery
in interfaceConstraintComponent
- Overrides:
generateSparqlValidationQuery
in classAbstractConstraintComponent
-
getSparqlFilter
private java.lang.String getSparqlFilter(boolean negatePlan, StatementMatcher.Variable<Value> variable, StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider)
-
getSparqlFilterExpression
abstract java.lang.String getSparqlFilterExpression(StatementMatcher.Variable<Value> variable, boolean negated)
Simple constraints need only implement this method to support SPARQL based validation. The returned filter body should evaluate to true for values that fail validation, unless negated==true. If the filter condition throws an error (a SPARQL runtime error, not Java error) then the error will be caught and coalesced to `true`.- Parameters:
variable
-negated
-- Returns:
- a string that is the body of a SPARQL filter
-
getFilterAttacherWithNegation
private PlanNode getFilterAttacherWithNegation(boolean negatePlan, PlanNode allTargets)
-
getPreferredValidationApproach
public ValidationApproach getPreferredValidationApproach(ConnectionsGroup connectionsGroup)
Description copied from interface:ConstraintComponent
A constraint component should decide which validation approach is going to be the optimal performance wise based on the state of the transaction and base sail.- Specified by:
getPreferredValidationApproach
in interfaceConstraintComponent
- Overrides:
getPreferredValidationApproach
in classAbstractConstraintComponent
-
getOptimalBulkValidationApproach
public ValidationApproach getOptimalBulkValidationApproach()
Description copied from interface:ConstraintComponent
Should return the fastest validation approach for bulk validation. When aggregating multiple constraint components the most compatible should be chosen.- Specified by:
getOptimalBulkValidationApproach
in interfaceConstraintComponent
- Overrides:
getOptimalBulkValidationApproach
in classAbstractConstraintComponent
-
getConstraintComponent
public SourceConstraintComponent getConstraintComponent()
-
getFilterAttacher
abstract java.util.function.Function<PlanNode,FilterPlanNode> getFilterAttacher()
-
literalToString
java.lang.String literalToString(Literal literal)
-
getAllTargetsPlan
public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, Resource[] dataGraph, ConstraintComponent.Scope scope, StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider)
- Specified by:
getAllTargetsPlan
in interfaceConstraintComponent
- Overrides:
getAllTargetsPlan
in classAbstractConstraintComponent
-
-