Query

SPARQL

PREFIX tmp: <http://example/tmp/>
SELECT  *
WHERE {
  GRAPH tmp: {
      #{ SELECT * {
      BIND( "hello " as ?hello ) .
      BIND( CONCAT(?hello, "world") as ?helloWorld ) .
      #}}
     ?s ?p ?v .
  }
} 

Parse Tree

QueryContainer
 PrefixDecl (prefix=tmp)
  IRI (http://example/tmp/)
 SelectQuery
  Select ( * )
  WhereClause
   GraphPatternGroup
    GraphGraphPattern
     IRI (http://example/tmp/)
     GraphPatternGroup
      BasicGraphPattern
       Bind
        RDFLiteral
         String (hello )
        Var (hello)
       Bind
        Concat
         Var (hello)
         RDFLiteral
          String (world)
        Var (helloWorld)
       TriplesSameSubjectPath
        Var (s)
        PropertyListPath
         Var (p)
         ObjectList
          Var (v)

Original AST

PREFIX tmp: <http://example/tmp/>
QueryType: SELECT
includeInferred=true
SELECT * 
  JoinGroupNode {
    JoinGroupNode [context=ConstantNode(TermId(6917529027909517939U)[http://example/tmp/])] {
      ( ConstantNode(TermId(0L)[hello ]) AS VarNode(hello) )
      ( com.bigdata.rdf.sparql.ast.FunctionNode(VarNode(hello),ConstantNode(TermId(0L)[world]))[ com.bigdata.rdf.sparql.ast.FunctionNode.scalarVals=null, com.bigdata.rdf.sparql.ast.FunctionNode.functionURI=http://www.w3.org/2006/sparql-functions#concat, valueExpr=com.bigdata.rdf.internal.constraints.ConcatBOp(hello,TermId(0L)[world])[ com.bigdata.rdf.internal.constraints.IVValueExpression.namespace=chcsdata.lex, com.bigdata.rdf.internal.constraints.IVValueExpression.timestamp=-1]] AS VarNode(helloWorld) )
      StatementPatternNode(VarNode(s), VarNode(p), VarNode(v), ConstantNode(TermId(6917529027909517939U)[http://example/tmp/])) [scope=NAMED_CONTEXTS]
    }
  }

Optimized AST

PREFIX tmp: <http://example/tmp/>
QueryType: SELECT
includeInferred=true
SELECT VarNode(hello) VarNode(helloWorld) VarNode(s) VarNode(p) VarNode(v)
  JoinGroupNode [context=ConstantNode(TermId(6917529027909517939U)[http://example/tmp/])] {
    ( ConstantNode(TermId(0L)[hello ]) AS VarNode(hello) )
    StatementPatternNode(VarNode(s), VarNode(p), VarNode(v), ConstantNode(TermId(6917529027909517939U)[http://example/tmp/])) [scope=NAMED_CONTEXTS]
      com.bigdata.rdf.sparql.ast.eval.AST2BOpBase.estimatedCardinality=1
      com.bigdata.rdf.sparql.ast.eval.AST2BOpBase.originalIndex=CSPO
    ( com.bigdata.rdf.sparql.ast.FunctionNode(VarNode(hello),ConstantNode(TermId(0L)[world]))[ com.bigdata.rdf.sparql.ast.FunctionNode.scalarVals=null, com.bigdata.rdf.sparql.ast.FunctionNode.functionURI=http://www.w3.org/2006/sparql-functions#concat, valueExpr=com.bigdata.rdf.internal.constraints.ConcatBOp(hello,TermId(0L)[world])[ com.bigdata.rdf.internal.constraints.IVValueExpression.namespace=chcsdata.lex, com.bigdata.rdf.internal.constraints.IVValueExpression.timestamp=-1]] AS VarNode(helloWorld) )
  }

Query Plan

com.bigdata.bop.solutions.ProjectionOp[8](ConditionalRoutingOp[5])[ com.bigdata.bop.BOp.bopId=8, com.bigdata.bop.BOp.evaluationContext=CONTROLLER, com.bigdata.bop.PipelineOp.sharedState=true, com.bigdata.bop.join.JoinAnnotations.select=[hello, helloWorld, s, p, v], com.bigdata.bop.engine.QueryEngine.queryId=e41d81a8-c762-467c-9088-3187ce1c15e2]
  com.bigdata.bop.bset.ConditionalRoutingOp[5](ChunkedMaterializationOp[7])[ com.bigdata.bop.BOp.bopId=5, com.bigdata.bop.bset.ConditionalRoutingOp.condition=TryBeforeMaterializationConstraint, analytic=true, queryId=e41d81a8-c762-467c-9088-3187ce1c15e2]
    com.bigdata.bop.rdf.join.ChunkedMaterializationOp[7](ConditionalRoutingOp[6])[ com.bigdata.bop.rdf.join.ChunkedMaterializationOp.vars=[hello], com.bigdata.bop.IPredicate.relationName=[chcsdata.lex], com.bigdata.bop.IPredicate.timestamp=-1, com.bigdata.bop.PipelineOp.sharedState=false, com.bigdata.bop.BOp.bopId=7]
      com.bigdata.bop.bset.ConditionalRoutingOp[6](PipelineJoin[4])[ com.bigdata.bop.BOp.bopId=6, com.bigdata.bop.bset.ConditionalRoutingOp.condition=SPARQLConstraint, com.bigdata.bop.PipelineOp.altSinkRef=5, analytic=true, queryId=e41d81a8-c762-467c-9088-3187ce1c15e2]
        com.bigdata.bop.join.PipelineJoin[4](ConditionalRoutingOp[2])[ com.bigdata.bop.BOp.bopId=4, com.bigdata.bop.join.JoinAnnotations.constraints=null, com.bigdata.bop.BOp.evaluationContext=SHARDED, com.bigdata.bop.join.AccessPathJoinAnnotations.predicate=SPOPredicate[3]]
          com.bigdata.bop.bset.ConditionalRoutingOp[2](StartOp[1])[ com.bigdata.bop.BOp.bopId=2, com.bigdata.bop.bset.ConditionalRoutingOp.condition=BindingConstraint, analytic=true, queryId=e41d81a8-c762-467c-9088-3187ce1c15e2]
            com.bigdata.bop.bset.StartOp[1]()[ com.bigdata.bop.BOp.bopId=1, com.bigdata.bop.BOp.evaluationContext=CONTROLLER, analytic=true, queryId=e41d81a8-c762-467c-9088-3187ce1c15e2]

Query Evaluation Statistics

solutions=1, chunks=1, subqueries=0, elapsed=34ms.

queryIdbeginTimedoneTimedeadlineelapsedserviceIdcauseevalOrderevalContextcontrollerbopIdpredIdbopSummarypredSummarystaticBestKeyOrderoverriddenKeyOrdernvarsfastRangeCountrunStatesumMillisopCountnumRunningfanOutqueueShardsqueueChunksqueueSolutionschunksInunitsInunitsInPerChunkchunksOutunitsOutunitsOutPerChunkmutationCounttypeErrorsjoinRatioaccessPathDupsaccessPathCountaccessPathRangeCountaccessPathChunksInaccessPathUnitsInsolutions/msmutations/ms
e41d81a8-c762-467c-9088-3187ce1c15e2Friday, April 11, 2014 7:03:23 AM HSTFriday, April 11, 2014 7:03:23 AM HST34be75a3dd-a186-43c0-b586-5cbba107043ctotaltotaltotalAllDone171301661.0661.0001.00111100
e41d81a8-c762-467c-9088-3187ce1c15e2Friday, April 11, 2014 7:03:23 AM HSTFriday, April 11, 2014 7:03:23 AM HST34be75a3dd-a186-43c0-b586-5cbba107043c0CONTROLLERfalse1StartOp[1]AllDone1301111.0111.0001.00000000
e41d81a8-c762-467c-9088-3187ce1c15e2Friday, April 11, 2014 7:03:23 AM HSTFriday, April 11, 2014 7:03:23 AM HST34be75a3dd-a186-43c0-b586-5cbba107043c1ANYfalse2ConditionalRoutingOp[2]AllDone9301111.0111.0001.00000000
e41d81a8-c762-467c-9088-3187ce1c15e2Friday, April 11, 2014 7:03:23 AM HSTFriday, April 11, 2014 7:03:23 AM HST34be75a3dd-a186-43c0-b586-5cbba107043c2SHARDEDfalse43PipelineJoin[4]SPOPredicate[3](?s, ?p, ?v, TermId(6917529027909517939U)[http://example/tmp/])CSPO31AllDone2301111.0111.0001.00111100
e41d81a8-c762-467c-9088-3187ce1c15e2Friday, April 11, 2014 7:03:23 AM HSTFriday, April 11, 2014 7:03:23 AM HST34be75a3dd-a186-43c0-b586-5cbba107043c3ANYfalse6ConditionalRoutingOp[6]AllDone1301111.0111.0001.00000000
e41d81a8-c762-467c-9088-3187ce1c15e2Friday, April 11, 2014 7:03:23 AM HSTFriday, April 11, 2014 7:03:23 AM HST34be75a3dd-a186-43c0-b586-5cbba107043c4ANYfalse7ChunkedMaterializationOp[7][hello]AllDone0200000.0000.000N/A0000000
e41d81a8-c762-467c-9088-3187ce1c15e2Friday, April 11, 2014 7:03:23 AM HSTFriday, April 11, 2014 7:03:23 AM HST34be75a3dd-a186-43c0-b586-5cbba107043c5ANYfalse5ConditionalRoutingOp[5]AllDone4301111.0111.0001.00000000
e41d81a8-c762-467c-9088-3187ce1c15e2Friday, April 11, 2014 7:03:23 AM HSTFriday, April 11, 2014 7:03:23 AM HST34be75a3dd-a186-43c0-b586-5cbba107043c6CONTROLLERfalse8ProjectionOp[8]AllDone0201111.0111.0001.00000000