示例#1
0
        internal static WSchemaObjectFunctionTableReference GetFunctionTableReference(string functionName,
                                                                                      List <WScalarExpression> parameterList, string alias = null)
        {
            WSchemaObjectFunctionTableReference funcTableRef;

            switch (functionName)
            {
            case GremlinKeyword.func.Coalesce:
                funcTableRef = new WCoalesceTableReference();
                break;

            case GremlinKeyword.func.Commit:
                funcTableRef = new WCommitTableReference();
                break;

            case GremlinKeyword.func.Constant:
                funcTableRef = new WConstantReference();
                break;

            case GremlinKeyword.func.FlatMap:
                funcTableRef = new WFlatMapTableReference();
                break;

            case GremlinKeyword.func.Key:
                funcTableRef = new WKeyTableReference();
                break;

            case GremlinKeyword.func.Local:
                funcTableRef = new WLocalTableReference();
                break;

            case GremlinKeyword.func.Optional:
                funcTableRef = new WOptionalTableReference();
                break;

            case GremlinKeyword.func.Properties:
                funcTableRef = new WPropertiesTableReference();
                break;

            case GremlinKeyword.func.AllProperties:
                funcTableRef = new WAllPropertiesTableReference();
                break;

            case GremlinKeyword.func.Repeat:
                funcTableRef = new WRepeatTableReference();
                break;

            case GremlinKeyword.func.Value:
                funcTableRef = new WValueTableReference();
                break;

            case GremlinKeyword.func.Values:
                funcTableRef = new WValuesTableReference();
                break;

            case GremlinKeyword.func.AllValues:
                funcTableRef = new WAllValuesTableReference();
                break;

            case GremlinKeyword.func.Unfold:
                funcTableRef = new WUnfoldTableReference();
                break;

            case GremlinKeyword.func.Union:
                funcTableRef = new WUnionTableReference();
                break;

            case GremlinKeyword.func.Project:
                funcTableRef = new WProjectTableReference();
                break;

            case GremlinKeyword.func.AddV:
                funcTableRef = new WAddVTableReference();
                break;

            case GremlinKeyword.func.AddE:
                funcTableRef = new WAddETableReference();
                break;

            case GremlinKeyword.func.SideEffect:
                funcTableRef = new WSideEffectTableReference();
                break;

            case GremlinKeyword.func.DedupGlobal:
                funcTableRef = new WDedupGlobalTableReference();
                break;

            case GremlinKeyword.func.DedupLocal:
                funcTableRef = new WDedupLocalTableReference();
                break;

            case GremlinKeyword.func.Drop:
                funcTableRef = new WDropTableReference();
                break;

            case GremlinKeyword.func.UpdateProperties:
                funcTableRef = new WUpdatePropertiesTableReference();
                break;

            case GremlinKeyword.func.Inject:
                funcTableRef = new WInjectTableReference();
                break;

            case GremlinKeyword.func.Path:
                funcTableRef = new WPathTableReference();
                break;

            case GremlinKeyword.func.Expand:
                funcTableRef = new WExpandTableReference();
                break;

            case GremlinKeyword.func.Map:
                funcTableRef = new WMapTableReference();
                break;

            case GremlinKeyword.func.Group:
                funcTableRef = new WGroupTableReference();
                break;

            case GremlinKeyword.func.Store:
                funcTableRef = new WStoreTableReference();
                break;

            case GremlinKeyword.func.Subgraph:
                funcTableRef = new WSubgraphTableReference();
                break;

            case GremlinKeyword.func.Aggregate:
                funcTableRef = new WAggregateTableReference();
                break;

            case GremlinKeyword.func.Coin:
                funcTableRef = new WCoinTableReference();
                break;

            case GremlinKeyword.func.CountLocal:
                funcTableRef = new WCountLocalTableReference();
                break;

            case GremlinKeyword.func.MinLocal:
                funcTableRef = new WMinLocalTableReference();
                break;

            case GremlinKeyword.func.MaxLocal:
                funcTableRef = new WMaxLocalTableReference();
                break;

            case GremlinKeyword.func.MeanLocal:
                funcTableRef = new WMeanLocalTableReference();
                break;

            case GremlinKeyword.func.SumLocal:
                funcTableRef = new WSumLocalTableReference();
                break;

            case GremlinKeyword.func.OrderGlobal:
                funcTableRef = new WOrderGlobalTableReference();
                break;

            case GremlinKeyword.func.OrderLocal:
                funcTableRef = new WOrderLocalTableReference();
                break;

            case GremlinKeyword.func.Path2:
                funcTableRef = new WPath2TableReference();
                break;

            case GremlinKeyword.func.RangeGlobal:
                funcTableRef = new WRangeGlobalTableReference();
                break;

            case GremlinKeyword.func.RangeLocal:
                funcTableRef = new WRangeLocalTableReference();
                break;

            case GremlinKeyword.func.Decompose1:
                funcTableRef = new WDecomposeTableReference();
                break;

            case GremlinKeyword.func.Tree:
                funcTableRef = new WTreeTableReference();
                break;

            case GremlinKeyword.func.SimplePath:
                funcTableRef = new WSimplePathTableReference();
                break;

            case GremlinKeyword.func.CyclicPath:
                funcTableRef = new WCyclicPathTableReference();
                break;

            case GremlinKeyword.func.ValueMap:
                funcTableRef = new WValueMapTableReference();
                break;

            case GremlinKeyword.func.PropertyMap:
                funcTableRef = new WPropertyMapTableReference();
                break;

            case GremlinKeyword.func.SampleGlobal:
                funcTableRef = new WSampleGlobalTableReference();
                break;

            case GremlinKeyword.func.SampleLocal:
                funcTableRef = new WSampleLocalTableReference();
                break;

            case GremlinKeyword.func.Barrier:
                funcTableRef = new WBarrierTableReference();
                break;

            case GremlinKeyword.func.Choose:
                funcTableRef = new WChooseTableReference();
                break;

            case GremlinKeyword.func.ChooseWithOptions:
                funcTableRef = new WChooseWithOptionsTableReference();
                break;

            case GremlinKeyword.func.Select:
                funcTableRef = new WSelectTableReference();
                break;

            case GremlinKeyword.func.SelectOne:
                funcTableRef = new WSelectOneTableReference();
                break;

            case GremlinKeyword.func.SelectColumn:
                funcTableRef = new WSelectColumnTableReference();
                break;

            case GremlinKeyword.func.GraphViewId:
                funcTableRef = new WIdTableReference();
                break;

            case GremlinKeyword.func.GraphViewLabel:
                funcTableRef = new WLabelTableReference();
                break;

            case GremlinKeyword.func.V:
                funcTableRef = new WBoundNodeTableReference();
                break;

            case GremlinKeyword.func.EdgeToSourceVertex:
                funcTableRef = new WEdgeToSourceVertexTableReference();
                break;

            case GremlinKeyword.func.EdgeToSinkVertex:
                funcTableRef = new WEdgeToSinkVertexTableReference();
                break;

            case GremlinKeyword.func.EdgeToOtherVertex:
                funcTableRef = new WEdgeToOtherVertexTableReference();
                break;

            case GremlinKeyword.func.EdgeToBothVertex:
                funcTableRef = new WEdgeToBothVertexTableReference();
                break;

            case GremlinKeyword.func.VertexToForwardEdge:
                funcTableRef = new WVertexToForwardEdgeTableReference();
                break;

            case GremlinKeyword.func.VertexToBackwardEdge:
                funcTableRef = new WVertexToBackwordEdgeTableReference();
                break;

            case GremlinKeyword.func.VertexToBothEdge:
                funcTableRef = new WVertexToBothEdgeTableReference();
                break;

            case GremlinKeyword.func.Filter:
                funcTableRef = new WFilterTableReference();
                break;

            case GremlinKeyword.func.Match:
                funcTableRef = new WMatchTableReference();
                break;

            case GremlinKeyword.func.MatchStart:
                funcTableRef = new WMatchStartTableReference();
                break;

            case GremlinKeyword.func.MatchEnd:
                funcTableRef = new WMatchEndTableReference();
                break;

            default:
                throw new NotImplementedException();
            }
            funcTableRef.SchemaObject = GetSchemaObjectName(functionName);
            funcTableRef.Parameters   = parameterList;
            funcTableRef.Alias        = GetIdentifier(alias);
            return(funcTableRef);
        }
示例#2
0
        internal static WSchemaObjectFunctionTableReference GetFunctionTableReference(string functionName,
                                                                                      List <WScalarExpression> parameterList, GremlinVariable gremlinvariable, string alias = null)
        {
            WSchemaObjectFunctionTableReference funcTableRef;

            switch (functionName)
            {
            case GremlinKeyword.func.Coalesce:
                funcTableRef = new WCoalesceTableReference();
                break;

            case GremlinKeyword.func.Constant:
                funcTableRef = new WConstantReference();
                break;

            case GremlinKeyword.func.OutE:
                funcTableRef = new WBoundOutEdgeTableReference();
                break;

            case GremlinKeyword.func.InE:
                funcTableRef = new WBoundInEdgeTableReference();
                break;

            case GremlinKeyword.func.BothE:
                funcTableRef = new WBoundBothEdgeTableReference();
                break;

            case GremlinKeyword.func.FlatMap:
                funcTableRef = new WFlatMapTableReference();
                break;

            case GremlinKeyword.func.Key:
                funcTableRef = new WKeyTableReference();
                break;

            case GremlinKeyword.func.Local:
                funcTableRef = new WLocalTableReference();
                break;

            case GremlinKeyword.func.OutV:
                funcTableRef = new WBoundOutNodeTableReference();
                break;

            case GremlinKeyword.func.InV:
                funcTableRef = new WBoundOutNodeTableReference();
                break;

            case GremlinKeyword.func.OtherV:
                funcTableRef = new WBoundOutNodeTableReference();
                break;

            case GremlinKeyword.func.BothV:
                funcTableRef = new WBoundBothNodeTableReference();
                break;

            case GremlinKeyword.func.Optional:
                funcTableRef = new WOptionalTableReference();
                break;

            case GremlinKeyword.func.Properties:
                funcTableRef = new WPropertiesTableReference();
                break;

            case GremlinKeyword.func.Repeat:
                funcTableRef = new WRepeatTableReference();
                break;

            case GremlinKeyword.func.Value:
                funcTableRef = new WValueTableReference();
                break;

            case GremlinKeyword.func.Values:
                funcTableRef = new WValuesTableReference();
                break;

            case GremlinKeyword.func.Unfold:
                funcTableRef = new WUnfoldTableReference();
                break;

            case GremlinKeyword.func.Union:
                funcTableRef = new WUnionTableReference();
                break;

            case GremlinKeyword.func.Project:
                funcTableRef = new WProjectTableReference();
                break;

            case GremlinKeyword.func.AddV:
                funcTableRef = new WAddVTableReference();
                break;

            case GremlinKeyword.func.AddE:
                funcTableRef = new WAddETableReference();
                break;

            case GremlinKeyword.func.SideEffect:
                funcTableRef = new WSideEffectTableReference();
                break;

            case GremlinKeyword.func.Dedup:
                funcTableRef = new WDedupTableReference();
                break;

            case GremlinKeyword.func.DropNode:
                funcTableRef = new WDropNodeTableReference();
                break;

            case GremlinKeyword.func.DropEdge:
                funcTableRef = new WDropEdgeTableReference();
                break;

            case GremlinKeyword.func.DropProperties:
                funcTableRef = new WDropPropertiesTableReference();
                break;

            case GremlinKeyword.func.UpdateNodeProperties:
                funcTableRef = new WUpdateNodePropertiesTableReference();
                break;

            case GremlinKeyword.func.UpdateEdgeProperties:
                funcTableRef = new WUpdateEdgePropertiesTableReference();
                break;

            case GremlinKeyword.func.Inject:
                funcTableRef = new WInjectTableReference();
                break;

            case GremlinKeyword.func.Path:
                funcTableRef = new WPathTableReference();
                break;

            case GremlinKeyword.func.Expand:
                funcTableRef = new WExpandTableReference();
                break;

            case GremlinKeyword.func.Map:
                funcTableRef = new WMapTableReference();
                break;

            case GremlinKeyword.func.Group:
                funcTableRef = new WGroupTableReference();
                break;

            case GremlinKeyword.func.Store:
                funcTableRef = new WStoreTableReference();
                break;

            case GremlinKeyword.func.Aggregate:
                funcTableRef = new WAggregateTableReference();
                break;

            case GremlinKeyword.func.Coin:
                funcTableRef = new WCoinTableReference();
                break;

            case GremlinKeyword.func.CountLocal:
                funcTableRef = new WCountLocalTableReference();
                break;

            case GremlinKeyword.func.MinLocal:
                funcTableRef = new WMinLocalTableReference();
                break;

            case GremlinKeyword.func.MaxLocal:
                funcTableRef = new WMaxLocalTableReference();
                break;

            case GremlinKeyword.func.MeanLocal:
                funcTableRef = new WMeanLocalTableReference();
                break;

            case GremlinKeyword.func.SumLocal:
                funcTableRef = new WSumLocalTableReference();
                break;

            default:
                throw new NotImplementedException();
            }
            funcTableRef.SchemaObject = GetSchemaObjectName(functionName);
            funcTableRef.Parameters   = parameterList;
            funcTableRef.Alias        = GetIdentifier(alias);
            funcTableRef.Low          = gremlinvariable.Low;
            funcTableRef.High         = gremlinvariable.High;
            funcTableRef.IsLocal      = gremlinvariable.IsLocal;
            funcTableRef.IsReverse    = gremlinvariable.IsReverse;
            return(funcTableRef);
        }
示例#3
0
        internal static WSchemaObjectFunctionTableReference GetFunctionTableReference(string functionName,
                                                                                      List <WScalarExpression> parameterList, string alias = null)
        {
            WSchemaObjectFunctionTableReference funcTableRef;

            switch (functionName)
            {
            case GremlinKeyword.func.Coalesce:
                funcTableRef = new WCoalesceTableReference();
                break;

            case GremlinKeyword.func.Constant:
                funcTableRef = new WConstantReference();
                break;

            case GremlinKeyword.func.OutE:
                funcTableRef = new WBoundOutEdgeTableReference();
                break;

            case GremlinKeyword.func.InE:
                funcTableRef = new WBoundInEdgeTableReference();
                break;

            case GremlinKeyword.func.BothE:
                funcTableRef = new WBoundBothEdgeTableReference();
                break;

            case GremlinKeyword.func.FlatMap:
                funcTableRef = new WFlatMapTableReference();
                break;

            case GremlinKeyword.func.Key:
                funcTableRef = new WKeyTableReference();
                break;

            case GremlinKeyword.func.Local:
                funcTableRef = new WLocalTableReference();
                break;

            case GremlinKeyword.func.EtoV:
                funcTableRef = new WBoundOutNodeTableReference();
                break;

            case GremlinKeyword.func.BothV:
                funcTableRef = new WBoundBothNodeTableReference();
                break;

            case GremlinKeyword.func.Optional:
                funcTableRef = new WOptionalTableReference();
                break;

            case GremlinKeyword.func.Properties:
                funcTableRef = new WPropertiesTableReference();
                break;

            case GremlinKeyword.func.AllProperties:
                funcTableRef = new WAllPropertiesTableReference();
                break;

            case GremlinKeyword.func.Repeat:
                funcTableRef = new WRepeatTableReference();
                break;

            case GremlinKeyword.func.Value:
                funcTableRef = new WValueTableReference();
                break;

            case GremlinKeyword.func.Values:
                funcTableRef = new WValuesTableReference();
                break;

            case GremlinKeyword.func.Unfold:
                funcTableRef = new WUnfoldTableReference();
                break;

            case GremlinKeyword.func.Union:
                funcTableRef = new WUnionTableReference();
                break;

            case GremlinKeyword.func.Project:
                funcTableRef = new WProjectTableReference();
                break;

            case GremlinKeyword.func.AddV:
                funcTableRef = new WAddVTableReference2();
                break;

            case GremlinKeyword.func.AddE:
                funcTableRef = new WAddETableReference();
                break;

            case GremlinKeyword.func.SideEffect:
                funcTableRef = new WSideEffectTableReference();
                break;

            case GremlinKeyword.func.DedupGlobal:
                funcTableRef = new WDedupGlobalTableReference();
                break;

            case GremlinKeyword.func.DedupLocal:
                funcTableRef = new WDedupLocalTableReference();
                break;

            case GremlinKeyword.func.Drop:
                funcTableRef = new WDropTableReference();
                break;

            case GremlinKeyword.func.UpdateProperties:
                funcTableRef = new WUpdatePropertiesTableReference();
                break;

            case GremlinKeyword.func.Inject:
                funcTableRef = new WInjectTableReference();
                break;

            case GremlinKeyword.func.Path:
                funcTableRef = new WPathTableReference();
                break;

            case GremlinKeyword.func.Expand:
                funcTableRef = new WExpandTableReference();
                break;

            case GremlinKeyword.func.Map:
                funcTableRef = new WMapTableReference();
                break;

            case GremlinKeyword.func.Group:
                funcTableRef = new WGroupTableReference();
                break;

            case GremlinKeyword.func.Store:
                funcTableRef = new WStoreTableReference();
                break;

            case GremlinKeyword.func.Aggregate:
                funcTableRef = new WAggregateTableReference();
                break;

            case GremlinKeyword.func.Coin:
                funcTableRef = new WCoinTableReference();
                break;

            case GremlinKeyword.func.CountLocal:
                funcTableRef = new WCountLocalTableReference();
                break;

            case GremlinKeyword.func.MinLocal:
                funcTableRef = new WMinLocalTableReference();
                break;

            case GremlinKeyword.func.MaxLocal:
                funcTableRef = new WMaxLocalTableReference();
                break;

            case GremlinKeyword.func.MeanLocal:
                funcTableRef = new WMeanLocalTableReference();
                break;

            case GremlinKeyword.func.SumLocal:
                funcTableRef = new WSumLocalTableReference();
                break;

            case GremlinKeyword.func.OrderGlobal:
                funcTableRef = new WOrderGlobalTableReference();
                break;

            case GremlinKeyword.func.OrderLocal:
                funcTableRef = new WOrderLocalTableReference();
                break;

            case GremlinKeyword.func.Path2:
                funcTableRef = new WPath2TableReference();
                break;

            case GremlinKeyword.func.Range:
                funcTableRef = new WRangeTableReference();
                break;

            case GremlinKeyword.func.Decompose1:
                funcTableRef = new WDecompose1TableReference();
                break;

            case GremlinKeyword.func.Tree:
                funcTableRef = new WTreeTableReference();
                break;

            case GremlinKeyword.func.SimplePath:
                funcTableRef = new WSimplePathTableReference();
                break;

            case GremlinKeyword.func.CyclicPath:
                funcTableRef = new WCyclicPathTableReference();
                break;

            case GremlinKeyword.func.ValueMap:
                funcTableRef = new WValueMapTableReference();
                break;

            case GremlinKeyword.func.PropertyMap:
                funcTableRef = new WPropertyMapTableReference();
                break;

            case GremlinKeyword.func.SampleGlobal:
                funcTableRef = new WSampleGlobalTableReference();
                break;

            case GremlinKeyword.func.SampleLocal:
                funcTableRef = new WSampleLocalTableReference();
                break;

            case GremlinKeyword.func.Barrier:
                funcTableRef = new WBarrierTableReference();
                break;

            default:
                throw new NotImplementedException();
            }
            funcTableRef.SchemaObject = GetSchemaObjectName(functionName);
            funcTableRef.Parameters   = parameterList;
            funcTableRef.Alias        = GetIdentifier(alias);
            return(funcTableRef);
        }