public class GroupGraphPatternBuilder extends TriplePatternExprBuilder
GroupGraphPattern
production (aka the
"WHERE" clause). This includes SubSelect
and
GraphPatternNotTriples
. ASTWhereClause has GroupGraphPattern
child which is a (SelectQuery (aka subquery)), GraphPattern
(BasicGraphPattern aka JoinGroup or GraphPatternNotTriples). The
TriplesBlock
is handled by the TriplePatternExprBuilder
.graphPattern
context
Constructor and Description |
---|
GroupGraphPatternBuilder(BigdataASTContext context) |
Modifier and Type | Method and Description |
---|---|
Object |
visit(ASTBind node,
Object data)
A BIND (or FILTER) can appear in an
ASTBasicGraphPattern . |
ValueExpressionNode |
visit(ASTConstraint node,
Object data)
A FILTER.
|
ConstructNode |
visit(ASTConstruct node,
Object data)
CONSTRUCT (handled as a TriplesBlock).
|
Void |
visit(ASTGraphGraphPattern node,
Object data) |
GroupNodeBase<?> |
visit(ASTGraphPatternGroup node,
Object data)
( SelectQuery | GraphPattern ) - this is the common path for
SubSelect and graph patterns. |
BindingsClause |
visit(ASTInlineData node,
Object data) |
AssignmentNode |
visit(ASTLet node,
Object data)
A LET is just an alternative syntax for BIND
|
Object |
visit(ASTMinusGraphPattern node,
Object data)
MINUS is modeled very much like OPTIONAL in the bigdata AST.
|
Void |
visit(ASTNamedSubqueryInclude node,
Object data)
INCLUDE for a named subquery result set.
|
Void |
visit(ASTOptionalGraphPattern node,
Object data)
Note: while openrdf lifts the filters out of the optional, we do not need
to do this per MikeP.
|
Void |
visit(ASTServiceGraphPattern node,
Object data)
SPARQL 1.1 SERVICE.
|
Void |
visit(ASTUnionGraphPattern node,
Object data)
Given
|
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
aggregate, binary, left, nary, noneary, quadary, right, ternary, unary, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
depth, firstASTGraphGraphAncestor, indent, indent, scopedGroupGraphPattern, visit, visit, visit, visit, visit, visit, visit, visit, visit
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
public GroupGraphPatternBuilder(BigdataASTContext context)
public final ConstructNode visit(ASTConstruct node, Object data) throws VisitorException
visit
in interface SyntaxTreeBuilderVisitor
visit
in class ASTVisitorBase
VisitorException
public final GroupNodeBase<?> visit(ASTGraphPatternGroup node, Object data) throws VisitorException
( SelectQuery | GraphPattern )
- this is the common path for
SubSelect and graph patterns.
Note: (NOT) EXISTS uses a temporary graph pattern in order to avoid the side-effect on the parent's graph pattern. Other value functions with inner graph patterns should do this as well.
visit
in interface SyntaxTreeBuilderVisitor
visit
in class ASTVisitorBase
GroupNodeBase
. This return value is used by the
visitor method for the ASTWhereClause
and also in SPARQL
UPDATE.VisitorException
public final Void visit(ASTOptionalGraphPattern node, Object data) throws VisitorException
visit
in interface SyntaxTreeBuilderVisitor
visit
in class ASTVisitorBase
VisitorException
public Object visit(ASTMinusGraphPattern node, Object data) throws VisitorException
JoinGroupNode
which is annotated to indicate the negation
semantics.
Note: The grammar file treats OPTIONAL somewhat differently than MINUS due to the scope of the filters. For OPTIONAL, the child group can see the variable bindings in the parent group. That is not true for MINUS. Therefore the code in this method only sets the MINUS attribute on the group and does not need to create a new group.
visit
in interface SyntaxTreeBuilderVisitor
visit
in class ASTVisitorBase
VisitorException
public final Void visit(ASTGraphGraphPattern node, Object data) throws VisitorException
visit
in interface SyntaxTreeBuilderVisitor
visit
in class ASTVisitorBase
VisitorException
public final Void visit(ASTUnionGraphPattern node, Object data) throws VisitorException
select ?s where { { ?s ?p1 ?o } UNION { ?s ?p2 ?o } UNION { ?s ?p3 ?o } }The parse tree looks like:
QueryContainer SelectQuery Select ProjectionElem Var (s) WhereClause GraphPatternGroup UnionGraphPattern GraphPatternGroup BasicGraphPattern TriplesSameSubjectPath Var (s) PropertyListPath Var (p1) ObjectList Var (o) UnionGraphPattern GraphPatternGroup BasicGraphPattern TriplesSameSubjectPath Var (s) PropertyListPath Var (p2) ObjectList Var (o) GraphPatternGroup BasicGraphPattern TriplesSameSubjectPath Var (s) PropertyListPath Var (p3) ObjectList Var (o)That is, UNION in a binary operator in the parse tree. If the right hand argument is also a UNION, then you are looking at a sequence of UNIONs at the same level. Such sequences should be turned into a single
UnionNode
in the bigdata AST.
In contrast, this is a UNION of two groups with another UNION embedded in
the 2nd group.
select ?s where { { ?s ?p1 ?o } UNION { { ?s ?p2 ?o } UNION { ?s ?p3 ?o } } }The 2nd child of the first union is a GraphPatternGroup, not a UnionGraphPattern.
QueryContainer SelectQuery Select ProjectionElem Var (s) WhereClause GraphPatternGroup UnionGraphPattern GraphPatternGroup BasicGraphPattern TriplesSameSubjectPath Var (s) PropertyListPath Var (p1) ObjectList Var (o) GraphPatternGroup UnionGraphPattern GraphPatternGroup BasicGraphPattern TriplesSameSubjectPath Var (s) PropertyListPath Var (p2) ObjectList Var (o) GraphPatternGroup BasicGraphPattern TriplesSameSubjectPath Var (s) PropertyListPath Var (p3) ObjectList Var (o)
visit
in interface SyntaxTreeBuilderVisitor
visit
in class ASTVisitorBase
VisitorException
public final Object visit(ASTBind node, Object data) throws VisitorException
ASTBasicGraphPattern
.visit
in interface SyntaxTreeBuilderVisitor
visit
in class ASTVisitorBase
AssignmentNode
for the BIND -or- the
null
if this is BIND(tripleRef AS var).
VisitorException
public final BindingsClause visit(ASTInlineData node, Object data) throws VisitorException
visit
in interface SyntaxTreeBuilderVisitor
visit
in class ASTVisitorBase
BigdataValue
s. They must be translated into
IV
through a batch resolution process before they can be
passed into the query engine.VisitorException
public final AssignmentNode visit(ASTLet node, Object data) throws VisitorException
visit
in interface SyntaxTreeBuilderVisitor
visit
in class ASTVisitorBase
AssignmentNode
.VisitorException
public final ValueExpressionNode visit(ASTConstraint node, Object data) throws VisitorException
ValueExprBuilder.graphPattern
. However,
it is also returned from this method. The ASTHavingClause
uses
the return value.visit
in interface SyntaxTreeBuilderVisitor
visit
in class ASTVisitorBase
VisitorException
public final Void visit(ASTNamedSubqueryInclude node, Object data) throws VisitorException
visit
in interface SyntaxTreeBuilderVisitor
visit
in class ASTVisitorBase
VisitorException
public final Void visit(ASTServiceGraphPattern node, Object data) throws VisitorException
Note: The prefix declarations are attached to the
ASTServiceGraphPattern
by the PrefixDeclProcessor
.
TODO Do we need to pass through the baseURI? Can this be used to abbreviate serialized IRIs? (I would think that we would use the prefix declarations for that.)
visit
in interface SyntaxTreeBuilderVisitor
visit
in class ASTVisitorBase
VisitorException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.