コード例 #1
0
        //internal virtual void Sack() //Deprecated
        //internal virtual void Sack(BiFunction<V, U, V>) sackOperator) //Deprecated
        //internal virtual void Sack(BiFunction<V, U, V>) sackOperator, string, elementPropertyKey) //Deprecated

        internal virtual void Sample(GremlinToSqlContext currentContext, GremlinKeyword.Scope scope, int amountToSample, GremlinToSqlContext probabilityContext)
        {
            GremlinSampleVariable newVariable = new GremlinSampleVariable(scope, amountToSample, probabilityContext);

            currentContext.VariableList.Add(newVariable);
            currentContext.TableReferences.Add(newVariable);
        }
コード例 #2
0
 public GremlinAddETableVariable(GremlinVariable inputVariable, string edgeLabel, List <GremlinProperty> edgeProperties, GremlinToSqlContext fromContext, GremlinToSqlContext toContext)
 {
     EdgeProperties    = edgeProperties;
     EdgeLabel         = edgeLabel;
     InputVariable     = inputVariable;
     EdgeType          = WEdgeType.OutEdge;
     OtherVIndex       = 1;
     FromVertexContext = fromContext;
     ToVertexContext   = toContext;
 }
コード例 #3
0
 internal override void OutE(GremlinToSqlContext currentContext, List <string> edgeLabels)
 {
     currentContext.OutE(this, edgeLabels);
 }
コード例 #4
0
 public GremlinTreeVariable(GremlinToSqlContext subqueryContext, GremlinVariable pathVariable) : base(subqueryContext, GremlinVariableType.Tree)
 {
     PathVariable = pathVariable;
 }
コード例 #5
0
 public GremlinFoldVariable(GremlinToSqlContext subqueryContext) : base(subqueryContext, GremlinVariableType.List)
 {
     FoldVariable = subqueryContext.PivotVariable;
 }
コード例 #6
0
 internal override void Values(GremlinToSqlContext currentContext, List <string> propertyKeys)
 {
     currentContext.Values(this, propertyKeys);
 }
コード例 #7
0
 public GremlinDerivedTableVariable(GremlinToSqlContext subqueryContext, GremlinVariableType variableType) : base(variableType)
 {
     this.SubqueryContext = subqueryContext;
 }
コード例 #8
0
 public GremlinOptionalPropertyVariable(GremlinToSqlContext context, GremlinVariable inputVariable)
     : base(context, inputVariable, GremlinVariableType.Property)
 {
 }
コード例 #9
0
 internal override void Key(GremlinToSqlContext currentContext)
 {
     currentContext.Key(this);
 }
コード例 #10
0
 public GremlinOptionalVertexVariable(GremlinToSqlContext context, GremlinVariable inputVariable)
     : base(context, inputVariable, GremlinVariableType.Vertex)
 {
 }
コード例 #11
0
 public GremlinOptionalScalarVariable(GremlinToSqlContext context, GremlinVariable inputVariable)
     : base(context, inputVariable, GremlinVariableType.Scalar)
 {
 }
コード例 #12
0
 public GremlinAggregateVariable(GremlinToSqlContext projectContext, string sideEffectKey)
 {
     this.ProjectContext = projectContext;
     this.SideEffectKey  = sideEffectKey;
 }
コード例 #13
0
        internal override GremlinToSqlContext GetContext()
        {
            GremlinToSqlContext inputContext = GetInputContext();

            if (inputContext.PivotVariable == null)
            {
                throw new TranslationException("The PivotVariable of has()-step can't be null.");
            }

            switch (Type)
            {
            //has(key)
            case GremlinHasType.HasProperty:
                inputContext.PivotVariable.Has(inputContext, PropertyKey);
                break;

            //hasNot(key)
            case GremlinHasType.HasNotProperty:
                inputContext.PivotVariable.HasNot(inputContext, PropertyKey);
                break;

            //has(key, value) | has(key, predicate)
            case GremlinHasType.HasPropertyValueOrPredicate:
                inputContext.PivotVariable.Has(inputContext, PropertyKey, ValueOrPredicate);
                break;

            //has(key, traversal)
            case GremlinHasType.HasPropertyTraversal:
                Traversal.GetStartOp().InheritedVariableFromParent(inputContext);
                if (Traversal.GetStartOp() is GremlinParentContextOp)
                {
                    if (Traversal.GremlinTranslationOpList.Count > 1)
                    {
                        Traversal.InsertGremlinOperator(1, new GremlinValuesOp(PropertyKey));
                    }
                    else
                    {
                        Traversal.AddGremlinOperator(new GremlinValuesOp(PropertyKey));
                    }
                }
                GremlinToSqlContext hasContext = Traversal.GetEndOp().GetContext();
                inputContext.AllTableVariablesInWhereClause.AddRange(hasContext.FetchAllTableVars());
                inputContext.AddPredicate(hasContext.ToSqlBoolean());
                break;

            //has(label, key, value) | has(label, key, predicate)
            case GremlinHasType.HasLabelPropertyValue:
                inputContext.PivotVariable.Has(inputContext, GremlinKeyword.Label, Label);
                inputContext.PivotVariable.Has(inputContext, PropertyKey, ValueOrPredicate);
                break;

            //hasId(values)
            case GremlinHasType.HasId:
            case GremlinHasType.HasLabel:
                inputContext.PivotVariable.HasIdOrLabel(inputContext, Type, ValuesOrPredicates);
                break;

            //===================================================================
            //hasKey(values) || hasValue(values)
            case GremlinHasType.HasKey:
            case GremlinHasType.HasValue:
                inputContext.PivotVariable.HasKeyOrValue(inputContext, Type, ValuesOrPredicates);
                break;
            }
            return(inputContext);
        }
コード例 #14
0
 internal virtual void Select(GremlinToSqlContext currentContext, GremlinKeyword.Pop pop, List <string> selectKeys)
 {
     throw new NotImplementedException();
 }
コード例 #15
0
 internal override void HasLabel(GremlinToSqlContext currentContext, List <object> values)
 {
     currentContext.HasLabel(this, values);
 }
コード例 #16
0
 internal override void Value(GremlinToSqlContext currentContext)
 {
     currentContext.Value(this);
 }
コード例 #17
0
 internal override void HasLabel(GremlinToSqlContext currentContext, Predicate predicate)
 {
     currentContext.HasLabel(this, predicate);
 }
コード例 #18
0
 public GremlinOptionalTableVariable(GremlinToSqlContext context, GremlinVariable inputVariable)
     : base(context, inputVariable, GremlinVariableType.Table)
 {
 }
コード例 #19
0
 public GremlinStoreVariable(GremlinToSqlContext projectContext, string sideEffectKey)
 {
     ProjectContext = projectContext;
     SideEffectKey  = sideEffectKey;
     Labels.Add(sideEffectKey);
 }
コード例 #20
0
 internal override void OtherV(GremlinToSqlContext currentContext)
 {
     currentContext.OtherV(this);
 }
コード例 #21
0
 public GremlinSumVariable(GremlinToSqlContext subqueryContext) : base(subqueryContext, GremlinVariableType.Scalar)
 {
 }
コード例 #22
0
 internal override void BothV(GremlinToSqlContext currentContext)
 {
     currentContext.BothV(this);
 }
コード例 #23
0
        }                                                              // such as aggregate("a"), sotre("a"), as("a")

        public GremlinCapVariable(GremlinToSqlContext subqueryContext, List <GremlinVariable> sideEffectVariables, List <string> sideEffectKeys)
            : base(subqueryContext, GremlinVariableType.List)
        {
            SideEffectKeys      = sideEffectKeys;
            SideEffectVariables = sideEffectVariables;
        }
コード例 #24
0
 internal override void Has(GremlinToSqlContext currentContext, string propertyKey, GremlinToSqlContext propertyContext)
 {
     currentContext.Has(this, propertyKey, propertyContext);
 }
コード例 #25
0
 public GremlinLocalVariable(GremlinToSqlContext localContext, GremlinVariableType variableType)
     : base(variableType)
 {
     LocalContext = localContext;
     LocalContext.HomeVariable = this;
 }
コード例 #26
0
 internal override void Has(GremlinToSqlContext currentContext, string label, string propertyKey, object value)
 {
     currentContext.Has(this, label, propertyKey, value);
 }
コード例 #27
0
 public GremlinLocalVariable(GremlinToSqlContext localContext, GremlinVariableType variableType)
     : base(variableType)
 {
     this.LocalContext = localContext;
 }
コード例 #28
0
 internal override void Has(GremlinToSqlContext currentContext, string label, string propertyKey, Predicate predicate)
 {
     currentContext.Has(this, label, propertyKey, predicate);
 }
コード例 #29
0
 internal override void Drop(GremlinToSqlContext currentContext)
 {
     currentContext.DropVertex(this);
 }
コード例 #30
0
 internal virtual void Path(GremlinToSqlContext currentContext, List <GraphTraversal2> byList)
 {
     currentContext.SetPivotVariable(generatePath(currentContext, byList));
 }