Ejemplo n.º 1
0
 internal override void PopulateLocalPath()
 {
     if (ProjectedProperties.Contains(GremlinKeyword.Path))
     {
         return;
     }
     ProjectedProperties.Add(GremlinKeyword.Path);
     this.OptionalContext.PopulateLocalPath();
     this.LocalPathLengthLowerBound = 0;
 }
Ejemplo n.º 2
0
        internal override void Populate(string property)
        {
            if (ProjectedProperties.Contains(property))
            {
                return;
            }
            ProjectedProperties.Add(property);

            UnfoldVariable.Populate(property);
        }
Ejemplo n.º 3
0
        internal override void Populate(string property)
        {
            if (ProjectedProperties.Contains(property))
            {
                return;
            }
            base.Populate(property);

            RealVariable.Populate(property);
        }
        internal override void Populate(string property)
        {
            if (ProjectedProperties.Contains(property))
            {
                return;
            }
            base.Populate(property);

            SubqueryContext.Populate(property);
        }
Ejemplo n.º 5
0
        internal override void Populate(string property)
        {
            if (ProjectedProperties.Contains(property))
            {
                return;
            }
            base.Populate(property);

            InputVariable.Populate(property);
            OptionalContext.Populate(property);
        }
Ejemplo n.º 6
0
 internal override void PopulateLocalPath()
 {
     if (ProjectedProperties.Contains(GremlinKeyword.Path))
     {
         return;
     }
     ProjectedProperties.Add(GremlinKeyword.Path);
     foreach (var context in UnionContextList)
     {
         context.PopulateLocalPath();
     }
 }
        internal override void Populate(string property)
        {
            if (ProjectedProperties.Contains(property))
            {
                return;
            }
            base.Populate(property);

            foreach (var context in CoalesceContextList)
            {
                context.Populate(property);
            }
        }
 internal override void Property(GremlinToSqlContext currentContext, GremlinProperty vertexProperty)
 {
     vertexProperty.Cardinality = GremlinKeyword.PropertyCardinality.list;
     if (PropertyFromAddVParameters.ContainsKey(vertexProperty.Key))
     {
         foreach (var property in PropertyFromAddVParameters[vertexProperty.Key])
         {
             VertexProperties.Remove(property);
         }
     }
     ProjectedProperties.Add(vertexProperty.Key);
     VertexProperties.Add(vertexProperty);
 }
Ejemplo n.º 9
0
        internal override void Populate(string property)
        {
            if (ProjectedProperties.Contains(property))
            {
                return;
            }
            base.Populate(property);

            foreach (var variable in GremlinVariableList)
            {
                variable.Populate(property);
            }
        }
        internal override void Populate(string property)
        {
            if (ProjectedProperties.Contains(property))
            {
                return;
            }
            base.Populate(property);

            foreach (var variableList in BrachVariableList)
            {
                foreach (var variable in variableList)
                {
                    variable.BottomUpPopulate(ParentVariable, property, Label + "_" + property);
                }
            }
        }
Ejemplo n.º 11
0
        internal override void Populate(string property)
        {
            RealVariable.Populate(property);

            if (ProjectedProperties.Contains(property))
            {
                return;
            }
            switch (GetVariableType())
            {
            case GremlinVariableType.Vertex:
                if (GremlinUtil.IsEdgeProperty(property))
                {
                    return;
                }
                break;

            case GremlinVariableType.Edge:
                if (GremlinUtil.IsVertexProperty(property))
                {
                    return;
                }
                break;

            case GremlinVariableType.Scalar:
                if (property != GremlinKeyword.ScalarValue)
                {
                    return;
                }
                break;

            case GremlinVariableType.Property:
                if (property != GremlinKeyword.PropertyValue)
                {
                    return;
                }
                break;
            }
            base.Populate(property);

            if (!PropertiesMap.ContainsKey(property))
            {
                string columnName = SelectKey + "_" + property;
                RealVariable.BottomUpPopulate(AttachedVariable, property, columnName);
                PropertiesMap[property] = columnName;
            }
        }
Ejemplo n.º 12
0
        internal override void Populate(string property)
        {
            if (ProjectedProperties.Contains(property))
            {
                return;
            }
            base.Populate(property);

            InputVariable.Populate(property);
            if (SelectedVariableList.Exists(p => p.Item1 != property))
            {
                RepeatContext.Populate(property);
            }
            else
            {
                RepeatContext.Populate(property);
            }
        }
Ejemplo n.º 13
0
        internal void PopulateLocalPath()
        {
            if (ContextLocalPath != null)
            {
                return;
            }
            ProjectedProperties.Add(GremlinKeyword.Path);

            foreach (var step in StepList)
            {
                step.PopulateLocalPath();
            }

            GremlinLocalPathVariable newVariable = new GremlinLocalPathVariable(StepList);

            VariableList.Add(newVariable);
            TableReferences.Add(newVariable);
            ContextLocalPath = newVariable;
        }
Ejemplo n.º 14
0
 internal override void PopulateLocalPath()
 {
     if (ProjectedProperties.Contains(GremlinKeyword.Path))
     {
         return;
     }
     ProjectedProperties.Add(GremlinKeyword.Path);
     if (PredicateContext != null)
     {
         TrueChoiceContext.PopulateLocalPath();
         FalseChocieContext.PopulateLocalPath();
     }
     else
     {
         foreach (var option in Options)
         {
             option.Value.PopulateLocalPath();
         }
     }
 }
Ejemplo n.º 15
0
        internal override void Populate(string property)
        {
            if (ProjectedProperties.Contains(property))
            {
                return;
            }
            switch (GetVariableType())
            {
            case GremlinVariableType.Vertex:
                if (GremlinUtil.IsEdgeProperty(property))
                {
                    return;
                }
                break;

            case GremlinVariableType.Edge:
                if (GremlinUtil.IsVertexProperty(property))
                {
                    return;
                }
                break;

            case GremlinVariableType.VertexProperty:
                if (GremlinUtil.IsVertexProperty(property) || GremlinUtil.IsEdgeProperty(property))
                {
                    return;
                }
                break;

            case GremlinVariableType.Scalar:
            case GremlinVariableType.Property:
                if (property != GremlinKeyword.TableDefaultColumnName)
                {
                    return;
                }
                break;
            }
            base.Populate(property);
        }
Ejemplo n.º 16
0
        public GremlinAddVVariable(string vertexLabel, List <GremlinProperty> vertexProperties, bool isFirstTableReference = false)
        {
            VertexProperties      = new List <GremlinProperty>(vertexProperties);
            VertexLabel           = vertexLabel;
            IsFirstTableReference = isFirstTableReference;
            ProjectedProperties.Add(GremlinKeyword.Label);

            PropertyFromAddVParameters = new Dictionary <string, List <GremlinProperty> >();
            foreach (var property in vertexProperties)
            {
                ProjectedProperties.Add(property.Key);
                if (PropertyFromAddVParameters.ContainsKey(property.Key))
                {
                    PropertyFromAddVParameters[property.Key].Add(property);
                }
                else
                {
                    PropertyFromAddVParameters[property.Key] = new List <GremlinProperty> {
                        property
                    };
                }
            }
        }
Ejemplo n.º 17
0
 internal override void PopulateLocalPath()
 {
     if (ProjectedProperties.Contains(GremlinKeyword.Path))
     {
         return;
     }
     ProjectedProperties.Add(GremlinKeyword.Path);
     if (this.PredicateContext != null)
     {
         this.TrueChoiceContext.PopulateLocalPath();
         this.FalseChocieContext.PopulateLocalPath();
         this.LocalPathLengthLowerBound = Math.Min(this.TrueChoiceContext.MinPathLength,
                                                   this.FalseChocieContext.MinPathLength);
     }
     else
     {
         this.LocalPathLengthLowerBound = Int32.MaxValue;
         foreach (var option in this.Options)
         {
             option.Value.PopulateLocalPath();
             this.LocalPathLengthLowerBound = Math.Min(this.LocalPathLengthLowerBound, option.Value.MinPathLength);
         }
     }
 }
 public GremlinDerivedTableVariable(GremlinToSqlContext subqueryContext)
 {
     SubqueryContext = subqueryContext;
     ProjectedProperties.Add(GremlinKeyword.ScalarValue);
 }
Ejemplo n.º 19
0
 public GremlinInjectVariable(GremlinVariable inputVariable, object injection) : base(GremlinVariableType.Table)
 {
     InputVariable = inputVariable;
     Injection     = injection;
     ProjectedProperties.Add(GremlinKeyword.TableDefaultColumnName);
 }
Ejemplo n.º 20
0
 internal override void Property(GremlinToSqlContext currentContext, List <object> properties)
 {
     ProjectedProperties.Add(properties.First() as string);
     VertexProperties.AddRange(properties);
 }
Ejemplo n.º 21
0
 internal override void Property(GremlinToSqlContext currentContext, GremlinProperty property)
 {
     ProjectedProperties.Add(property.Key);
     EdgeProperties.Add(property);
 }