public class ExternalEdgeRecognizerSyntaxTreeAssembler extends DefaultBinaryExprTreeAssembler
visits
(traverses) the given predicate expression syntax tree depth-first using an
adapted shunting-yard algorithm and assembles a resulting binary tree
structure. In typical usage scenarios, a single expression tree is assembled
once, and then used to evaluate any number of graph edge or other results
based on a given context.
The adapted shunting-yard algorithm in general uses a stack of operators and operands, and as new binary tree nodes are detected and created they are pushed onto the operand stack based on operator precedence. The resulting binary expression tree reflects the syntax of the underlying query expression including the precedence of its operators.
ExternalEdgeRecognizerRelationalBinaryExpr,
ExternalEdgeRecognizerWildcardBinaryExpr,
ExprAssembler| Modifier and Type | Field and Description |
|---|---|
protected org.plasma.sdo.PlasmaType |
edgeType |
protected DataGraphMapping |
graphConfig |
contextExpression, contextProperty, contextQueryProperty, contextType, predicates, rootType| Constructor and Description |
|---|
ExternalEdgeRecognizerSyntaxTreeAssembler(org.plasma.query.model.Where predicate,
DataGraphMapping graphConfig,
org.plasma.sdo.PlasmaType edgeType,
org.plasma.sdo.PlasmaType rootType)
Constructs an assembler based on the given predicate and graph edge type.
|
| Modifier and Type | Method and Description |
|---|---|
LogicalBinaryExpr |
createLogicalBinaryExpr(Expr left,
Expr right,
org.plasma.query.model.LogicalOperator operator) |
PredicateBinaryExpr |
createPredicateBinaryExpr(org.plasma.query.model.Property property,
org.plasma.query.model.Literal literal,
org.plasma.query.model.PredicateOperator operator) |
RelationalBinaryExpr |
createRelationalBinaryExpr(org.plasma.query.model.Property property,
org.plasma.query.model.Literal literal,
org.plasma.query.model.RelationalOperator operator) |
void |
end(org.plasma.query.model.Property property)
Process the traversal end event for a query
property within an
expression setting up context
information for the endpoint property and its type, as well as physical
column qualifier name bytes which are set into the
DefaultBinaryExprTreeAssembler.contextQueryProperty physical name bytes. |
end, getResult, log, serialize, traversegetChildExpressionCount, getChildExpressions, getLogicalOperatorCount, hasChildExpressions, hasWildcardend, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, getContext, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, startprotected DataGraphMapping graphConfig
protected org.plasma.sdo.PlasmaType edgeType
public ExternalEdgeRecognizerSyntaxTreeAssembler(org.plasma.query.model.Where predicate,
DataGraphMapping graphConfig,
org.plasma.sdo.PlasmaType edgeType,
org.plasma.sdo.PlasmaType rootType)
predicate - the predicateedgeType - the graph edge type which is the type for the reference property
within the graph which represents an edgerootType - the graph root typegraphConfig - the graph configpublic RelationalBinaryExpr createRelationalBinaryExpr(org.plasma.query.model.Property property, org.plasma.query.model.Literal literal, org.plasma.query.model.RelationalOperator operator)
createRelationalBinaryExpr in interface ExprAssemblercreateRelationalBinaryExpr in class DefaultBinaryExprTreeAssemblerpublic PredicateBinaryExpr createPredicateBinaryExpr(org.plasma.query.model.Property property, org.plasma.query.model.Literal literal, org.plasma.query.model.PredicateOperator operator)
createPredicateBinaryExpr in interface ExprAssemblercreatePredicateBinaryExpr in class DefaultBinaryExprTreeAssemblerpublic LogicalBinaryExpr createLogicalBinaryExpr(Expr left, Expr right, org.plasma.query.model.LogicalOperator operator)
createLogicalBinaryExpr in interface ExprAssemblercreateLogicalBinaryExpr in class DefaultBinaryExprTreeAssemblerpublic void end(org.plasma.query.model.Property property)
property within an
expression setting up context
information for the endpoint property and its type, as well as physical
column qualifier name bytes which are set into the
DefaultBinaryExprTreeAssembler.contextQueryProperty physical name bytes. for the current
expression.end in interface org.plasma.query.visitor.QueryVisitorend in class DefaultBinaryExprTreeAssemblerDefaultQueryVisitor.end(org.plasma.query.model.Property)Copyright © 2021. All Rights Reserved.