Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
373 commits
Select commit Hold shift + click to select a range
3f4923b
starting proper IR
hmottestad Aug 25, 2025
20dfd1a
starting proper IR
hmottestad Aug 25, 2025
473891a
starting proper IR
hmottestad Aug 25, 2025
1f7784a
starting proper IR
hmottestad Aug 25, 2025
c42257f
starting proper IR
hmottestad Aug 25, 2025
65ea6ec
starting proper IR
hmottestad Aug 25, 2025
fc9dc7a
starting proper IR
hmottestad Aug 25, 2025
2ab33f2
starting proper IR
hmottestad Aug 25, 2025
568d9ba
starting proper IR
hmottestad Aug 25, 2025
aabaf0f
starting proper IR
hmottestad Aug 25, 2025
2ca4cfe
starting proper IR
hmottestad Aug 25, 2025
9c4b10c
starting proper IR
hmottestad Aug 26, 2025
2f71f52
starting proper IR
hmottestad Aug 26, 2025
97c9e11
starting proper IR
hmottestad Aug 26, 2025
4bf4965
starting proper IR
hmottestad Aug 26, 2025
a518fef
starting proper IR
hmottestad Aug 26, 2025
cd0e7c7
starting proper IR
hmottestad Aug 26, 2025
fc65132
starting proper IR
hmottestad Aug 26, 2025
a7a61dd
starting proper IR
hmottestad Aug 26, 2025
02149b4
starting proper IR
hmottestad Aug 26, 2025
cc197e1
starting proper IR
hmottestad Aug 26, 2025
0722879
starting proper IR
hmottestad Aug 26, 2025
d64221c
starting proper IR
hmottestad Aug 26, 2025
7be5b98
starting proper IR
hmottestad Aug 26, 2025
09d16dc
starting proper IR
hmottestad Aug 26, 2025
a1b72dc
starting proper IR
hmottestad Aug 26, 2025
13cd2b6
starting proper IR
hmottestad Aug 26, 2025
2a52f3c
starting proper IR
hmottestad Aug 26, 2025
d8d4590
starting proper IR
hmottestad Aug 26, 2025
8ba36e7
starting proper IR
hmottestad Aug 26, 2025
859caf3
starting proper IR
hmottestad Aug 26, 2025
7d99140
starting proper IR
hmottestad Aug 26, 2025
81e4b2c
starting proper IR
hmottestad Aug 26, 2025
804b1e8
starting proper IR
hmottestad Aug 26, 2025
982df9d
starting proper IR
hmottestad Aug 26, 2025
6b63c99
starting proper IR
hmottestad Aug 26, 2025
c566861
starting proper IR
hmottestad Aug 26, 2025
7783d3e
starting proper IR
hmottestad Aug 26, 2025
be5f1b0
starting proper IR
hmottestad Aug 26, 2025
0bffb14
starting proper IR
hmottestad Aug 26, 2025
8708f7c
starting proper IR
hmottestad Aug 26, 2025
c12c5ce
starting proper IR
hmottestad Aug 26, 2025
22eb26a
starting proper IR
hmottestad Aug 26, 2025
e74be8e
starting proper IR
hmottestad Aug 26, 2025
a51cda6
starting proper IR
hmottestad Aug 26, 2025
935a3ae
starting proper IR
hmottestad Aug 26, 2025
3f59f55
starting proper IR
hmottestad Aug 26, 2025
ff41207
starting proper IR
hmottestad Aug 26, 2025
0554e11
starting proper IR
hmottestad Aug 26, 2025
9cfa928
starting proper IR
hmottestad Aug 27, 2025
ca08fdd
starting proper IR
hmottestad Aug 27, 2025
f6fd98f
starting proper IR
hmottestad Aug 27, 2025
a6e3103
starting proper IR
hmottestad Aug 27, 2025
ade513a
starting proper IR
hmottestad Aug 27, 2025
905add6
starting proper IR
hmottestad Aug 27, 2025
2d11062
starting proper IR
hmottestad Aug 27, 2025
211a0a3
starting proper IR
hmottestad Aug 27, 2025
a9abd6c
starting proper IR
hmottestad Aug 27, 2025
442e213
starting proper IR
hmottestad Aug 27, 2025
29b5854
starting proper IR
hmottestad Aug 27, 2025
033bfd5
starting proper IR
hmottestad Aug 27, 2025
f8f79eb
starting proper IR
hmottestad Aug 27, 2025
9f91654
starting proper IR
hmottestad Aug 27, 2025
c78d24d
starting proper IR
hmottestad Aug 27, 2025
e0408f7
starting proper IR
hmottestad Aug 27, 2025
9d85d8d
starting proper IR
hmottestad Aug 27, 2025
cc10f7e
starting proper IR
hmottestad Aug 27, 2025
da4ef8d
starting proper IR
hmottestad Aug 27, 2025
22b0285
starting proper IR
hmottestad Aug 27, 2025
f87729c
starting proper IR
hmottestad Aug 28, 2025
ac45348
starting proper IR
hmottestad Aug 28, 2025
d929cb3
starting proper IR
hmottestad Aug 28, 2025
b1fdb15
starting proper IR
hmottestad Aug 28, 2025
98b3d62
starting proper IR
hmottestad Aug 28, 2025
9ca55c1
adjusted agents.md
hmottestad Aug 29, 2025
7be81fb
wip
hmottestad Aug 29, 2025
bc5c278
wip
hmottestad Aug 29, 2025
b96bdca
wip
hmottestad Aug 29, 2025
d965141
wip
hmottestad Aug 29, 2025
4c2c318
wip
hmottestad Aug 29, 2025
98e8a66
wip
hmottestad Aug 29, 2025
0ed1c92
wip
hmottestad Aug 29, 2025
b0eeeef
wip
hmottestad Aug 29, 2025
0b39894
wip
hmottestad Aug 29, 2025
f8a9618
wip
hmottestad Aug 29, 2025
345e38e
wip
hmottestad Aug 29, 2025
efd4d61
wip
hmottestad Aug 29, 2025
e630ad2
wip
hmottestad Aug 29, 2025
0a9bee2
wip
hmottestad Aug 29, 2025
9a6ce09
wip
hmottestad Aug 29, 2025
3c79be0
wip
hmottestad Aug 29, 2025
f31914e
wip
hmottestad Aug 29, 2025
eded5e3
wip
hmottestad Aug 30, 2025
b2e46a9
wip
hmottestad Aug 30, 2025
861a8ab
wip
hmottestad Aug 30, 2025
b34d86c
wip
hmottestad Aug 30, 2025
54b7d0a
wip
hmottestad Aug 30, 2025
b598b45
wip
hmottestad Aug 30, 2025
23d05b2
wip
hmottestad Aug 30, 2025
a17d815
wip
hmottestad Aug 30, 2025
de37ad1
wip
hmottestad Aug 30, 2025
c78e329
wip
hmottestad Aug 30, 2025
52eeb0f
wip
hmottestad Aug 30, 2025
218ebf6
wip
hmottestad Aug 30, 2025
0c1f37e
wip
hmottestad Aug 30, 2025
49fcdcf
wip
hmottestad Aug 30, 2025
972fea2
wip
hmottestad Aug 30, 2025
5a0c887
wip
hmottestad Aug 30, 2025
1b7805c
wip
hmottestad Aug 30, 2025
13ae420
wip
hmottestad Aug 30, 2025
d37950d
wip
hmottestad Aug 30, 2025
9120ab0
wip
hmottestad Aug 31, 2025
ef6a883
wip
hmottestad Aug 31, 2025
dd772df
wip
hmottestad Aug 31, 2025
540b9ff
wip
hmottestad Aug 31, 2025
ad5f7db
wip
hmottestad Aug 31, 2025
c5be9ab
wip
hmottestad Aug 31, 2025
c737a4b
wip
hmottestad Aug 31, 2025
4110b00
wip
hmottestad Aug 31, 2025
ee6f2c3
wip
hmottestad Aug 31, 2025
f671706
wip
hmottestad Aug 31, 2025
c5347b0
wip
hmottestad Aug 31, 2025
e83c0e0
wip
hmottestad Aug 31, 2025
faa3ca0
wip
hmottestad Aug 31, 2025
f5b9a75
wip
hmottestad Aug 31, 2025
b03a90c
wip
hmottestad Aug 31, 2025
aa152b1
wip
hmottestad Aug 31, 2025
805a9bf
wip
hmottestad Aug 31, 2025
e92b8bc
wip
hmottestad Aug 31, 2025
ebc9b3f
wip
hmottestad Aug 31, 2025
5b3d014
wip
hmottestad Aug 31, 2025
97cbb4d
wip
hmottestad Aug 31, 2025
76e60be
wip
hmottestad Aug 31, 2025
6745d84
wip
hmottestad Aug 31, 2025
4bde8d2
wip
hmottestad Aug 31, 2025
eb748d2
wip
hmottestad Aug 31, 2025
4a3795a
wip
hmottestad Aug 31, 2025
cabf29e
wip
hmottestad Aug 31, 2025
bb6cd7e
wip
hmottestad Aug 31, 2025
25b0c4c
wip
hmottestad Sep 1, 2025
c9ee049
wip
hmottestad Sep 1, 2025
97f469a
wip
hmottestad Sep 1, 2025
e8e452f
wip
hmottestad Sep 1, 2025
05082c5
wip
hmottestad Sep 1, 2025
d4fbb5e
wip
hmottestad Sep 1, 2025
f8078f3
wip
hmottestad Sep 1, 2025
1919ef3
wip
hmottestad Sep 1, 2025
e22cd7b
wip
hmottestad Sep 1, 2025
dd95a8c
wip
hmottestad Sep 1, 2025
8a31029
wip
hmottestad Sep 1, 2025
bf5b884
wip
hmottestad Sep 1, 2025
f7657c5
wip
hmottestad Sep 1, 2025
7091e28
wip
hmottestad Sep 1, 2025
a4db189
wip
hmottestad Sep 1, 2025
c73b452
wip
hmottestad Sep 2, 2025
a478999
wip
hmottestad Sep 2, 2025
444b1b5
wip
hmottestad Sep 2, 2025
8e34d25
wip
hmottestad Sep 3, 2025
dca9554
wip
hmottestad Sep 3, 2025
a415859
wip
hmottestad Sep 3, 2025
fc7122d
wip
hmottestad Sep 3, 2025
d78b4fb
wip
hmottestad Sep 3, 2025
df563ca
wip
hmottestad Sep 3, 2025
c229f28
wip
hmottestad Sep 3, 2025
f5d7a13
wip
hmottestad Sep 4, 2025
dc6650b
wip
hmottestad Sep 4, 2025
39825d8
wip
hmottestad Sep 5, 2025
2ec47df
wip
hmottestad Sep 5, 2025
9964b53
fixed tests
hmottestad Sep 5, 2025
7480c9b
wip
hmottestad Sep 5, 2025
ec258d3
wip
hmottestad Sep 6, 2025
531564c
fix scope of union
hmottestad Sep 7, 2025
d1d236c
fix scope of union
hmottestad Sep 7, 2025
4a87c02
wip
hmottestad Sep 8, 2025
392a45e
wip
hmottestad Sep 8, 2025
3b9f9fe
wip
hmottestad Sep 8, 2025
50dc1ec
wip
hmottestad Sep 8, 2025
47403a5
wip
hmottestad Sep 8, 2025
a0024a7
wip
hmottestad Sep 8, 2025
a18e6ca
wip
hmottestad Sep 9, 2025
96f7369
wip
hmottestad Sep 9, 2025
4319bf9
wip
hmottestad Sep 9, 2025
b504f0f
wip
hmottestad Sep 9, 2025
04a14ab
wip
hmottestad Sep 9, 2025
05e009e
wip
hmottestad Sep 9, 2025
7b4942d
wip
hmottestad Sep 9, 2025
66a252e
wip
hmottestad Sep 9, 2025
92affb7
wip
hmottestad Sep 9, 2025
067ff42
wip
hmottestad Sep 9, 2025
5dae593
wip
hmottestad Sep 9, 2025
1421cee
wip
hmottestad Sep 9, 2025
ae877fa
wip
hmottestad Sep 9, 2025
d0828b5
wip
hmottestad Sep 9, 2025
343a6ce
wip
hmottestad Sep 9, 2025
c8ad86d
wip
hmottestad Sep 9, 2025
b2d0150
wip
hmottestad Sep 9, 2025
5223ce8
wip
hmottestad Sep 9, 2025
0700c7d
wip
hmottestad Sep 9, 2025
fb9de5f
codex asked to simplify code
hmottestad Sep 9, 2025
d897d5d
codex asked to simplify code
hmottestad Sep 9, 2025
5a57262
codex asked to simplify code
hmottestad Sep 9, 2025
d8cd8a1
codex asked to simplify code
hmottestad Sep 9, 2025
d990cdd
codex asked to simplify code
hmottestad Sep 9, 2025
ad8ac26
codex asked to simplify code
hmottestad Sep 9, 2025
e8ee09e
codex asked to simplify code
hmottestad Sep 9, 2025
5d64500
codex asked to simplify code
hmottestad Sep 9, 2025
63535fc
codex asked to simplify code
hmottestad Sep 9, 2025
55dfa27
codex asked to simplify code
hmottestad Sep 9, 2025
46bd4f2
codex asked to simplify code
hmottestad Sep 9, 2025
8616636
codex asked to simplify code
hmottestad Sep 10, 2025
0c8430c
codex asked to simplify code
hmottestad Sep 10, 2025
5463bb2
codex asked to simplify code
hmottestad Sep 10, 2025
7ecc72e
fix bugs
hmottestad Sep 10, 2025
be2667c
codex cli simplifying code
hmottestad Sep 10, 2025
b1a8f15
codex cli simplifying code
hmottestad Sep 10, 2025
57a3d87
codex cli simplifying code
hmottestad Sep 10, 2025
283860b
codex cli simplifying code
hmottestad Sep 10, 2025
f283931
codex cli simplifying code
hmottestad Sep 10, 2025
477ffd5
codex cli simplifying code
hmottestad Sep 10, 2025
6cdad45
codex cli simplifying code
hmottestad Sep 10, 2025
1dd8a30
codex cli simplifying code
hmottestad Sep 10, 2025
a9f3628
codex cli simplifying code
hmottestad Sep 10, 2025
59f3a72
codex cli simplifying code
hmottestad Sep 10, 2025
4cb0bf2
codex cli simplifying code
hmottestad Sep 10, 2025
27b6bed
codex cli simplifying code
hmottestad Sep 10, 2025
2b6ed5d
codex cli simplifying code
hmottestad Sep 10, 2025
c2e178a
codex cli simplifying code
hmottestad Sep 10, 2025
0b80904
codex cli simplifying code
hmottestad Sep 10, 2025
b59360f
codex cli simplifying code
hmottestad Sep 10, 2025
8c3b5d8
codex cli simplifying code
hmottestad Sep 10, 2025
afb6b87
codex cli simplifying code
hmottestad Sep 10, 2025
ddd5241
codex cli simplifying code
hmottestad Sep 11, 2025
1bf8aea
codex cli simplifying code
hmottestad Sep 11, 2025
0074c66
codex cli simplifying code
hmottestad Sep 11, 2025
dbef845
codex cli simplifying code
hmottestad Sep 11, 2025
72820d0
codex cli simplifying code
hmottestad Sep 12, 2025
c1ef83d
codex cli simplifying code
hmottestad Sep 12, 2025
0a7a415
codex cli simplifying code
hmottestad Sep 12, 2025
78a19c3
codex cli simplifying code
hmottestad Sep 12, 2025
17ac797
codex cli simplifying code
hmottestad Sep 12, 2025
1455239
wip
hmottestad Sep 13, 2025
9d90e14
wip
hmottestad Sep 13, 2025
d1cb1ba
code cleanup
hmottestad Oct 3, 2025
2611c8c
code cleanup
hmottestad Oct 3, 2025
8c9b7ff
code cleanup
hmottestad Oct 3, 2025
cb90812
code cleanup
hmottestad Oct 3, 2025
2ae7483
code cleanup
hmottestad Oct 3, 2025
b0bf566
code cleanup
hmottestad Oct 3, 2025
e94fce9
code cleanup
hmottestad Oct 3, 2025
107b182
more configs
hmottestad Oct 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ e2e/node_modules
e2e/playwright-report
e2e/test-results
.aider*
/.m2/

722 changes: 721 additions & 1 deletion AGENTS.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ public class SimpleValueFactory extends AbstractValueFactory {
private final static String uniqueIdPrefix = UUID.randomUUID().toString().replace("-", "");
private final static AtomicLong uniqueIdSuffix = new AtomicLong();

// Pre-built strings for lengths 0 through 9
private static final String[] RANDOMIZE_LENGTH = new String[10];

static {
StringBuilder sb = new StringBuilder();
for (int i = 0; i <= 9; i++) {
RANDOMIZE_LENGTH[i] = sb.toString();
sb.append(i);
}
}

private static final DatatypeFactory datatypeFactory;

static {
Expand Down Expand Up @@ -130,7 +141,12 @@ public Triple createTriple(Resource subject, IRI predicate, Value object) {

@Override
public BNode createBNode() {
return createBNode(uniqueIdPrefix + uniqueIdSuffix.incrementAndGet());
long l = uniqueIdSuffix.incrementAndGet();
// reverse the string representation of the long to ensure that the BNode IDs are not monotonically increasing
StringBuilder sb = new StringBuilder(Long.toString(l));
sb.reverse();
sb.append(uniqueIdPrefix).append(RANDOMIZE_LENGTH[(int) (Math.abs(l % RANDOMIZE_LENGTH.length))]);
return createBNode(sb.toString());
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*******************************************************************************
* Copyright (c) 2025 Eclipse RDF4J contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Distribution License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*******************************************************************************/

package org.eclipse.rdf4j.model.impl;

import static org.junit.jupiter.api.Assertions.assertThrows;

import java.lang.reflect.Field;
import java.util.concurrent.atomic.AtomicLong;

import org.junit.jupiter.api.Test;

/**
* Reproduces overflow in SimpleValueFactory#createBNode() when the atomic counter wraps to Long.MIN_VALUE, which
* results in a negative index into the RANDOMIZE_LENGTH array and throws ArrayIndexOutOfBoundsException.
*/
public class SimpleValueFactoryOverflowTest {

@Test
void overflowAtMinValue() throws Exception {
// Access the private static counter
Field f = SimpleValueFactory.class.getDeclaredField("uniqueIdSuffix");
f.setAccessible(true);
AtomicLong counter = (AtomicLong) f.get(null);

// Preserve original value to avoid leaking state across tests
long original = counter.get();

synchronized (SimpleValueFactory.class) {
try {
// Force next increment to wrap from Long.MAX_VALUE to Long.MIN_VALUE
counter.set(Long.MAX_VALUE);

SimpleValueFactory.getInstance().createBNode();
} finally {
// Restore the original value
counter.set(original);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
@Experimental
public interface Explanation {

Object tupleExpr();

/**
* The different levels that the query explanation can be at.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,23 @@
public class ExplanationImpl implements Explanation {

private final GenericPlanNode genericPlanNode;
private final Object tupleExpr;

public ExplanationImpl(GenericPlanNode genericPlanNode, boolean timedOut) {
public ExplanationImpl(GenericPlanNode genericPlanNode, boolean timedOut, Object tupleExpr) {
this.genericPlanNode = genericPlanNode;
this.tupleExpr = tupleExpr;
if (timedOut) {
genericPlanNode.setTimedOut(timedOut);
}
}

ObjectMapper objectMapper = new ObjectMapper();

@Override
public Object tupleExpr() {
return tupleExpr;
}

@Override
public GenericPlanNode toGenericPlanNode() {
return genericPlanNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
package org.eclipse.rdf4j.query.algebra.evaluation;

import java.util.Comparator;
import java.util.EnumSet;
import java.util.Set;

import org.eclipse.rdf4j.common.annotation.Experimental;
Expand All @@ -22,7 +21,6 @@
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Resource;
import org.eclipse.rdf4j.model.Statement;
import org.eclipse.rdf4j.model.Triple;
import org.eclipse.rdf4j.model.Value;
import org.eclipse.rdf4j.model.ValueFactory;
import org.eclipse.rdf4j.query.QueryEvaluationException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public void meet(Var node) throws QueryEvaluationException {
// We can skip constants that are only used in StatementPatterns since these are never added to the
// BindingSet anyway
if (!(node.isConstant() && node.getParentNode() instanceof StatementPattern)) {
Var replacement = new Var(varNames.computeIfAbsent(node.getName(), k -> k), node.getValue(),
Var replacement = Var.of(varNames.computeIfAbsent(node.getName(), k -> k), node.getValue(),
node.isAnonymous(), node.isConstant());
node.replaceWith(replacement);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1232,8 +1232,32 @@ protected QueryValueEvaluationStep prepare(Coalesce node, QueryEvaluationContext

protected QueryValueEvaluationStep prepare(Compare node, QueryEvaluationContext context) {
boolean strict = QueryEvaluationMode.STRICT == getQueryEvaluationMode();
return supplyBinaryValueEvaluation(node, (leftVal, rightVal) -> BooleanLiteral
.valueOf(QueryEvaluationUtil.compare(leftVal, rightVal, node.getOperator(), strict)), context);

Compare.CompareOp operator = node.getOperator();
switch (operator) {
case EQ:
return supplyBinaryValueEvaluation(node, (leftVal, rightVal) -> BooleanLiteral
.valueOf(QueryEvaluationUtil.compareEQ(leftVal, rightVal, strict)), context);
case NE:
return supplyBinaryValueEvaluation(node, (leftVal, rightVal) -> BooleanLiteral
.valueOf(QueryEvaluationUtil.compareNE(leftVal, rightVal, strict)), context);
case LT:
return supplyBinaryValueEvaluation(node, (leftVal, rightVal) -> BooleanLiteral
.valueOf(QueryEvaluationUtil.compareLT(leftVal, rightVal, strict)), context);
case LE:
return supplyBinaryValueEvaluation(node, (leftVal, rightVal) -> BooleanLiteral
.valueOf(QueryEvaluationUtil.compareLE(leftVal, rightVal, strict)), context);
case GE:
return supplyBinaryValueEvaluation(node, (leftVal, rightVal) -> BooleanLiteral
.valueOf(QueryEvaluationUtil.compareGE(leftVal, rightVal, strict)), context);
case GT:
return supplyBinaryValueEvaluation(node, (leftVal, rightVal) -> BooleanLiteral
.valueOf(QueryEvaluationUtil.compareGT(leftVal, rightVal, strict)), context);
default:
return supplyBinaryValueEvaluation(node, (leftVal, rightVal) -> BooleanLiteral
.valueOf(QueryEvaluationUtil.compare(leftVal, rightVal, node.getOperator(), strict)), context);
}

}

private BiFunction<Value, Value, Value> mathOperationApplier(MathExpr node,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ public class EvaluationStatistics {
private final static String uniqueIdPrefix = UUID.randomUUID().toString().replace("-", "");
private final static AtomicLong uniqueIdSuffix = new AtomicLong();

// Pre-built strings for lengths 0 through 9
private static final String[] RANDOMIZE_LENGTH = new String[10];
static {
StringBuilder sb = new StringBuilder();
for (int i = 0; i <= 9; i++) {
RANDOMIZE_LENGTH[i] = sb.toString();
sb.append(i);
}
}

private CardinalityCalculator calculator;

public double getCardinality(TupleExpr expr) {
Expand All @@ -66,6 +76,10 @@ protected CardinalityCalculator createCardinalityCalculator() {
return new CardinalityCalculator();
}

public boolean supportsJoinEstimation() {
return false;
}

/*-----------------------------------*
* Inner class CardinalityCalculator *
*-----------------------------------*/
Expand Down Expand Up @@ -117,7 +131,11 @@ public void meet(ZeroLengthPath node) {

@Override
public void meet(ArbitraryLengthPath node) {
final Var pathVar = new Var("_anon_" + uniqueIdPrefix + uniqueIdSuffix.incrementAndGet(), true);
long suffix = uniqueIdSuffix.getAndIncrement();
final Var pathVar = Var.of(
"_anon_path_" + uniqueIdPrefix + suffix
+ RANDOMIZE_LENGTH[(int) (Math.abs(suffix % RANDOMIZE_LENGTH.length))],
true);
// cardinality of ALP is determined based on the cost of a
// single ?s ?p ?o ?c pattern where ?p is unbound, compensating for the fact that
// the length of the path is unknown but expected to be _at least_ twice that of a normal
Expand Down
Loading