Skip to content

Commit de41bf7

Browse files
committed
GH-5139 fix bug in sh:qualifiedMaxCount
1 parent e1c3e4b commit de41bf7

37 files changed

Lines changed: 300 additions & 49 deletions

core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/NodeShape.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,12 @@ public SourceConstraintComponent getConstraintComponent() {
202202

203203
@Override
204204
public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, Resource[] dataGraph, Scope scope,
205-
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider) {
205+
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider,
206+
ValidationSettings validationSettings) {
206207

207208
PlanNode planNode = constraintComponents.stream()
208209
.map(c -> c.getAllTargetsPlan(connectionsGroup, dataGraph, Scope.nodeShape,
209-
new StatementMatcher.StableRandomVariableProvider()))
210+
new StatementMatcher.StableRandomVariableProvider(), validationSettings))
210211
.distinct()
211212
.reduce((nodes, nodes2) -> UnionNode.getInstanceDedupe(connectionsGroup, nodes, nodes2))
212213
.orElse(EmptyNode.getInstance());

core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/PropertyShape.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,11 @@ constraintComponent, getSeverity(), t.getScope(), t.getContexts(),
255255

256256
@Override
257257
public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, Resource[] dataGraph, Scope scope,
258-
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider) {
258+
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider,
259+
ValidationSettings validationSettings) {
259260
PlanNode planNode = constraintComponents.stream()
260261
.map(c -> c.getAllTargetsPlan(connectionsGroup, dataGraph, Scope.propertyShape,
261-
new StatementMatcher.StableRandomVariableProvider()))
262+
new StatementMatcher.StableRandomVariableProvider(), validationSettings))
262263
.distinct()
263264
.reduce((nodes, nodes2) -> UnionNode.getInstanceDedupe(connectionsGroup, nodes, nodes2))
264265
.orElse(EmptyNode.getInstance());

core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/constraintcomponents/AbstractConstraintComponent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ public boolean requiresEvaluation(ConnectionsGroup connectionsGroup, Scope scope
103103

104104
@Override
105105
public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, Resource[] dataGraph, Scope scope,
106-
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider) {
106+
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider,
107+
ValidationSettings validationSettings) {
107108
throw new UnsupportedOperationException();
108109
}
109110

core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/constraintcomponents/AbstractPairwiseConstraintComponent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ private PlanNode getAllTargetsBasedOnPredicate(ConnectionsGroup connectionsGroup
161161

162162
@Override
163163
public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, Resource[] dataGraph, Scope scope,
164-
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider) {
164+
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider,
165+
ValidationSettings validationSettings) {
165166
if (scope == Scope.propertyShape) {
166167
PlanNode allTargetsPlan = getTargetChain()
167168
.getEffectiveTarget(Scope.nodeShape, connectionsGroup.getRdfsSubClassOfReasoner(),

core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/constraintcomponents/AbstractSimpleConstraintComponent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,8 @@ String literalToString(Literal literal) {
332332

333333
@Override
334334
public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, Resource[] dataGraph, Scope scope,
335-
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider) {
335+
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider,
336+
ValidationSettings validationSettings) {
336337

337338
if (scope == Scope.propertyShape) {
338339

core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/constraintcomponents/AndConstraintComponent.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,11 @@ public PlanNode generateTransactionalValidationPlan(ConnectionsGroup connections
121121

122122
@Override
123123
public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, Resource[] dataGraph, Scope scope,
124-
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider) {
124+
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider,
125+
ValidationSettings validationSettings) {
125126
PlanNode planNode = and.stream()
126127
.map(c -> c.getAllTargetsPlan(connectionsGroup, dataGraph, scope,
127-
new StatementMatcher.StableRandomVariableProvider()))
128+
new StatementMatcher.StableRandomVariableProvider(), validationSettings))
128129
.distinct()
129130
.reduce((nodes, nodes2) -> UnionNode.getInstanceDedupe(connectionsGroup, nodes, nodes2))
130131
.orElse(EmptyNode.getInstance());

core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/constraintcomponents/ClassConstraintComponent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ public PlanNode generateTransactionalValidationPlan(ConnectionsGroup connections
237237

238238
@Override
239239
public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, Resource[] dataGraph, Scope scope,
240-
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider) {
240+
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider,
241+
ValidationSettings validationSettings) {
241242
if (scope == Scope.propertyShape) {
242243
PlanNode allTargetsPlan = getTargetChain()
243244
.getEffectiveTarget(Scope.nodeShape, connectionsGroup.getRdfsSubClassOfReasoner(),

core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/constraintcomponents/ClosedConstraintComponent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ public PlanNode generateTransactionalValidationPlan(ConnectionsGroup connections
330330

331331
@Override
332332
public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, Resource[] dataGraph, Scope scope,
333-
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider) {
333+
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider,
334+
ValidationSettings validationSettings) {
334335

335336
EffectiveTarget effectiveTarget = getTargetChain().getEffectiveTarget(scope,
336337
connectionsGroup.getRdfsSubClassOfReasoner(), stableRandomVariableProvider);

core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/constraintcomponents/ConstraintComponent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ boolean requiresEvaluation(ConnectionsGroup connectionsGroup, Scope scope, Resou
6363
SourceConstraintComponent getConstraintComponent();
6464

6565
PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, Resource[] dataGraph, Scope scope,
66-
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider);
66+
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider,
67+
ValidationSettings validationSettings);
6768

6869
SparqlFragment buildSparqlValidNodes_rsx_targetShape(Variable<Value> subject,
6970
Variable<Value> object, RdfsSubClassOfReasoner rdfsSubClassOfReasoner, Scope scope,

core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/constraintcomponents/DashHasValueInConstraintComponent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ public PlanNode generateTransactionalValidationPlan(ConnectionsGroup connections
150150

151151
@Override
152152
public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, Resource[] dataGraph, Scope scope,
153-
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider) {
153+
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider,
154+
ValidationSettings validationSettings) {
154155
if (scope == Scope.propertyShape) {
155156
PlanNode allTargetsPlan = getTargetChain()
156157
.getEffectiveTarget(Scope.nodeShape, connectionsGroup.getRdfsSubClassOfReasoner(),

0 commit comments

Comments
 (0)