com.bigdata.rdf.sparql.ast
Class JoinGroupNode

java.lang.Object
  extended by com.bigdata.bop.CoreBaseBOp
      extended by com.bigdata.bop.ModifiableBOpBase
          extended by com.bigdata.rdf.sparql.ast.ASTBase
              extended by com.bigdata.rdf.sparql.ast.QueryNodeBase
                  extended by com.bigdata.rdf.sparql.ast.GroupMemberNodeBase<E>
                      extended by com.bigdata.rdf.sparql.ast.GroupNodeBase<E>
                          extended by com.bigdata.rdf.sparql.ast.GraphPatternGroup<IGroupMemberNode>
                              extended by com.bigdata.rdf.sparql.ast.JoinGroupNode
All Implemented Interfaces:
BOp, IBindingProducerNode, IGroupMemberNode, IGroupNode<IGroupMemberNode>, IJoinNode, IQueryNode, IPropertySet, Serializable, Cloneable, Iterable<IGroupMemberNode>

public class JoinGroupNode
extends GraphPatternGroup<IGroupMemberNode>

An optional or non-optional collection of query nodes that run together in a group.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.bigdata.bop.CoreBaseBOp
DEFAULT_INITIAL_CAPACITY
 
Fields inherited from interface com.bigdata.bop.BOp
NOANNS, NOARGS
 
Constructor Summary
JoinGroupNode()
          Construct a non-optional join group.
JoinGroupNode(boolean optional)
           
JoinGroupNode(boolean optional, IGroupMemberNode child)
          Construct a possibly optional group having the specified child as its initial member.
JoinGroupNode(BOp[] args, Map<String,Object> anns)
          Required shallow copy constructor.
JoinGroupNode(IGroupMemberNode child)
          Construct a non-optional join group having the specified child as its initial member.
JoinGroupNode(JoinGroupNode op)
          Required deep copy constructor.
JoinGroupNode(TermNode context, IGroupMemberNode child)
          Construct a GRAPH group having the specified child as its initial member.
 
Method Summary
 List<FilterNode> getAllFiltersInGroup()
          Return only the filter child nodes in this group.
 List<AssignmentNode> getAssignments()
          Return any LET x:= expr or (expr AS ?x) nodes in this group (these are modeled in exactly the same way by the AST AssignmentNode).
<T> List<T>
getChildren(Class<T> type)
          Return only the NamedSubqueryInclude child nodes in this group.
 TermNode getContext()
          Return the context for the group graph pattern dominating this node.
 List<FilterNode> getInFilters()
          Return the set of IN filters for this group.
 List<NamedSubqueryInclude> getNamedSubqueryIncludes()
          Return only the NamedSubqueryInclude child nodes in this group.
 int getRequiredStatementPatternCount()
          Return the #of required statement patterns (does not include those flagged as OPTIONAL).
 List<ServiceNode> getServiceNodes()
          Return only the ServiceNode child nodes in this group.
 int getStatementPatternCount()
          Return the #of statement patterns.
 List<StatementPatternNode> getStatementPatterns()
          Return only the statement pattern child nodes in this group.
 boolean isMinus()
          Return true iff this is a join group representing a SPARQL MINUS operator.
 boolean isOptional()
          Return whether or not this is an join with "optional" semantics.
 void setContext(TermNode context)
          Set the context for a GroupGraphPattern.
 void setMinus(boolean minus)
           
 void setOptional(boolean optional)
           
 
Methods inherited from class com.bigdata.rdf.sparql.ast.GraphPatternGroup
getJoinVars, setJoinVars
 
Methods inherited from class com.bigdata.rdf.sparql.ast.GroupNodeBase
addArg, addArg, addChild, clone, getAttachedJoinFilters, isEmpty, iterator, removeArg, removeChild, replaceWith, setArg, setAttachedJoinFilters, size, toString
 
Methods inherited from class com.bigdata.rdf.sparql.ast.GroupMemberNodeBase
getParent, getParentGraphPatternGroup, getParentJoinGroup, setParent
 
Methods inherited from class com.bigdata.rdf.sparql.ast.QueryNodeBase
toString
 
Methods inherited from class com.bigdata.rdf.sparql.ast.ASTBase
getQueryHint, getQueryHint, getQueryHintAsBoolean, getQueryHintAsBoolean, getQueryHints, replaceAllWith, setQueryHint, setQueryHints
 
Methods inherited from class com.bigdata.bop.ModifiableBOpBase
addArgIfAbsent, annotations, annotationsEqual, argIterator, args, arity, clearProperty, copyAll, get, getProperty, mutation, setArgs, setId, setProperty, setUnboundProperty, toArray, toArray
 
Methods inherited from class com.bigdata.bop.CoreBaseBOp
annotationsEqual, annotationsToString, checkArgs, equals, getEvaluationContext, getId, getProperty, getRequiredProperty, hashCode, indent, isController, toShortString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.bigdata.rdf.sparql.ast.IJoinNode
getAttachedJoinFilters, setAttachedJoinFilters
 
Methods inherited from interface com.bigdata.rdf.sparql.ast.IQueryNode
toString
 
Methods inherited from interface com.bigdata.rdf.sparql.ast.IGroupMemberNode
getParent, getParentGraphPatternGroup, getParentJoinGroup, setParent
 

Constructor Detail

JoinGroupNode

public JoinGroupNode(JoinGroupNode op)
Required deep copy constructor.


JoinGroupNode

public JoinGroupNode(BOp[] args,
                     Map<String,Object> anns)
Required shallow copy constructor.


JoinGroupNode

public JoinGroupNode()
Construct a non-optional join group.


JoinGroupNode

public JoinGroupNode(IGroupMemberNode child)
Construct a non-optional join group having the specified child as its initial member.


JoinGroupNode

public JoinGroupNode(boolean optional)

JoinGroupNode

public JoinGroupNode(boolean optional,
                     IGroupMemberNode child)
Construct a possibly optional group having the specified child as its initial member.

Parameters:
optional - true iff the group is optional.
child - The initial child.

JoinGroupNode

public JoinGroupNode(TermNode context,
                     IGroupMemberNode child)
Construct a GRAPH group having the specified child as its initial member.

Parameters:
context - The variable or constant for the GRAPH group.
child - The initial child.
Method Detail

setContext

public void setContext(TermNode context)
Set the context for a GroupGraphPattern.

Parameters:
context - The context (may be null).

getContext

public TermNode getContext()
Return the context for the group graph pattern dominating this node.

Overridden to return the context associated with this JoinGroupNode if it is defined and otherwise read up the parent chain.

Specified by:
getContext in interface IGroupMemberNode
Overrides:
getContext in class GroupMemberNodeBase<IGroupMemberNode>
Returns:
The context -or- null if there is no graph pattern dominating this node.

isOptional

public final boolean isOptional()
Description copied from interface: IJoinNode
Return whether or not this is an join with "optional" semantics. Optional joins may or may not produce variable bindings, but will not reduce the incoming solutions based on whether or not they bind.


setOptional

public final void setOptional(boolean optional)

isMinus

public final boolean isMinus()
Description copied from interface: IJoinNode
Return true iff this is a join group representing a SPARQL MINUS operator.


setMinus

public void setMinus(boolean minus)

getStatementPatterns

public List<StatementPatternNode> getStatementPatterns()
Return only the statement pattern child nodes in this group.


getStatementPatternCount

public int getStatementPatternCount()
Return the #of statement patterns.


getRequiredStatementPatternCount

public int getRequiredStatementPatternCount()
Return the #of required statement patterns (does not include those flagged as OPTIONAL).


getServiceNodes

public List<ServiceNode> getServiceNodes()
Return only the ServiceNode child nodes in this group.


getNamedSubqueryIncludes

public List<NamedSubqueryInclude> getNamedSubqueryIncludes()
Return only the NamedSubqueryInclude child nodes in this group.


getChildren

public <T> List<T> getChildren(Class<T> type)
Return only the NamedSubqueryInclude child nodes in this group.


getAssignments

public List<AssignmentNode> getAssignments()
Return any LET x:= expr or (expr AS ?x) nodes in this group (these are modeled in exactly the same way by the AST AssignmentNode).

Note: AssignmentNodes MUST NOT be reordered. They MUST be evaluated left-to-right in the order given in the original query.


getAllFiltersInGroup

public List<FilterNode> getAllFiltersInGroup()
Return only the filter child nodes in this group.


getInFilters

public List<FilterNode> getInFilters()
Return the set of IN filters for this group. FIXME We need to move away from the DataSetJoin class and replace it with an IPredicate to which we have attached an inline access path. That transformation needs to happen in a rewrite rule, which means that we will wind up removing the IN filter and replacing it with an AST node for that inline AP (something conceptually similar to a statement pattern but for a column projection of the variable for the IN expression). That way we do not have to magically "subtract" the known "IN" filters out of the join- and post- filters.

See Also:
(Replace DataSetJoin with an "inline" access path.)


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.