public GremlinOrderVariable(GremlinVariable inputVariable, List <Tuple <GremlinToSqlContext, IComparer> > byModulatingList, GremlinKeyword.Scope scope) : base(inputVariable.GetVariableType()) { this.ByModulatingList = byModulatingList; this.Scope = scope; this.InputVariable = inputVariable; }
internal void DropProperties(GremlinVariable belongToVariable, List <string> PropertyKeys) { List <object> properties = new List <object>(); foreach (var propertyKey in PropertyKeys) { properties.Add(propertyKey); properties.Add(null); } if (PropertyKeys.Count == 0) { properties.Add(GremlinKeyword.Star); properties.Add(null); } GremlinUpdatePropertiesVariable dropVariable = null; switch (belongToVariable.GetVariableType()) { case GremlinVariableType.Vertex: dropVariable = new GremlinUpdateVertexPropertiesVariable(belongToVariable, properties); break; case GremlinVariableType.Edge: dropVariable = new GremlinUpdateEdgePropertiesVariable(belongToVariable, properties); break; } VariableList.Add(dropVariable); TableReferences.Add(dropVariable); SetPivotVariable(dropVariable); }
public GremlinUnfoldVariable(GremlinVariable unfoldVariable) : base( unfoldVariable.GetVariableType() == GremlinVariableType.Map ? GremlinVariableType.MapEntry : GremlinVariableType.Unknown) { this.UnfoldVariable = unfoldVariable; }
public GremlinSampleVariable(GremlinVariable inputVariable, GremlinKeyword.Scope scope, int amountToSample, GremlinToSqlContext probabilityContext) : base(inputVariable.GetVariableType()) { this.InputVariable = inputVariable; this.Scope = scope; this.AmountToSample = amountToSample; this.ProbabilityContext = probabilityContext; }
public GremlinDedupVariable(GremlinVariable inputVariable, List <GremlinVariable> dedupVariables, GremlinToSqlContext dedupContext, GremlinKeyword.Scope scope) : base(inputVariable.GetVariableType()) { this.InputVariable = inputVariable; this.DedupVariables = new List <GremlinVariable>(dedupVariables); this.DedupContext = dedupContext; this.Scope = scope; }
public GremlinEdgeToVertexVariable(GremlinVariable edgeVariable) { GremlinVariableType inputVariableType = edgeVariable.GetVariableType(); if (!(inputVariableType <= GremlinVariableType.Unknown && inputVariableType != GremlinVariableType.Vertex)) { throw new SyntaxErrorException("The inputVariable of VertexToEdgeVariable must be a Edge"); } this.EdgeVariable = edgeVariable; }
public GremlinMeanLocalVariable(GremlinVariable inputVariable) { GremlinVariableType inputVariableType = inputVariable.GetVariableType(); if (!(inputVariableType == GremlinVariableType.List || GremlinVariableType.NULL <= inputVariableType && inputVariableType <= GremlinVariableType.Unknown)) { throw new SyntaxErrorException("The inputVariable of mean(local) can not be " + inputVariableType); } this.InputVariable = inputVariable; }
public GremlinLabelVariable(GremlinVariable projectVariable) { GremlinVariableType inputVariableType = projectVariable.GetVariableType(); if (!(inputVariableType <= GremlinVariableType.Unknown)) { throw new SyntaxErrorException("The inputVariable of label() can not be " + inputVariableType); } this.ProjectVariable = projectVariable; }
public GremlinValuesVariable(GremlinVariable projectVariable, List <string> propertyKeys) { GremlinVariableType inputVariableType = projectVariable.GetVariableType(); if (!(inputVariableType <= GremlinVariableType.Unknown)) { throw new SyntaxErrorException("The inputVariable of values() can not be " + inputVariableType); } this.ProjectVariable = projectVariable; this.PropertyKeys = new List <string>(propertyKeys); }
public GremlinPropertyMapVariable(GremlinVariable inputVariable, List <string> propertyKeys) { GremlinVariableType inputVariableType = inputVariable.GetVariableType(); if (!(inputVariableType <= GremlinVariableType.Unknown)) { throw new SyntaxErrorException("The inputVariable of propertyMap() can not be " + inputVariableType); } this.InputVariable = inputVariable; this.PropertyKeys = propertyKeys; }
public GremlinIdVariable(GremlinVariable projectVariable) { GremlinVariableType inputVariableType = projectVariable.GetVariableType(); if (!(inputVariableType <= GremlinVariableType.Unknown || inputVariableType == GremlinVariableType.VertexProperty || inputVariableType == GremlinVariableType.Property)) { throw new SyntaxErrorException("The inputVariable of id() can not be " + inputVariableType); } this.ProjectVariable = projectVariable; }
public GremlinPropertiesVariable(GremlinVariable inputVariable, List <string> propertyKeys) { GremlinVariableType inputVariableType = inputVariable.GetVariableType(); if (!(inputVariableType <= GremlinVariableType.Unknown || inputVariableType == GremlinVariableType.VertexProperty)) { throw new SyntaxErrorException("The inputVariable of properties() can not be " + inputVariableType); } this.InputVariable = inputVariable; this.PropertyKeys = new List <string>(propertyKeys); }
public GremlinSelectColumnVariable(GremlinVariable inputVariable, GremlinKeyword.Column column) : base(GremlinVariableType.Unknown) { GremlinVariableType inputVariableType = inputVariable.GetVariableType(); if (!(GremlinVariableType.NULL <= inputVariableType && inputVariableType <= GremlinVariableType.Map || inputVariableType == GremlinVariableType.Path || inputVariableType == GremlinVariableType.Tree)) { throw new SyntaxErrorException("The inputVariable of select() can not be " + inputVariableType); } this.InputVariable = inputVariable; this.Column = column; }
public GremlinValueMapVariable(GremlinVariable inputVariable, bool isIncludeTokens, List <string> propertyKeys) { GremlinVariableType inputVariableType = inputVariable.GetVariableType(); if (!(inputVariableType <= GremlinVariableType.Unknown)) { throw new SyntaxErrorException("The inputVariable of valueMap() can not be " + inputVariableType); } this.InputVariable = inputVariable; this.IsIncludeTokens = isIncludeTokens; this.PropertyKeys = propertyKeys; }
public static GremlinRepeatVariable Create(GremlinVariable inputVariable, GremlinToSqlContext repeatContext, RepeatCondition repeatCondition) { if (repeatContext.PivotVariable.GetVariableType() == inputVariable.GetVariableType()) { switch (inputVariable.GetVariableType()) { case GremlinVariableType.Vertex: return(new GremlinRepeatVertexVariable(inputVariable, repeatContext, repeatCondition)); case GremlinVariableType.Edge: return(new GremlinRepeatEdgeVariable(inputVariable, repeatContext, repeatCondition)); case GremlinVariableType.Scalar: return(new GremlinRepeatScalarVariable(inputVariable, repeatContext, repeatCondition)); case GremlinVariableType.Property: return(new GremlinRepeatPropertyVariable(inputVariable, repeatContext, repeatCondition)); } } return(new GremlinRepeatTableVariable(inputVariable, repeatContext, repeatCondition)); }
public static GremlinContextVariable Create(GremlinVariable contextVariable) { switch (contextVariable.GetVariableType()) { case GremlinVariableType.Vertex: return(new GremlinContextVertexVariable(contextVariable)); case GremlinVariableType.Edge: return(new GremlinContextEdgeVariable(contextVariable)); case GremlinVariableType.Scalar: return(new GremlinContextScalarVariable(contextVariable)); case GremlinVariableType.Property: return(new GremlinContextPropertyVariable(contextVariable)); } return(new GremlinContextTableVariable(contextVariable)); }
public static GremlinOptionalVariable Create(GremlinVariable inputVariable, GremlinToSqlContext context) { if (inputVariable.GetVariableType() == context.PivotVariable.GetVariableType()) { switch (context.PivotVariable.GetVariableType()) { case GremlinVariableType.Vertex: return(new GremlinOptionalVertexVariable(context, inputVariable)); case GremlinVariableType.Edge: return(new GremlinOptionalEdgeVariable(context, inputVariable)); case GremlinVariableType.Scalar: return(new GremlinOptionalScalarVariable(context, inputVariable)); case GremlinVariableType.Property: return(new GremlinOptionalPropertyVariable(context, inputVariable)); } } return(new GremlinOptionalTableVariable(context, inputVariable)); }
public static GremlinGhostVariable Create(GremlinVariable realVariable, GremlinVariable attachedVariable, string label) { if (realVariable is GremlinGhostVariable) { return(realVariable as GremlinGhostVariable); } switch (realVariable.GetVariableType()) { case GremlinVariableType.Vertex: return(new GremlinGhostVertexVariable(realVariable, attachedVariable, label)); case GremlinVariableType.Edge: return(new GremlinGhostEdgeVariable(realVariable, attachedVariable, label)); case GremlinVariableType.Scalar: return(new GremlinGhostScalarVariable(realVariable, attachedVariable, label)); case GremlinVariableType.Property: return(new GremlinGhostPropertyVariable(realVariable, attachedVariable, label)); } return(new GremlinGhostVariable(realVariable, attachedVariable, label)); }
public GremlinCoinVariable(GremlinVariable inputVariable, double probability) : base(inputVariable.GetVariableType()) { this.Probability = probability; }
public GremlinOrderLocalInitVariable(GremlinVariable inputVariable) : base(inputVariable.GetVariableType()) { this.VariableName = GremlinKeyword.Compose1TableDefaultName; }
public GremlinInjectVariable(GremlinVariable inputVariable, object injection) : base( inputVariable?.GetVariableType() == GremlinVariableType.Scalar ? GremlinVariableType.Scalar : GremlinVariableType.Mixed) { this.InputVariable = inputVariable; this.Injection = injection; }
public GremlinBarrierVariable(GremlinVariable inputVariable) : base(inputVariable.GetVariableType()) { }
public GremlinCommitVariable(GremlinVariable inputVariable) : base(inputVariable.GetVariableType()) { }
public GremlinRangeVariable(GremlinVariable inputVariable, int low, int high, GremlinKeyword.Scope scope, bool isReverse) : base(inputVariable.GetVariableType()) { this.InputVariable = inputVariable; this.Low = low; this.High = high; this.Scope = scope; this.IsReverse = isReverse; }
public GremlinFilterVariable(GremlinVariable inputVariable, WBooleanExpression newPredicate) : base(inputVariable.GetVariableType()) { this.Predicate = newPredicate; }