Skip to content

Commit ccf7377

Browse files
authored
merge main (#5126)
2 parents 985beac + 5c956e1 commit ccf7377

110 files changed

Lines changed: 2320 additions & 166 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/model/src/main/java/org/eclipse/rdf4j/model/util/Configurations.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,13 @@ public static Set<Value> getPropertyValues(Model model, Resource subject, IRI pr
165165
var fallbackObjects = model.filter(subject, fallbackProperty, null).objects();
166166

167167
if (!fallbackObjects.isEmpty() && !preferredObjects.equals(fallbackObjects)) {
168-
logger.warn("Discrepancy between use of the old and new config vocabulary.");
168+
var msg = "Discrepancy between use of the old and new config vocabulary.";
169+
// depending on whether preferred is set, we log on warn or debug
170+
if (preferredObjects.isEmpty()) {
171+
logger.debug(msg);
172+
} else {
173+
logger.warn(msg);
174+
}
169175

170176
if (preferredObjects.containsAll(fallbackObjects)) {
171177
return preferredObjects;
@@ -235,7 +241,13 @@ public static Optional<Resource> getSubjectByType(Model model, IRI type, IRI leg
235241
private static void logDiscrepancyWarning(Optional<? extends Value> preferred,
236242
Optional<? extends Value> fallback) {
237243
if (!fallback.isEmpty() && !preferred.equals(fallback)) {
238-
logger.warn("Discrepancy between use of the old and new config vocabulary.");
244+
var msg = "Discrepancy between use of the old and new config vocabulary.";
245+
// depending on whether preferred is set, we log on warn or debug
246+
if (preferred.isEmpty()) {
247+
logger.debug(msg);
248+
} else {
249+
logger.warn(msg);
250+
}
239251
}
240252
}
241253
}

core/model/src/test/java/org/eclipse/rdf4j/model/util/ConfigurationsTest.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public void testGetLiteralValue_no_discrepancy() {
101101
var result = Configurations.getLiteralValue(m, subject, RDFS.LABEL, RDFS.COMMENT);
102102
assertThat(result).contains(literal("label"));
103103
assertNotLogged("Discrepancy between use of the old and new config vocabulary.", Level.WARN);
104+
assertNotLogged("Discrepancy between use of the old and new config vocabulary.", Level.DEBUG);
104105
}
105106

106107
@Test
@@ -116,7 +117,21 @@ public void testGetLiteralValue_useLegacy_onlyNew() {
116117
System.setProperty("org.eclipse.rdf4j.model.vocabulary.useLegacyConfig", "");
117118

118119
assertThat(result).contains(literal("label"));
119-
assertLogged("Discrepancy between use of the old and new config vocabulary.", Level.WARN);
120+
assertLogged("Discrepancy between use of the old and new config vocabulary.", Level.DEBUG);
121+
}
122+
123+
@Test
124+
public void testGetLiteralValue_onlyLegacy() {
125+
126+
var subject = bnode();
127+
var m = new ModelBuilder().subject(subject)
128+
.add(RDFS.COMMENT, "comment")
129+
.build();
130+
131+
var result = Configurations.getLiteralValue(m, subject, RDFS.LABEL, RDFS.COMMENT);
132+
133+
assertThat(result).contains(literal("comment"));
134+
assertLogged("Discrepancy between use of the old and new config vocabulary.", Level.DEBUG);
120135
}
121136

122137
@Test
@@ -158,6 +173,7 @@ public void testGetResourceValue_no_discrepancy() {
158173
var result = Configurations.getResourceValue(m, subject, RDFS.LABEL, RDFS.COMMENT);
159174
assertThat(result).contains(iri("urn:label"));
160175
assertNotLogged("Discrepancy between use of the old and new config vocabulary.", Level.WARN);
176+
assertNotLogged("Discrepancy between use of the old and new config vocabulary.", Level.DEBUG);
161177
}
162178

163179
@Test
@@ -183,6 +199,7 @@ public void testGetIRIValue_no_discrepancy() {
183199
var result = Configurations.getIRIValue(m, subject, RDFS.LABEL, RDFS.COMMENT);
184200
assertThat(result).contains(iri("urn:label"));
185201
assertNotLogged("Discrepancy between use of the old and new config vocabulary.", Level.WARN);
202+
assertNotLogged("Discrepancy between use of the old and new config vocabulary.", Level.DEBUG);
186203
}
187204

188205
@Test
@@ -197,6 +214,7 @@ public void testGetPropertyValues_no_legacy() {
197214
var result = Configurations.getPropertyValues(m, subject, RDFS.LABEL, RDFS.COMMENT);
198215
assertThat(result).hasSize(2);
199216
assertNotLogged("Discrepancy between use of the old and new config vocabulary.", Level.WARN);
217+
assertNotLogged("Discrepancy between use of the old and new config vocabulary.", Level.DEBUG);
200218
}
201219

202220
@Test
@@ -213,6 +231,7 @@ public void testGetPropertyValues_no_discrepancy() {
213231
var result = Configurations.getPropertyValues(m, subject, RDFS.LABEL, RDFS.COMMENT);
214232
assertThat(result).hasSize(2);
215233
assertNotLogged("Discrepancy between use of the old and new config vocabulary.", Level.WARN);
234+
assertNotLogged("Discrepancy between use of the old and new config vocabulary.", Level.DEBUG);
216235
}
217236

218237
@Test
@@ -229,6 +248,7 @@ public void testGetPropertyValues_useLegacy_no_discrepancy() {
229248
var result = Configurations.getPropertyValues(m, subject, RDFS.LABEL, RDFS.COMMENT);
230249
assertThat(result).hasSize(2);
231250
assertNotLogged("Discrepancy between use of the old and new config vocabulary.", Level.WARN);
251+
assertNotLogged("Discrepancy between use of the old and new config vocabulary.", Level.DEBUG);
232252
}
233253

234254
@Test

core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/values/QueryValueEvaluationStepSupplier.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private QueryValueEvaluationStepSupplier() {
5050
}
5151

5252
public static QueryValueEvaluationStep prepareStr(QueryValueEvaluationStep arg, ValueFactory valueFactory) {
53-
return make(arg, "Unkown constant argument for STR()", bs -> str(arg, valueFactory, bs));
53+
return make(arg, "Unknown constant argument for STR()", bs -> str(arg, valueFactory, bs));
5454
}
5555

5656
private static Value str(QueryValueEvaluationStep arg, ValueFactory valueFactory, BindingSet bindings) {
@@ -67,7 +67,7 @@ private static Value str(QueryValueEvaluationStep arg, ValueFactory valueFactory
6767
return valueFactory.createLiteral(literal.getLabel());
6868
}
6969
} else {
70-
throw new ValueExprEvaluationException("Unkown constant argument for STR()");
70+
throw new ValueExprEvaluationException("Unknown constant argument for STR()");
7171
}
7272
}
7373

core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/PeekMarkIterator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class PeekMarkIterator<E> implements CloseableIteration<E> {
3939

4040
private boolean closed;
4141

42-
PeekMarkIterator(CloseableIteration<E> iterator) {
42+
public PeekMarkIterator(CloseableIteration<E> iterator) {
4343
this.iterator = iterator;
4444
}
4545

core/queryresultio/binary/src/main/java/org/eclipse/rdf4j/query/resultio/binary/BinaryQueryResultParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ private void processError() throws IOException, QueryResultParseException {
227227
} else if (errTypeFlag == QUERY_EVALUATION_ERROR) {
228228
errType = QueryErrorType.QUERY_EVALUATION_ERROR;
229229
} else {
230-
throw new QueryResultParseException("Unkown error type: " + errTypeFlag);
230+
throw new QueryResultParseException("Unknown error type: " + errTypeFlag);
231231
}
232232

233233
String msg = readString();

core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailBaseConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ abstract class ShaclSailBaseConfiguration extends NotifyingSailWrapper {
2727
private static final Logger logger = LoggerFactory.getLogger(ShaclSailBaseConfiguration.class);
2828

2929
// Field used to control if the new SPARQL based validation should be enabled or disabled. Enabled by default.
30-
final boolean sparqlValidation;
30+
boolean sparqlValidation;
3131

3232
private boolean parallelValidation = ShaclSailConfig.PARALLEL_VALIDATION_DEFAULT;
3333
private boolean logValidationPlans = ShaclSailConfig.LOG_VALIDATION_PLANS_DEFAULT;
@@ -375,4 +375,5 @@ public Set<IRI> getShapesGraphs() {
375375
public void setShapesGraphs(Set<IRI> shapesGraphs) {
376376
this.shapesGraphs = shapesGraphs;
377377
}
378+
378379
}

core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShapeValidationContainer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,13 @@ public ValidationResultIterator performValidation() {
8282
validationResults = new ValidationResultIterator(iterator, effectiveValidationResultsLimitPerConstraint);
8383
return validationResults;
8484
} catch (Throwable e) {
85-
logger.warn("Error validating SHACL Shape {}", shape.getId(), e);
86-
logger.warn("Error validating SHACL Shape\n{}", shape, e);
85+
logger.warn("Internal error while trying to validate SHACL Shape {}", shape.getId(), e);
86+
logger.warn("Internal error while trying to validate SHACL Shape\n{}", shape, e);
8787
if (e instanceof Error) {
8888
throw e;
8989
}
90-
throw new SailException("Error validating SHACL Shape " + shape.getId() + "\n" + shape, e);
90+
throw new SailException(
91+
"Internal error while trying to validate SHACL Shape " + shape.getId() + "\n" + shape, e);
9192
} finally {
9293
handlePostLogging(before, validationResults);
9394
}

core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/SourceConstraintComponent.java

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,53 +16,53 @@
1616
import org.eclipse.rdf4j.model.vocabulary.SHACL;
1717

1818
public enum SourceConstraintComponent {
19-
MaxCountConstraintComponent(SHACL.MAX_COUNT_CONSTRAINT_COMPONENT, false),
20-
MinCountConstraintComponent(SHACL.MIN_COUNT_CONSTRAINT_COMPONENT, false),
21-
22-
DatatypeConstraintComponent(SHACL.DATATYPE_CONSTRAINT_COMPONENT, true),
23-
NodeKindConstraintComponent(SHACL.NODE_KIND_CONSTRAINT_COMPONENT, true),
24-
ClassConstraintComponent(SHACL.CLASS_CONSTRAINT_COMPONENT, true),
25-
26-
PatternConstraintComponent(SHACL.PATTERN_CONSTRAINT_COMPONENT, true),
27-
UniqueLangConstraintComponent(SHACL.UNIQUE_LANG_CONSTRAINT_COMPONENT, false),
28-
LanguageInConstraintComponent(SHACL.LANGUAGE_IN_CONSTRAINT_COMPONENT, true),
29-
MaxLengthConstraintComponent(SHACL.MAX_LENGTH_CONSTRAINT_COMPONENT, true),
30-
MinLengthConstraintComponent(SHACL.MIN_LENGTH_CONSTRAINT_COMPONENT, true),
31-
32-
InConstraintComponent(SHACL.IN_CONSTRAINT_COMPONENT, true),
33-
HasValueConstraintComponent(SHACL.HAS_VALUE_CONSTRAINT_COMPONENT, false),
34-
HasValueInConstraintComponent(DASH.HasValueInConstraintComponent, false),
35-
ClosedConstraintComponent(SHACL.CLOSED_CONSTRAINT_COMPONENT, true),
36-
37-
MinExclusiveConstraintComponent(SHACL.MIN_EXCLUSIVE_CONSTRAINT_COMPONENT, true),
38-
MaxExclusiveConstraintComponent(SHACL.MAX_EXCLUSIVE_CONSTRAINT_COMPONENT, true),
39-
MaxInclusiveConstraintComponent(SHACL.MAX_INCLUSIVE_CONSTRAINT_COMPONENT, true),
40-
MinInclusiveConstraintComponent(SHACL.MIN_INCLUSIVE_CONSTRAINT_COMPONENT, true),
41-
42-
AndConstraintComponent(SHACL.AND_CONSTRAINT_COMPONENT, true),
43-
OrConstraintComponent(SHACL.OR_CONSTRAINT_COMPONENT, true),
44-
NotConstraintComponent(SHACL.NOT_CONSTRAINT_COMPONENT, true),
45-
XoneConstraintComponent(SHACL.XONE_CONSTRAINT_COMPONENT, true),
46-
47-
DisjointConstraintComponent(SHACL.DISJOINT_CONSTRAINT_COMPONENT, true),
48-
EqualsConstraintComponent(SHACL.EQUALS_CONSTRAINT_COMPONENT, true),
49-
LessThanConstraintComponent(SHACL.LESS_THAN_CONSTRAINT_COMPONENT, true),
19+
MaxCountConstraintComponent(SHACL.MAX_COUNT_CONSTRAINT_COMPONENT, ProducesValidationResultValue.NEVER),
20+
MinCountConstraintComponent(SHACL.MIN_COUNT_CONSTRAINT_COMPONENT, ProducesValidationResultValue.NEVER),
21+
22+
DatatypeConstraintComponent(SHACL.DATATYPE_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
23+
NodeKindConstraintComponent(SHACL.NODE_KIND_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
24+
ClassConstraintComponent(SHACL.CLASS_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
25+
26+
PatternConstraintComponent(SHACL.PATTERN_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
27+
UniqueLangConstraintComponent(SHACL.UNIQUE_LANG_CONSTRAINT_COMPONENT, ProducesValidationResultValue.NEVER),
28+
LanguageInConstraintComponent(SHACL.LANGUAGE_IN_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
29+
MaxLengthConstraintComponent(SHACL.MAX_LENGTH_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
30+
MinLengthConstraintComponent(SHACL.MIN_LENGTH_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
31+
32+
InConstraintComponent(SHACL.IN_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
33+
HasValueConstraintComponent(SHACL.HAS_VALUE_CONSTRAINT_COMPONENT, ProducesValidationResultValue.NEVER),
34+
HasValueInConstraintComponent(DASH.HasValueInConstraintComponent, ProducesValidationResultValue.NEVER),
35+
ClosedConstraintComponent(SHACL.CLOSED_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
36+
37+
MinExclusiveConstraintComponent(SHACL.MIN_EXCLUSIVE_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
38+
MaxExclusiveConstraintComponent(SHACL.MAX_EXCLUSIVE_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
39+
MaxInclusiveConstraintComponent(SHACL.MAX_INCLUSIVE_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
40+
MinInclusiveConstraintComponent(SHACL.MIN_INCLUSIVE_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
41+
42+
AndConstraintComponent(SHACL.AND_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
43+
OrConstraintComponent(SHACL.OR_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
44+
NotConstraintComponent(SHACL.NOT_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
45+
XoneConstraintComponent(SHACL.XONE_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
46+
47+
DisjointConstraintComponent(SHACL.DISJOINT_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
48+
EqualsConstraintComponent(SHACL.EQUALS_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
49+
LessThanConstraintComponent(SHACL.LESS_THAN_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
5050
LessThanOrEqualsConstraintComponent(SHACL.LESS_THAN_OR_EQUALS_CONSTRAINT_COMPONENT,
51-
true),
51+
ProducesValidationResultValue.ALWAYS),
5252

5353
QualifiedMaxCountConstraintComponent(SHACL.QUALIFIED_MAX_COUNT_CONSTRAINT_COMPONENT,
54-
false),
54+
ProducesValidationResultValue.NEVER),
5555
QualifiedMinCountConstraintComponent(SHACL.QUALIFIED_MIN_COUNT_CONSTRAINT_COMPONENT,
56-
false),
57-
NodeConstraintComponent(SHACL.NODE_CONSTRAINT_COMPONENT, true),
58-
PropertyConstraintComponent(SHACL.PROPERTY_CONSTRAINT_COMPONENT, false),
56+
ProducesValidationResultValue.NEVER),
57+
NodeConstraintComponent(SHACL.NODE_CONSTRAINT_COMPONENT, ProducesValidationResultValue.ALWAYS),
58+
PropertyConstraintComponent(SHACL.PROPERTY_CONSTRAINT_COMPONENT, ProducesValidationResultValue.NEVER),
5959

60-
SPARQLConstraintComponent(SHACL.SPARQL_CONSTRAINT_COMPONENT, true);
60+
SPARQLConstraintComponent(SHACL.SPARQL_CONSTRAINT_COMPONENT, ProducesValidationResultValue.SOMETIMES);
6161

6262
private final IRI iri;
63-
private final boolean producesValidationResultValue;
63+
private final ProducesValidationResultValue producesValidationResultValue;
6464

65-
SourceConstraintComponent(IRI iri, boolean producesValidationResultValue) {
65+
SourceConstraintComponent(IRI iri, ProducesValidationResultValue producesValidationResultValue) {
6666
this.iri = iri;
6767
this.producesValidationResultValue = producesValidationResultValue;
6868
}
@@ -72,6 +72,16 @@ public IRI getIri() {
7272
}
7373

7474
public boolean producesValidationResultValue() {
75-
return producesValidationResultValue;
75+
return producesValidationResultValue != ProducesValidationResultValue.NEVER;
76+
}
77+
78+
public boolean alwaysProducesValidationResultValue() {
79+
return producesValidationResultValue == ProducesValidationResultValue.ALWAYS;
80+
}
81+
82+
private enum ProducesValidationResultValue {
83+
ALWAYS,
84+
NEVER,
85+
SOMETIMES
7686
}
7787
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public ValidationQuery(Collection<Namespace> namespaces, String query, List<Vari
8383
propertyShapeWithValue = false;
8484
valueIndex = variables.size();
8585
assert constraintComponent == null
86-
|| !constraintComponent.getConstraintComponent().producesValidationResultValue();
86+
|| !constraintComponent.getConstraintComponent().alwaysProducesValidationResultValue();
8787
}
8888
} else {
8989
targetIndex = variables.size() - 1;

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

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@
4747
import org.slf4j.Logger;
4848
import org.slf4j.LoggerFactory;
4949

50-
public abstract class SimpleAbstractConstraintComponent extends AbstractConstraintComponent {
50+
public abstract class AbstractSimpleConstraintComponent extends AbstractConstraintComponent {
5151

52-
private static final Logger logger = LoggerFactory.getLogger(SimpleAbstractConstraintComponent.class);
52+
private static final Logger logger = LoggerFactory.getLogger(AbstractSimpleConstraintComponent.class);
5353

5454
private Resource id;
5555
TargetChain targetChain;
5656

57-
public SimpleAbstractConstraintComponent(Resource id) {
57+
public AbstractSimpleConstraintComponent(Resource id) {
5858
this.id = id;
5959
}
6060

61-
public SimpleAbstractConstraintComponent() {
61+
public AbstractSimpleConstraintComponent() {
6262

6363
}
6464

@@ -159,15 +159,24 @@ private PlanNode getPlanNodeForOverrideTargetNode(ConnectionsGroup connectionsGr
159159
validationSettings.getDataGraph(), scope);
160160
allTargets = getFilterAttacherWithNegation(negatePlan, allTargets);
161161

162-
return Unique.getInstance(allTargets, true);
162+
if (effectiveTarget.size() > 1) {
163+
allTargets = Unique.getInstance(allTargets, true);
164+
}
165+
return allTargets;
163166
} else {
164-
return effectiveTarget.extend(overrideTargetPlanNode, connectionsGroup,
167+
PlanNode extend = effectiveTarget.extend(overrideTargetPlanNode, connectionsGroup,
165168
validationSettings.getDataGraph(), scope,
166169
EffectiveTarget.Extend.right,
167170
false,
168171
p -> getFilterAttacherWithNegation(negatePlan, p)
169172
);
170173

174+
if (effectiveTarget.size() > 1) {
175+
extend = Unique.getInstance(extend, true);
176+
}
177+
178+
return extend;
179+
171180
}
172181

173182
} else {
@@ -184,14 +193,22 @@ private PlanNode getPlanNodeForOverrideTargetNode(ConnectionsGroup connectionsGr
184193

185194
allTargets = getFilterAttacherWithNegation(negatePlan, allTargets);
186195

187-
return Unique.getInstance(allTargets, true);
196+
if (effectiveTarget.size() > 1) {
197+
allTargets = Unique.getInstance(allTargets, true);
198+
}
199+
200+
return allTargets;
188201

189202
} else {
190203

191204
overrideTargetPlanNode = effectiveTarget.extend(overrideTargetPlanNode, connectionsGroup,
192205
validationSettings.getDataGraph(), scope,
193206
EffectiveTarget.Extend.right, false, null);
194207

208+
if (effectiveTarget.size() > 1) {
209+
overrideTargetPlanNode = Unique.getInstance(overrideTargetPlanNode, true);
210+
}
211+
195212
planNode = new BulkedExternalInnerJoin(overrideTargetPlanNode,
196213
connectionsGroup.getBaseConnection(),
197214
validationSettings.getDataGraph(), path.get()
@@ -314,13 +331,25 @@ String literalToString(Literal literal) {
314331
@Override
315332
public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, Resource[] dataGraph, Scope scope,
316333
StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider) {
334+
317335
if (scope == Scope.propertyShape) {
318-
PlanNode allTargetsPlan = getTargetChain()
319-
.getEffectiveTarget(Scope.nodeShape, connectionsGroup.getRdfsSubClassOfReasoner(),
320-
stableRandomVariableProvider)
321-
.getPlanNode(connectionsGroup, dataGraph, Scope.nodeShape, true, null);
322336

323-
return Unique.getInstance(new ShiftToPropertyShape(allTargetsPlan), true);
337+
EffectiveTarget effectiveTarget = getTargetChain()
338+
.getEffectiveTarget(
339+
Scope.nodeShape,
340+
connectionsGroup.getRdfsSubClassOfReasoner(),
341+
stableRandomVariableProvider
342+
);
343+
344+
PlanNode allTargetsPlan = effectiveTarget
345+
.getPlanNode(
346+
connectionsGroup,
347+
dataGraph, Scope.nodeShape,
348+
true,
349+
null
350+
);
351+
352+
return Unique.getInstance(new ShiftToPropertyShape(allTargetsPlan), effectiveTarget.size() > 1);
324353
}
325354
return EmptyNode.getInstance();
326355
}

0 commit comments

Comments
 (0)