public GremlinHasOp(string label, string propertyKey, object value) { Label = label; PropertyKey = propertyKey; ValueOrPredicate = value; Type = GremlinHasType.HasLabelPropertyValue; }
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)); }
/// <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())); }
public GremlinHasOp(GremlinHasType type, params object[] valuesOrPredicates) { ValuesOrPredicates = new List <object>(valuesOrPredicates); Type = type; }
public GremlinHasOp(string propertyKey, GraphTraversal2 traversal) { PropertyKey = propertyKey; Traversal = traversal; Type = GremlinHasType.HasPropertyTraversal; }
public GremlinHasOp(string propertyKey, object valueOrPredicate) { PropertyKey = propertyKey; ValueOrPredicate = valueOrPredicate; Type = GremlinHasType.HasPropertyValueOrPredicate; }
public GremlinHasOp(GremlinHasType type, string propertyKey) { PropertyKey = propertyKey; Type = type; }