Skip to content

Commit e4bb0a0

Browse files
committed
eclipse-rdf4jGH-4240 skip property shape if sh:path is not implemented/supported
1 parent f0025be commit e4bb0a0

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

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

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ public ValidationQuery generateSparqlValidationQuery(ConnectionsGroup connection
136136
return ValidationQuery.Deactivated.getInstance();
137137
}
138138

139+
if (!getPath().isSupported()) {
140+
logger.error("Unsupported path detected. Shape ignored!\n{}", this);
141+
return ValidationQuery.Deactivated.getInstance();
142+
}
143+
139144
ValidationQuery validationQuery = constraintComponents.stream()
140145
.map(c -> {
141146
ValidationQuery validationQuery1 = c.generateSparqlValidationQuery(connectionsGroup,
@@ -177,6 +182,11 @@ public PlanNode generateTransactionalValidationPlan(ConnectionsGroup connections
177182
return EmptyNode.getInstance();
178183
}
179184

185+
if (!getPath().isSupported()) {
186+
logger.error("Unsupported path detected. Shape ignored!\n{}", this);
187+
return EmptyNode.getInstance();
188+
}
189+
180190
PlanNode union = EmptyNode.getInstance();
181191

182192
// if (negatePlan) {
@@ -205,10 +215,6 @@ public PlanNode generateTransactionalValidationPlan(ConnectionsGroup connections
205215
// }
206216

207217
for (ConstraintComponent constraintComponent : constraintComponents) {
208-
if (!getPath().isSupported()) {
209-
logger.error("Unsupported path detected. Shape ignored!\n" + this);
210-
continue;
211-
}
212218

213219
PlanNode validationPlanNode = constraintComponent
214220
.generateTransactionalValidationPlan(connectionsGroup, validationSettings, overrideTargetNode,
@@ -276,6 +282,17 @@ public Path getPath() {
276282
return path;
277283
}
278284

285+
@Override
286+
public boolean requiresEvaluation(ConnectionsGroup connectionsGroup, Scope scope, Resource[] dataGraph,
287+
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider) {
288+
if (!getPath().isSupported()) {
289+
logger.error("Unsupported path detected. Shape ignored!\n{}", this);
290+
return false;
291+
}
292+
293+
return super.requiresEvaluation(connectionsGroup, scope, dataGraph, stableRandomVariableProvider);
294+
}
295+
279296
@Override
280297
public ConstraintComponent deepClone() {
281298
PropertyShape nodeShape = new PropertyShape(this);

0 commit comments

Comments
 (0)