-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
2,089 additions
and
27 deletions.
There are no files selected for viewing
463 changes: 456 additions & 7 deletions
463
core/model-vocabulary/src/main/java/org/eclipse/rdf4j/model/vocabulary/GEO.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...federation/src/main/java/org/eclipse/rdf4j/federated/algebra/FedXArbitraryLengthPath.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 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.federated.algebra; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.rdf4j.federated.structures.QueryInfo; | ||
import org.eclipse.rdf4j.federated.util.QueryAlgebraUtil; | ||
import org.eclipse.rdf4j.query.algebra.ArbitraryLengthPath; | ||
import org.eclipse.rdf4j.query.algebra.Var; | ||
|
||
/** | ||
* A specialization of {@link ArbitraryLengthPath} to maintain the {@link QueryInfo} | ||
* | ||
* @author Andreas Schwarte | ||
*/ | ||
public class FedXArbitraryLengthPath extends ArbitraryLengthPath implements FedXTupleExpr { | ||
|
||
private static final long serialVersionUID = -7512248084095130084L; | ||
|
||
private final QueryInfo queryInfo; | ||
|
||
public FedXArbitraryLengthPath(ArbitraryLengthPath path, QueryInfo queryInfo) { | ||
super(path.getScope(), clone(path.getSubjectVar()), path.getPathExpression(), clone(path.getObjectVar()), | ||
clone(path.getContextVar()), path.getMinLength()); | ||
this.queryInfo = queryInfo; | ||
} | ||
|
||
private static Var clone(Var var) { | ||
if (var == null) { | ||
return null; | ||
} | ||
return var.clone(); | ||
} | ||
|
||
@Override | ||
public List<String> getFreeVars() { | ||
return List.copyOf(QueryAlgebraUtil.getFreeVars(getPathExpression())); | ||
} | ||
|
||
@Override | ||
public QueryInfo getQueryInfo() { | ||
return queryInfo; | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
tools/federation/src/main/java/org/eclipse/rdf4j/federated/algebra/FedXZeroLengthPath.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 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.federated.algebra; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.rdf4j.federated.structures.QueryInfo; | ||
import org.eclipse.rdf4j.query.algebra.StatementPattern.Scope; | ||
import org.eclipse.rdf4j.query.algebra.Var; | ||
import org.eclipse.rdf4j.query.algebra.ZeroLengthPath; | ||
|
||
/** | ||
* A specialization of {@link ZeroLengthPath} that keeps track of {@link QueryInfo} and statement sources. | ||
* | ||
* @author Andreas Schwarte | ||
*/ | ||
public class FedXZeroLengthPath extends ZeroLengthPath implements QueryRef { | ||
|
||
private static final long serialVersionUID = 2241037911187178861L; | ||
|
||
private final QueryInfo queryInfo; | ||
|
||
private final List<StatementSource> statementSources; | ||
|
||
public FedXZeroLengthPath(Scope scope, Var subjVar, Var objVar, Var conVar, QueryInfo queryInfo, | ||
List<StatementSource> statementSources) { | ||
super(scope, subjVar, objVar, conVar); | ||
this.queryInfo = queryInfo; | ||
this.statementSources = statementSources; | ||
} | ||
|
||
public List<StatementSource> getStatementSources() { | ||
return statementSources; | ||
} | ||
|
||
@Override | ||
public QueryInfo getQueryInfo() { | ||
return queryInfo; | ||
} | ||
|
||
} |
52 changes: 52 additions & 0 deletions
52
tools/federation/src/main/java/org/eclipse/rdf4j/federated/algebra/HolderNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 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.federated.algebra; | ||
|
||
import org.eclipse.rdf4j.query.algebra.AbstractQueryModelNode; | ||
import org.eclipse.rdf4j.query.algebra.QueryModelNode; | ||
import org.eclipse.rdf4j.query.algebra.QueryModelVisitor; | ||
|
||
/** | ||
* An artificial holder node serving as parent holder to allow replacement. | ||
*/ | ||
public class HolderNode extends AbstractQueryModelNode { | ||
|
||
private static final long serialVersionUID = -4689963986499825771L; | ||
private QueryModelNode child; | ||
|
||
public HolderNode(QueryModelNode child) { | ||
super(); | ||
setChild(child); | ||
} | ||
|
||
public void setChild(QueryModelNode child) { | ||
this.child = child; | ||
this.child.setParentNode(this); | ||
} | ||
|
||
@Override | ||
public <X extends Exception> void visitChildren(QueryModelVisitor<X> visitor) throws X { | ||
child.visit(visitor); | ||
} | ||
|
||
@Override | ||
public <X extends Exception> void visit(QueryModelVisitor<X> visitor) throws X { | ||
visitor.meetOther(this); | ||
} | ||
|
||
@Override | ||
public void replaceChildNode(QueryModelNode current, QueryModelNode replacement) { | ||
if (child.equals(current)) { | ||
setChild(replacement); | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.