Class ContextCollector
- java.lang.Object
-
- org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor<java.lang.Exception>
-
- org.eclipse.rdf4j.queryrender.sparql.ContextCollector
-
- All Implemented Interfaces:
QueryModelVisitor<java.lang.Exception>
public class ContextCollector extends AbstractQueryModelVisitor<java.lang.Exception>
Visitor implementation for the query algebra which walks the tree and figures out the context for nodes in the algebra. The context for a node is set on the highest node in the tree. That is, everything below it shares the same context.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ContextCollector()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
binaryOpMeet(TupleExpr theCurrentExpr, TupleExpr theLeftExpr, TupleExpr theRightExpr)
(package private) static java.util.Map<TupleExpr,Var>
collectContexts(TupleExpr theTupleExpr)
private boolean
isSameCtx(Var v1, Var v2)
void
meet(Difference theOp)
void
meet(Filter theFilter)
void
meet(Intersection theOp)
void
meet(Join theJoin)
void
meet(LeftJoin theJoin)
void
meet(StatementPattern thePattern)
void
meet(Union theOp)
private void
sameCtxCheck(TupleExpr theCurrentExpr, TupleExpr theLeftExpr, Var theLeftCtx, TupleExpr theRightExpr, Var theRightCtx)
-
Methods inherited from class org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor
meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meetBinaryTupleOperator, meetBinaryValueOperator, meetCompareSubQueryValueOperator, meetNAryValueOperator, meetNode, meetOther, meetSubQueryValueOperator, meetUnaryTupleOperator, meetUnaryValueOperator, meetUpdateExpr
-
-
-
-
Field Detail
-
mContexts
private final java.util.Map<TupleExpr,Var> mContexts
Maps TupleExpr to contexts. This map contains only top-level expression elements that share the given context (i.e., all elements below share the same context) -- this is because of where contexts are being introduced into a SPARQL query -- all elements sharing the same contexts are grouped together with a "GRAPH{ ... }" clause.
-
-
Method Detail
-
collectContexts
static java.util.Map<TupleExpr,Var> collectContexts(TupleExpr theTupleExpr) throws java.lang.Exception
- Throws:
java.lang.Exception
-
meet
public void meet(Join theJoin) throws java.lang.Exception
- Specified by:
meet
in interfaceQueryModelVisitor<java.lang.Exception>
- Overrides:
meet
in classAbstractQueryModelVisitor<java.lang.Exception>
- Throws:
java.lang.Exception
-
meet
public void meet(LeftJoin theJoin) throws java.lang.Exception
- Specified by:
meet
in interfaceQueryModelVisitor<java.lang.Exception>
- Overrides:
meet
in classAbstractQueryModelVisitor<java.lang.Exception>
- Throws:
java.lang.Exception
-
meet
public void meet(Union theOp) throws java.lang.Exception
- Specified by:
meet
in interfaceQueryModelVisitor<java.lang.Exception>
- Overrides:
meet
in classAbstractQueryModelVisitor<java.lang.Exception>
- Throws:
java.lang.Exception
-
meet
public void meet(Difference theOp) throws java.lang.Exception
- Specified by:
meet
in interfaceQueryModelVisitor<java.lang.Exception>
- Overrides:
meet
in classAbstractQueryModelVisitor<java.lang.Exception>
- Throws:
java.lang.Exception
-
meet
public void meet(Intersection theOp) throws java.lang.Exception
- Specified by:
meet
in interfaceQueryModelVisitor<java.lang.Exception>
- Overrides:
meet
in classAbstractQueryModelVisitor<java.lang.Exception>
- Throws:
java.lang.Exception
-
meet
public void meet(Filter theFilter) throws java.lang.Exception
- Specified by:
meet
in interfaceQueryModelVisitor<java.lang.Exception>
- Overrides:
meet
in classAbstractQueryModelVisitor<java.lang.Exception>
- Throws:
java.lang.Exception
-
binaryOpMeet
private void binaryOpMeet(TupleExpr theCurrentExpr, TupleExpr theLeftExpr, TupleExpr theRightExpr) throws java.lang.Exception
- Throws:
java.lang.Exception
-
meet
public void meet(StatementPattern thePattern) throws java.lang.Exception
- Specified by:
meet
in interfaceQueryModelVisitor<java.lang.Exception>
- Overrides:
meet
in classAbstractQueryModelVisitor<java.lang.Exception>
- Throws:
java.lang.Exception
-
sameCtxCheck
private void sameCtxCheck(TupleExpr theCurrentExpr, TupleExpr theLeftExpr, Var theLeftCtx, TupleExpr theRightExpr, Var theRightCtx)
-
-