public GremlinUpdatePropertiesVariable(GremlinVariable updateVariable, GremlinProperty property) : base(GremlinVariableType.NULL) { UpdateVariable = updateVariable; PropertyList = new List <GremlinProperty> { property }; }
public GremlinUpdatePropertiesVariable(GremlinVariable updateVariable, GremlinProperty property) { this.UpdateVariable = updateVariable; this.PropertyList = new List <GremlinProperty> { property }; }
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); }
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); }
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); }
internal override void Property(GremlinToSqlContext currentContext, GremlinProperty property) { this.ProjectedProperties.Add(property.Key); this.EdgeProperties.Add(property); }