public GremlinBoundEdgeTableVariable(GremlinVariableProperty sourceVertexVariableProperty,
                                      GremlinVariableProperty adjEdgeVariableProperty,
                                      WEdgeType edgeType)
 {
     this.sourceVertexVariableProperty = sourceVertexVariableProperty;
     this.adjEdgeVariableProperty      = adjEdgeVariableProperty;
     EdgeType = edgeType;
 }
Esempio n. 2
0
        internal virtual void InV(GremlinToSqlContext currentContext)
        {
            GremlinVariableProperty sinkProperty = GetVariableProperty(GremlinKeyword.EdgeSinkV);
            GremlinTableVariable    inVertex     = new GremlinBoundVertexVariable(sinkProperty);

            currentContext.VariableList.Add(inVertex);
            currentContext.TableReferences.Add(inVertex);
            currentContext.SetPivotVariable(inVertex);
        }
Esempio n. 3
0
        internal virtual void OtherV(GremlinToSqlContext currentContext)
        {
            GremlinVariableProperty    otherProperty = GetVariableProperty(GremlinKeyword.EdgeOtherV);
            GremlinBoundVertexVariable otherVertex   = new GremlinBoundVertexVariable(otherProperty);

            currentContext.VariableList.Add(otherVertex);
            currentContext.TableReferences.Add(otherVertex);
            currentContext.SetPivotVariable(otherVertex);
        }
Esempio n. 4
0
        internal void DropVertex(GremlinVariable dropVertexVariable)
        {
            GremlinVariableProperty variableProperty = dropVertexVariable.GetVariableProperty(GremlinKeyword.NodeID);
            GremlinDropVariable     dropVariable     = new GremlinDropVertexVariable(variableProperty);

            VariableList.Add(dropVariable);
            TableReferences.Add(dropVariable);
            SetPivotVariable(dropVariable);
        }
Esempio n. 5
0
 internal void PopulateColumn(GremlinVariableProperty variableProperty, string alias)
 {
     if (ProjectedProperties.Contains(alias))
     {
         return;
     }
     ProjectedProperties.Add(alias);
     ProjectVariablePropertiesList.Add(new Tuple <GremlinVariableProperty, string>(variableProperty, alias));
 }
Esempio n. 6
0
        internal virtual void OutV(GremlinToSqlContext currentContext)
        {
            GremlinVariableProperty sourceProperty = GetVariableProperty(GremlinKeyword.EdgeSourceV);
            GremlinTableVariable    outVertex      = new GremlinBoundVertexVariable(sourceProperty);

            currentContext.VariableList.Add(outVertex);
            currentContext.TableReferences.Add(outVertex);
            currentContext.SetPivotVariable(outVertex);
        }
Esempio n. 7
0
 public GremlinBoundEdgeTableVariable(GremlinVariableProperty sourceVertexVariableProperty,
                                      GremlinVariableProperty adjEdgeVariableProperty,
                                      GremlinVariableProperty labelVariableProperty,
                                      WEdgeType edgeType)
 {
     SourceVertexVariableProperty = sourceVertexVariableProperty;
     AdjEdgeVariableProperty      = adjEdgeVariableProperty;
     LabelVariableProperty        = labelVariableProperty;
     EdgeType = edgeType;
 }
Esempio n. 8
0
        internal void BothV(GremlinVariable lastVariable)
        {
            GremlinVariableProperty    sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.EdgeSourceV);
            GremlinVariableProperty    sinkProperty   = lastVariable.GetVariableProperty(GremlinKeyword.EdgeSinkV);
            GremlinBoundVertexVariable bothVertex     = new GremlinBoundVertexVariable(lastVariable.GetEdgeType(), sourceProperty, sinkProperty);

            VariableList.Add(bothVertex);
            TableReferences.Add(bothVertex);
            SetPivotVariable(bothVertex);
        }
Esempio n. 9
0
        internal virtual void OutE(GremlinToSqlContext currentContext, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjEdge        = GetVariableProperty(GremlinKeyword.EdgeAdj);
            GremlinBoundEdgeTableVariable outEdgeTable   = new GremlinBoundEdgeTableVariable(sourceProperty, adjEdge, WEdgeType.OutEdge);

            currentContext.VariableList.Add(outEdgeTable);
            currentContext.TableReferences.Add(outEdgeTable);
            currentContext.AddLabelPredicateForEdge(outEdgeTable, edgeLabels);

            currentContext.SetPivotVariable(outEdgeTable);
        }
Esempio n. 10
0
        internal virtual void HasIdOrLabel(GremlinToSqlContext currentContext, GremlinHasType hasType, List <object> valuesOrPredicates)
        {
            GremlinVariableProperty variableProperty = hasType == GremlinHasType.HasId
                ? DefaultVariableProperty()
                : GetVariableProperty(GremlinKeyword.Label);
            List <WBooleanExpression> booleanExprList = new List <WBooleanExpression>();

            foreach (var valuesOrPredicate in valuesOrPredicates)
            {
                booleanExprList.Add(CreateBooleanExpression(variableProperty, valuesOrPredicate));
            }
            currentContext.AddPredicate(SqlUtil.ConcatBooleanExprWithOr(booleanExprList));
        }
Esempio n. 11
0
        internal virtual void InE(GremlinToSqlContext currentContext, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjReverseEdge = GetVariableProperty(GremlinKeyword.ReverseEdgeAdj);
            GremlinVariableProperty       labelProperty  = GetVariableProperty(GremlinKeyword.Label);
            GremlinBoundEdgeTableVariable inEdgeTable    = new GremlinBoundEdgeTableVariable(sourceProperty, adjReverseEdge, labelProperty, WEdgeType.InEdge);

            currentContext.VariableList.Add(inEdgeTable);
            currentContext.TableReferences.Add(inEdgeTable);
            currentContext.AddLabelPredicateForEdge(inEdgeTable, edgeLabels);

            //currentContext.PathList.Add(new GremlinMatchPath(null, inEdgeTable, this));
            currentContext.SetPivotVariable(inEdgeTable);
        }
Esempio n. 12
0
        internal void OutE(GremlinVariable lastVariable, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjEdge        = lastVariable.GetVariableProperty(GremlinKeyword.EdgeAdj);
            GremlinVariableProperty       labelProperty  = lastVariable.GetVariableProperty(GremlinKeyword.Label);
            GremlinBoundEdgeTableVariable outEdgeTable   = new GremlinBoundEdgeTableVariable(sourceProperty, adjEdge, labelProperty, WEdgeType.OutEdge);

            VariableList.Add(outEdgeTable);
            TableReferences.Add(outEdgeTable);
            AddLabelPredicateForEdge(outEdgeTable, edgeLabels);

            AddPath(new GremlinMatchPath(lastVariable, outEdgeTable, null));
            SetPivotVariable(outEdgeTable);
        }
Esempio n. 13
0
        internal void BothE(GremlinVariable lastVariable, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjReverseEdge = lastVariable.GetVariableProperty(GremlinKeyword.ReverseEdgeAdj);
            GremlinVariableProperty       adjEdge        = lastVariable.GetVariableProperty(GremlinKeyword.EdgeAdj);
            GremlinVariableProperty       labelProperty  = lastVariable.GetVariableProperty(GremlinKeyword.Label);
            GremlinBoundEdgeTableVariable bothEdgeTable  = new GremlinBoundEdgeTableVariable(sourceProperty, adjEdge, adjReverseEdge, labelProperty,
                                                                                             WEdgeType.BothEdge);

            VariableList.Add(bothEdgeTable);
            TableReferences.Add(bothEdgeTable);
            AddLabelPredicateForEdge(bothEdgeTable, edgeLabels);

            SetPivotVariable(bothEdgeTable);
        }
Esempio n. 14
0
        internal List <WSelectElement> GetSelectElement(bool isToCompose1)
        {
            var selectElements = new List <WSelectElement>();

            if (PivotVariable.GetVariableType() == GremlinVariableType.Null)
            {
                selectElements.Add(SqlUtil.GetSelectScalarExpr(SqlUtil.GetStarColumnReferenceExpr(), GremlinKeyword.TableDefaultColumnName));
                return(selectElements);
            }

            if (isToCompose1)
            {
                selectElements.Add(SqlUtil.GetSelectScalarExpr(PivotVariable.ToCompose1(), GremlinKeyword.TableDefaultColumnName));
                return(selectElements);
            }

            foreach (var projectProperty in ProjectedProperties)
            {
                WSelectScalarExpression selectScalarExpr;
                if (projectProperty == GremlinKeyword.Path)
                {
                    selectScalarExpr = SqlUtil.GetSelectScalarExpr(ContextLocalPath.GetDefaultProjection().ToScalarExpression(), GremlinKeyword.Path);
                }
                else if (projectProperty == GremlinKeyword.TableDefaultColumnName)
                {
                    GremlinVariableProperty defaultProjection = PivotVariable.GetDefaultProjection();
                    selectScalarExpr = SqlUtil.GetSelectScalarExpr(defaultProjection.ToScalarExpression(), GremlinKeyword.TableDefaultColumnName);
                }
                else if (PivotVariable.ProjectedProperties.Contains(projectProperty))
                {
                    WScalarExpression columnExpr = PivotVariable.GetVariableProperty(projectProperty).ToScalarExpression();
                    selectScalarExpr = SqlUtil.GetSelectScalarExpr(columnExpr, projectProperty);
                }
                else
                {
                    selectScalarExpr = SqlUtil.GetSelectScalarExpr(SqlUtil.GetValueExpr(null), projectProperty);
                }
                selectElements.Add(selectScalarExpr);
            }

            if (selectElements.Count == 0)
            {
                GremlinVariableProperty defaultProjection = PivotVariable.GetDefaultProjection();
                selectElements.Add(SqlUtil.GetSelectScalarExpr(defaultProjection.ToScalarExpression(), GremlinKeyword.TableDefaultColumnName));
            }

            return(selectElements);
        }
Esempio n. 15
0
 private WBooleanExpression CreateBooleanExpression(GremlinVariableProperty variableProperty, object valuesOrPredicate)
 {
     if (valuesOrPredicate is string || valuesOrPredicate is int || valuesOrPredicate is bool)
     {
         WScalarExpression firstExpr  = variableProperty.ToScalarExpression();
         WScalarExpression secondExpr = SqlUtil.GetValueExpr(valuesOrPredicate);
         return(SqlUtil.GetEqualBooleanComparisonExpr(firstExpr, secondExpr));
     }
     if (valuesOrPredicate is Predicate)
     {
         WScalarExpression firstExpr  = variableProperty.ToScalarExpression();
         WScalarExpression secondExpr = SqlUtil.GetValueExpr((valuesOrPredicate as Predicate).Value);
         return(SqlUtil.GetBooleanComparisonExpr(firstExpr, secondExpr, valuesOrPredicate as Predicate));
     }
     throw new ArgumentException();
 }
Esempio n. 16
0
        /// <summary>
        /// Only valid for VertexProperty
        /// </summary>
        internal virtual void HasKeyOrValue(GremlinToSqlContext currentContext, GremlinHasType hasType, List <object> valuesOrPredicates)
        {
            GraphTraversal2 traversal2 = hasType == GremlinHasType.HasKey ? GraphTraversal2.__().Key() : GraphTraversal2.__().Value();

            traversal2.GetStartOp().InheritedVariableFromParent(currentContext);
            GremlinToSqlContext existContext = traversal2.GetEndOp().GetContext();

            List <WBooleanExpression> booleanExprList         = new List <WBooleanExpression>();
            GremlinVariableProperty   defaultVariableProperty = existContext.PivotVariable.DefaultProjection();

            foreach (var valuesOrPredicate in valuesOrPredicates)
            {
                booleanExprList.Add(CreateBooleanExpression(defaultVariableProperty, valuesOrPredicate));
            }
            existContext.AddPredicate(SqlUtil.ConcatBooleanExprWithOr(booleanExprList));

            currentContext.AddPredicate(SqlUtil.GetExistPredicate(existContext.ToSelectQueryBlock()));
        }
Esempio n. 17
0
        internal virtual void In(GremlinToSqlContext currentContext, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjReverseEdge = GetVariableProperty(GremlinKeyword.ReverseEdgeAdj);
            GremlinBoundEdgeTableVariable inEdgeTable    = new GremlinBoundEdgeTableVariable(sourceProperty, adjReverseEdge, WEdgeType.InEdge);

            currentContext.VariableList.Add(inEdgeTable);
            currentContext.TableReferences.Add(inEdgeTable);
            currentContext.AddLabelPredicateForEdge(inEdgeTable, edgeLabels);

            GremlinVariableProperty    edgeProperty = inEdgeTable.GetVariableProperty(GremlinKeyword.EdgeSourceV);
            GremlinBoundVertexVariable outVertex    = new GremlinBoundVertexVariable(edgeProperty);

            currentContext.VariableList.Add(outVertex);
            currentContext.TableReferences.Add(outVertex);

            currentContext.SetPivotVariable(outVertex);
        }
Esempio n. 18
0
        internal void OutV(GremlinVariable lastVariable)
        {
            if (lastVariable is GremlinFreeEdgeTableVariable)
            {
                var path = GetPathFromPathList(lastVariable);

                if (path != null && path.SourceVariable != null)
                {
                    if (IsVariableInCurrentContext(path.SourceVariable))
                    {
                        SetPivotVariable(path.SourceVariable);
                    }
                    else
                    {
                        GremlinContextVariable newContextVariable = GremlinContextVariable.Create(path.SourceVariable);
                        VariableList.Add(newContextVariable);
                        SetPivotVariable(newContextVariable);
                    }
                }
                else
                {
                    GremlinVariableProperty sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.EdgeSourceV);
                    GremlinTableVariable    outVertex      = lastVariable.CreateAdjVertex(sourceProperty);
                    if (path != null)
                    {
                        path.SetSourceVariable(outVertex);
                    }

                    VariableList.Add(outVertex);
                    TableReferences.Add(outVertex);
                    SetPivotVariable(outVertex);
                }
            }
            else
            {
                GremlinVariableProperty sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.EdgeSourceV);
                GremlinTableVariable    outVertex      = new GremlinBoundVertexVariable(lastVariable.GetEdgeType(), sourceProperty);
                VariableList.Add(outVertex);
                TableReferences.Add(outVertex);
                SetPivotVariable(outVertex);
            }
        }
Esempio n. 19
0
        internal List <WSelectElement> GetSelectElement(bool isToCompose1)
        {
            var selectElements = new List <WSelectElement>();

            if (this.PivotVariable.GetVariableType() == GremlinVariableType.NULL)
            {
                selectElements.Add(
                    SqlUtil.GetSelectScalarExpr(SqlUtil.GetValueExpr(null),
                                                GremlinKeyword.TableDefaultColumnName));
                return(selectElements);
            }

            if (isToCompose1)
            {
                selectElements.Add(
                    SqlUtil.GetSelectScalarExpr(this.PivotVariable.ToCompose1(), GremlinKeyword.TableDefaultColumnName));
                return(selectElements);
            }

            GremlinVariableProperty defaultProjection = this.PivotVariable.DefaultProjection();

            selectElements.Add(
                SqlUtil.GetSelectScalarExpr(defaultProjection.ToScalarExpression(), this.PivotVariable.DefaultProperty()));

            foreach (var property in this.ProjectedProperties)
            {
                WScalarExpression selectScalarExpr;
                if (property == GremlinKeyword.Path)
                {
                    selectScalarExpr = ContextLocalPath.DefaultProjection().ToScalarExpression();
                }
                else
                {
                    selectScalarExpr = this.PivotVariable.ProjectedProperties.Contains(property)
                        ? this.PivotVariable.GetVariableProperty(property).ToScalarExpression()
                        : SqlUtil.GetValueExpr(null);
                }
                selectElements.Add(SqlUtil.GetSelectScalarExpr(selectScalarExpr, property));
            }

            return(selectElements);
        }
Esempio n. 20
0
        internal virtual void Out(GremlinToSqlContext currentContext, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjEdge        = GetVariableProperty(GremlinKeyword.EdgeAdj);
            GremlinVariableProperty       labelProperty  = GetVariableProperty(GremlinKeyword.Label);
            GremlinBoundEdgeTableVariable outEdgeTable   = new GremlinBoundEdgeTableVariable(sourceProperty, adjEdge, labelProperty, WEdgeType.OutEdge);

            currentContext.VariableList.Add(outEdgeTable);
            currentContext.TableReferences.Add(outEdgeTable);
            currentContext.AddLabelPredicateForEdge(outEdgeTable, edgeLabels);

            GremlinVariableProperty    sinkProperty = outEdgeTable.GetVariableProperty(GremlinKeyword.EdgeSinkV);
            GremlinBoundVertexVariable inVertex     = new GremlinBoundVertexVariable(sinkProperty);

            currentContext.VariableList.Add(inVertex);
            currentContext.TableReferences.Add(inVertex);

            //currentContext.PathList.Add(new GremlinMatchPath(this, outEdgeTable, inVertex));

            currentContext.SetPivotVariable(inVertex);
        }
Esempio n. 21
0
        internal void In(GremlinVariable lastVariable, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjReverseEdge = lastVariable.GetVariableProperty(GremlinKeyword.ReverseEdgeAdj);
            GremlinVariableProperty       labelProperty  = lastVariable.GetVariableProperty(GremlinKeyword.Label);
            GremlinBoundEdgeTableVariable inEdgeTable    = new GremlinBoundEdgeTableVariable(sourceProperty, adjReverseEdge,
                                                                                             labelProperty, WEdgeType.InEdge);

            VariableList.Add(inEdgeTable);
            TableReferences.Add(inEdgeTable);
            AddLabelPredicateForEdge(inEdgeTable, edgeLabels);

            GremlinVariableProperty    edgeProperty = inEdgeTable.GetVariableProperty(GremlinKeyword.EdgeSourceV);
            GremlinBoundVertexVariable outVertex    = new GremlinBoundVertexVariable(inEdgeTable.GetEdgeType(), edgeProperty);

            VariableList.Add(outVertex);
            TableReferences.Add(outVertex);

            AddPath(new GremlinMatchPath(outVertex, inEdgeTable, lastVariable));

            SetPivotVariable(outVertex);
        }
Esempio n. 22
0
        internal void OtherV(GremlinVariable lastVariable)
        {
            switch (lastVariable.GetEdgeType())
            {
            case WEdgeType.Undefined:
            case WEdgeType.BothEdge:
                GremlinVariableProperty    otherProperty = lastVariable.GetVariableProperty(GremlinKeyword.EdgeOtherV);
                GremlinBoundVertexVariable otherVertex   = new GremlinBoundVertexVariable(lastVariable.GetEdgeType(), otherProperty);
                VariableList.Add(otherVertex);
                TableReferences.Add(otherVertex);
                SetPivotVariable(otherVertex);
                break;

            case WEdgeType.InEdge:
                OutV(lastVariable);
                break;

            case WEdgeType.OutEdge:
                InV(lastVariable);
                break;
            }
        }
Esempio n. 23
0
        internal virtual void Both(GremlinToSqlContext currentContext, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjEdge        = GetVariableProperty(GremlinKeyword.EdgeAdj);
            GremlinVariableProperty       adjReverseEdge = GetVariableProperty(GremlinKeyword.ReverseEdgeAdj);
            GremlinBoundEdgeTableVariable bothEdgeTable  = new GremlinBoundEdgeTableVariable(
                sourceProperty,
                adjEdge,
                adjReverseEdge,
                WEdgeType.BothEdge);

            currentContext.VariableList.Add(bothEdgeTable);
            currentContext.TableReferences.Add(bothEdgeTable);
            currentContext.AddLabelPredicateForEdge(bothEdgeTable, edgeLabels);

            GremlinVariableProperty    otherProperty = bothEdgeTable.GetVariableProperty(GremlinKeyword.EdgeOtherV);
            GremlinBoundVertexVariable otherVertex   = new GremlinBoundVertexVariable(otherProperty);

            currentContext.VariableList.Add(otherVertex);
            currentContext.TableReferences.Add(otherVertex);
            currentContext.SetPivotVariable(otherVertex);
        }
Esempio n. 24
0
 public GremlinValueVariable(GremlinVariableProperty projectVariable)
 {
     ProjectVariable = projectVariable;
 }
Esempio n. 25
0
 public GremlinDropEdgeVariable(GremlinVariableProperty sourceVariable, GremlinVariableProperty edgeVariable)
 {
     SourceVariable = sourceVariable;
     EdgeVariable   = edgeVariable;
 }
Esempio n. 26
0
 public GremlinDropVertexVariable(GremlinVariableProperty dropVetexVariable)
 {
     DropVetexVariable = dropVetexVariable;
 }
Esempio n. 27
0
 public GremlinBoundVertexVariable(GremlinVariableProperty sourceVariableProperty, GremlinVariableProperty sinkVariableProperty)
 {
     SourceVariableProperty = sourceVariableProperty;
     SinkVariableProperty   = sinkVariableProperty;
 }
Esempio n. 28
0
 internal virtual GremlinTableVariable CreateAdjVertex(GremlinVariableProperty propertyVariable)
 {
     return(new GremlinBoundVertexVariable(GetEdgeType(), propertyVariable));
 }
Esempio n. 29
0
        internal List <WSelectElement> GetSelectElement(List <string> ProjectedProperties)
        {
            var selectElements = new List <WSelectElement>();

            if ((PivotVariable is GremlinUnionVariable && HomeVariable is GremlinSideEffectVariable) ||
                PivotVariable.GetVariableType() == GremlinVariableType.NULL)
            {
                selectElements.Add(SqlUtil.GetSelectScalarExpr(SqlUtil.GetStarColumnReferenceExpr()));
                return(selectElements);
            }
            if (ProjectedProperties != null && ProjectedProperties.Count != 0)
            {
                foreach (var projectProperty in ProjectedProperties)
                {
                    WSelectScalarExpression selectScalarExpr;
                    if (projectProperty == GremlinKeyword.TableDefaultColumnName)
                    {
                        GremlinVariableProperty defaultProjection = PivotVariable.DefaultProjection();
                        selectScalarExpr = SqlUtil.GetSelectScalarExpr(defaultProjection.ToScalarExpression(), GremlinKeyword.TableDefaultColumnName);
                        selectElements.Add(selectScalarExpr);
                    }
                    else
                    if (ProjectVariablePropertiesList.All(p => p.Item2 != projectProperty))
                    {
                        if (PivotVariable.ProjectedProperties.Contains(projectProperty))
                        {
                            WScalarExpression columnExpr =
                                PivotVariable.GetVariableProperty(projectProperty).ToScalarExpression();
                            selectScalarExpr = SqlUtil.GetSelectScalarExpr(columnExpr, projectProperty);
                            selectElements.Add(selectScalarExpr);
                        }
                        else
                        {
                            selectScalarExpr = SqlUtil.GetSelectScalarExpr(SqlUtil.GetValueExpr(null), projectProperty);
                            selectElements.Add(selectScalarExpr);
                        }
                    }
                }
            }
            else
            {
                selectElements.Add(SqlUtil.GetSelectScalarExpr(PivotVariable.DefaultProjection().ToScalarExpression(), GremlinKeyword.TableDefaultColumnName));
            }

            if (IsPopulateGremlinPath)
            {
                selectElements.Add(SqlUtil.GetSelectScalarExpr(CurrentContextPath.DefaultProjection().ToScalarExpression(), GremlinKeyword.Path));
            }
            foreach (var item in ProjectVariablePropertiesList)
            {
                selectElements.Add(SqlUtil.GetSelectScalarExpr(item.Item1.ToScalarExpression(), item.Item2));
            }
            if (selectElements.Count == 0)
            {
                if (PivotVariable is GremlinTableVariable ||
                    (PivotVariable is GremlinUnionVariable && HomeVariable is GremlinSideEffectVariable))
                {
                    selectElements.Add(SqlUtil.GetSelectScalarExpr(SqlUtil.GetStarColumnReferenceExpr()));
                }
                else if (PivotVariable.GetVariableType() == GremlinVariableType.Table)
                {
                    throw new Exception("Can't process table type");
                }
                else
                {
                    GremlinVariableProperty defaultProjection = PivotVariable.DefaultProjection();
                    selectElements.Add(SqlUtil.GetSelectScalarExpr(defaultProjection.ToScalarExpression()));
                }
            }

            return(selectElements);
        }
Esempio n. 30
0
 public GremlinBoundVertexVariable(WEdgeType inputEdgeType, GremlinVariableProperty sourceVariableProperty, GremlinVariableProperty sinkVariableProperty)
 {
     InputEdgeType          = inputEdgeType;
     SourceVariableProperty = sourceVariableProperty;
     SinkVariableProperty   = sinkVariableProperty;
 }