public GremlinUpdatePropertiesVariable(GremlinVariable updateVariable, GremlinProperty property) : base(GremlinVariableType.NULL)
 {
     UpdateVariable = updateVariable;
     PropertyList   = new List <GremlinProperty> {
         property
     };
 }
Пример #2
0
 public GremlinUpdatePropertiesVariable(GremlinVariable updateVariable, GremlinProperty property)
 {
     this.UpdateVariable = updateVariable;
     this.PropertyList   = new List <GremlinProperty> {
         property
     };
 }
Пример #3
0
        internal override GremlinToSqlContext GetContext()
        {
            GremlinToSqlContext inputContext = GetInputContext();

            HashSet <GremlinProperty> properties = new HashSet <GremlinProperty>();

            foreach (GremlinPropertyOp propertyOp in PropertyOps)
            {
                GremlinProperty property = propertyOp.ToGremlinProperty(inputContext);
                property.Cardinality = GremlinKeyword.PropertyCardinality.List;
                properties.Add(property);
            }

            if (inputContext.PivotVariable == null)
            {
                GremlinAddVVariable newVariable = new GremlinAddVVariable(null, VertexLabel, properties, true);
                inputContext.VariableList.Add(newVariable);
                inputContext.TableReferencesInFromClause.Add(newVariable);
                inputContext.SetPivotVariable(newVariable);
            }
            else
            {
                inputContext.PivotVariable.AddV(inputContext, VertexLabel, properties);
            }

            return(inputContext);
        }
 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);
 }
Пример #5
0
        public GraphTraversal2 Property(GremlinKeyword.PropertyCardinality cardinality, string key, object value,
                                        params object[] keyValues)
        {
            if (keyValues.Length % 2 != 0)
            {
                throw new Exception("The parameter of property should be even");
            }
            Dictionary <string, object> metaProperties = new Dictionary <string, object>();

            for (var i = 0; i < keyValues.Length; i += 2)
            {
                metaProperties[keyValues[i] as string] = keyValues[i + 1];
            }
            GremlinProperty property = new GremlinProperty(cardinality, key, value, metaProperties);

            AddGremlinOperator(new GremlinPropertyOp(property));
            return(this);
        }
Пример #6
0
        internal virtual void Property(GremlinToSqlContext currentContext, GremlinProperty vertexProperty)
        {
            GremlinUpdatePropertiesVariable updateVariable =
                currentContext.VariableList.Find(
                    p =>
                    (p is GremlinUpdatePropertiesVariable) &&
                    (p as GremlinUpdatePropertiesVariable).UpdateVariable == this) as GremlinUpdatePropertiesVariable;

            if (updateVariable == null)
            {
                updateVariable = new GremlinUpdatePropertiesVariable(this, vertexProperty);
                currentContext.VariableList.Add(updateVariable);
                currentContext.TableReferences.Add(updateVariable);
            }
            else
            {
                updateVariable.PropertyList.Add(vertexProperty);
            }
        }
 public GremlinPropertyOp(GremlinProperty property)
 {
     this.property = property;
 }
 internal override void Property(GremlinToSqlContext currentContext, GremlinProperty vertexProperty)
 {
     this.IsTraversalToBound = true;
     base.Property(currentContext, vertexProperty);
 }
Пример #9
0
 internal override void Property(GremlinToSqlContext currentContext, GremlinProperty property)
 {
     this.ProjectedProperties.Add(property.Key);
     this.EdgeProperties.Add(property);
 }