• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Plugin.GQLPluginManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中sones.GraphQL.GQL.Manager.Plugin.GQLPluginManager的典型用法代码示例。如果您正苦于以下问题:C# GQLPluginManager类的具体用法?C# GQLPluginManager怎么用?C# GQLPluginManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GQLPluginManager类属于sones.GraphQL.GQL.Manager.Plugin命名空间,在下文中一共展示了GQLPluginManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Execute

        public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
        {
            _query = myQuery;

            var vertexType = myGraphDB.GetVertexType<IVertexType>(
                mySecurityToken,
                myTransactionToken,
                new RequestGetVertexType(_typeName),
                (stats, vType) => vType);

            _WhereExpression.Validate(myPluginManager, myGraphDB, mySecurityToken, myTransactionToken, vertexType);

            var expressionGraph = _WhereExpression.Calculon(myPluginManager, myGraphDB, mySecurityToken,
                                                            myTransactionToken,
                                                            new CommonUsageGraph(myGraphDB, mySecurityToken,
                                                                                 myTransactionToken));

            var toBeDeletedVertices =
                expressionGraph.Select(
                    new LevelKey(vertexType.ID, myGraphDB, mySecurityToken, myTransactionToken),
                    null, true);

            //TODO: do sth that is better than that: ew RequestDelete(new RequestGetVertices(_typeName, toBeDeletedVertices.Select(_ => _.VertexID))).
            return myGraphDB.Delete<QueryResult>(
                mySecurityToken,
                myTransactionToken,
                new RequestDelete(new RequestGetVertices(_typeName, toBeDeletedVertices.Select(_ => _.VertexID))).AddAttributes(_toBeDeletedAttributes),
                CreateQueryResult);
        }
开发者ID:loubo,项目名称:sones,代码行数:29,代码来源:DeleteNode.cs


示例2: Execute

        public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
        {
            var sw = Stopwatch.StartNew();

            QueryResult result = null;

            if (_DumpFormat.ToString().ToUpper().Equals("GQL"))
            {
                var plugin = myPluginManager.GetAndInitializePlugin<IGraphDBExport>("GQLEXPORT");

                if (plugin != null)
                {
                    result = plugin.Export(_DumpDestination, _DumpableGrammar, myGraphDB, myGraphQL, mySecurityToken, myTransactionToken, _TypesToDump, _DumpType);
                }
            }

            sw.Stop();

            if (result != null)
            {
                return new QueryResult(myQuery, _DumpFormat.ToString(), (ulong)sw.ElapsedMilliseconds, result.TypeOfResult, result.Vertices, result.Error);
            }
            else
                return null;
        }
开发者ID:loubo,项目名称:sones,代码行数:25,代码来源:DumpNode.cs


示例3: Execute

        public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
        {
            Query = myQuery;

            var indexDef = new IndexPredefinition(_IndexName);
            indexDef.SetIndexType(_IndexType);
            indexDef.SetVertexType(_DBType);
            indexDef.SetEdition(_IndexEdition);

            //to be indices attributes
            foreach (var aIndexedProperty in _AttributeList)
            {
                indexDef.AddProperty(aIndexedProperty.IndexAttribute.ContentString);
            }

            //options for the index
            if (_options != null)
            {
                foreach (var aKV in _options)
                {
                    indexDef.AddOption(aKV.Key, aKV.Value);
                }
            }

            return myGraphDB.CreateIndex<QueryResult>(mySecurityToken, myTransactionToken, new RequestCreateIndex(indexDef), GenerateResult);
        }
开发者ID:loubo,项目名称:sones,代码行数:26,代码来源:CreateIndexNode.cs


示例4: Execute

        public override QueryResult Execute(IGraphDB myGraphDB, 
            IGraphQL myGraphQL,
            GQLPluginManager myPluginManager,
            String myQuery,
            SecurityToken mySecurityToken,
            Int64 myTransactionToken)
        {
            _queryString = myQuery;

            QueryResult result;

            try
            {
                result = myGraphDB.Insert<QueryResult>(
                        mySecurityToken,
                        myTransactionToken,
                        CreateRequest(myPluginManager,
                                        myGraphDB,
                                        mySecurityToken,
                                        myTransactionToken),
                        CreateQueryResult);
            }
            catch (ASonesException e)
            {
                result = new QueryResult(_queryString, SonesGQLConstants.GQL, 0, ResultType.Failed, null, e);
            }

            return result;
        }
开发者ID:ramz,项目名称:sones,代码行数:29,代码来源:InsertNode.cs


示例5: GetResult

        public override QueryResult GetResult(
            GQLPluginManager myPluginManager,
            IGraphDB myGraphDB,
            SecurityToken mySecurityToken,
            TransactionToken myTransactionToken)
        {
            var resultingVertices = new List<IVertexView>();
            ASonesException error = null;

            #region Specific index

            var request = new RequestDescribeIndex(_TypeName, _IndexName, _IndexEdition);

            var indices = myGraphDB.DescribeIndex<IEnumerable<IIndexDefinition>>(mySecurityToken, myTransactionToken, request, (stats, definitions) => definitions);

            if (indices == null)
            {
                error = new IndexTypeDoesNotExistException(_TypeName, _IndexName);
            }

            if (String.IsNullOrEmpty(_IndexEdition))
            {
                //_IndexEdition = DBConstants.DEFAULTINDEX;
            }

            resultingVertices = new List<IVertexView>() { GenerateOutput(indices, _IndexName) };

            #endregion

            if(error != null)
                return new QueryResult("", SonesGQLConstants.GQL, 0L, ResultType.Failed, resultingVertices, error);
            else
                return new QueryResult("", SonesGQLConstants.GQL, 0L, ResultType.Successful, resultingVertices);
        }
开发者ID:loubo,项目名称:sones,代码行数:34,代码来源:DescribeIndexDefinition.cs


示例6: GetResult

        public override QueryResult GetResult(  GQLPluginManager myPluginManager,
            IGraphDB myGraphDB,
            SecurityToken mySecurityToken,
            Int64 myTransactionToken)
        {
            var resultingVertices = new List<IVertexView>();
            ASonesException error = null;

            if (!String.IsNullOrEmpty(_EdgeName))
            {

                #region Specific edge

                var request = new RequestGetEdgeType(_EdgeName);
                var edge = myGraphDB.GetEdgeType<IEdgeType>(mySecurityToken,
                                                            myTransactionToken,
                                                            request,
                                                            (stats, edgeType) => edgeType);

                if (edge != null)
                {
                    resultingVertices = new List<IVertexView>() { GenerateOutput(edge, _EdgeName) };
                }
                else
                {
                    error = new EdgeTypeDoesNotExistException(_EdgeName);
                }

                #endregion

            }
            else
            {

                #region All edges

                var resultingReadouts = new List<IVertexView>();

                var request = new RequestGetAllEdgeTypes();

                foreach (var edge in myGraphDB.GetAllEdgeTypes<IEnumerable<IEdgeType>>(mySecurityToken,
                                                                                        myTransactionToken,
                                                                                        request,
                                                                                        (stats, edgeTypes) => edgeTypes))
                {
                    resultingReadouts.Add(GenerateOutput(edge, edge.Name));
                }

                #endregion

            }

            if(error != null)
                return new QueryResult("", SonesGQLConstants.GQL, 0L, ResultType.Failed, resultingVertices, error);
            else
                return new QueryResult("", SonesGQLConstants.GQL, 0L, ResultType.Successful, resultingVertices);
        }
开发者ID:ramz,项目名称:sones,代码行数:57,代码来源:DescribeEdgeDefinition.cs


示例7: Execute

        public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, Int64 myTransactionToken)
        {
            _query = myQuery;

            return myGraphDB.AlterVertexType<QueryResult>(
                mySecurityToken,
                myTransactionToken,
                CreateNewRequest(myGraphDB, myPluginManager, mySecurityToken, myTransactionToken),
                CreateOutput);
        }
开发者ID:karsten-wolfert,项目名称:sones,代码行数:10,代码来源:AlterVertexTypeNode.cs


示例8: GetResult

        public override IEnumerable<IVertexView> GetResult(
                                                GQLPluginManager myPluginManager,
                                                IGraphDB myGraphDB,
                                                SecurityToken mySecurityToken,
                                                Int64 myTransactionToken)
        {
            var resultingVertices = new List<IVertexView>();

            if (!String.IsNullOrEmpty(_EdgeName))
            {

                #region Specific edge

                var request = new RequestGetEdgeType(_EdgeName);
                var edge = myGraphDB.GetEdgeType<IEdgeType>(mySecurityToken, 
                                                            myTransactionToken, 
                                                            request, 
                                                            (stats, edgeType) => edgeType);

                if (edge != null)
                {
                    resultingVertices = new List<IVertexView>() { GenerateOutput(edge, _EdgeName) };
                }
                else
                {
                    throw new EdgeTypeDoesNotExistException(_EdgeName);
                }

                #endregion

            }
            else
            {

                #region All edges

                var resultingReadouts = new List<IVertexView>();

                var request = new RequestGetAllEdgeTypes();

                foreach (var edge in myGraphDB.GetAllEdgeTypes<IEnumerable<IEdgeType>>(mySecurityToken,     
                                                                                        myTransactionToken, 
                                                                                        request, 
                                                                                        (stats, edgeTypes) => edgeTypes))
                {
                    resultingReadouts.Add(GenerateOutput(edge, edge.Name));
                }


                #endregion

            }

            return resultingVertices;
        }
开发者ID:anukat2015,项目名称:sones,代码行数:55,代码来源:DescribeEdgeDefinition.cs


示例9: Execute

        public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, Int64 myTransactionToken)
        {
            var sw = Stopwatch.StartNew();

            QueryResult result = null;
            _query = myQuery;
            String myAction = "";
            IEnumerable<IVertex> myToBeUpdatedVertices = null;

            //prepare
            var vertexType = myGraphDB.GetVertexType<IVertexType>(
                mySecurityToken,
                myTransactionToken,
                new RequestGetVertexType(_Type),
                (stats, vtype) => vtype);

            if (_WhereExpression != null)
            {
                //validate
                _WhereExpression.Validate(myPluginManager, myGraphDB, mySecurityToken, myTransactionToken, vertexType);

                //calculate
                var expressionGraph = _WhereExpression.Calculon(myPluginManager, myGraphDB, mySecurityToken, myTransactionToken, new CommonUsageGraph(myGraphDB, mySecurityToken, myTransactionToken), false);

                //extract
                myToBeUpdatedVertices = expressionGraph.Select(new LevelKey(vertexType.ID, myGraphDB, mySecurityToken, myTransactionToken), null, true).ToList();
            }

            if (myToBeUpdatedVertices != null && myToBeUpdatedVertices.Count() > 0)
            {

                //update
                result = ProcessUpdate(myToBeUpdatedVertices, myGraphDB, myPluginManager, mySecurityToken, myTransactionToken);
                myAction = "Updated";

            }
            else
            {

                //insert
                result = ProcessInsert(myGraphDB, myPluginManager, mySecurityToken, myTransactionToken);
                myAction = "Inserted";

            }

            if (result.Error != null)
                throw result.Error;

            sw.Stop();

            return GenerateResult(sw.Elapsed.TotalMilliseconds, result, myAction);
        }
开发者ID:ramz,项目名称:sones,代码行数:52,代码来源:InsertOrUpdateNode.cs


示例10: Execute

        public override IQueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, Int64 myTransactionToken)
        {
            try
            {
                var request = new RequestRebuildIndices(_Types);

                return myGraphDB.RebuildIndices<IQueryResult>(mySecurityToken, myTransactionToken, request, _=> GenerateOutput(myQuery, _));
            }
            catch (ASonesException ex)
            {
                return QueryResult.Failure(myQuery, SonesGQLConstants.GQL, ex);
            }
        }
开发者ID:anukat2015,项目名称:sones,代码行数:13,代码来源:RebuildIndicesNode.cs


示例11: Execute

        public override IQueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, Int64 myTransactionToken)
        {
            try
            {
                var stat = myGraphDB.Truncate(mySecurityToken, myTransactionToken, new RequestTruncate(_TypeName), (stats) => stats);

                return QueryResult.Success(myQuery, SonesGQLConstants.GQL, null, Convert.ToUInt64(stat.ExecutionTime.Milliseconds));
            }
            catch(ASonesException e)
            {
                return QueryResult.Failure(myQuery, SonesGQLConstants.GQL, e);
            }
        }
开发者ID:anukat2015,项目名称:sones,代码行数:13,代码来源:TruncateNode.cs


示例12: Execute

        public override IQueryResult Execute(IGraphDB myGraphDB,
                                            IGraphQL myGraphQL,
                                            GQLPluginManager myPluginManager,
                                            String myQuery,
                                            SecurityToken mySecurityToken,
                                            Int64 myTransactionToken)
        {
            _query = myQuery;

            return myGraphDB.DropEdgeType(mySecurityToken,
                                            myTransactionToken,
                                            new RequestDropEdgeType(_TypeName),
                                            GenerateOutput);
        }
开发者ID:anukat2015,项目名称:sones,代码行数:14,代码来源:DropEdgeTypeNode.cs


示例13: GetResult

        /// <summary>
        /// <seealso cref=" ADescribeDefinition"/>
        /// </summary>
        public override QueryResult GetResult(GQLPluginManager myPluginManager,
            IGraphDB myGraphDB,
            SecurityToken mySecurityToken,
            TransactionToken myTransactionToken)
        {
            var resultingVertices = new List<IVertexView>();
            ASonesException error = null;

            if (!String.IsNullOrEmpty(_TypeName))
            {

                #region Specific type

                var request = new RequestGetVertexType(_TypeName);
                var type = myGraphDB.GetVertexType<IVertexType>(mySecurityToken, myTransactionToken, request, (stats, vertexType) => vertexType);

                if (type != null)
                {
                    resultingVertices = new List<IVertexView>() { (GenerateOutput(type, 1)) };
                }
                else
                {
                    error = new VertexTypeDoesNotExistException(_TypeName, "");
                }

                #endregion

            }
            else
            {

                #region All types

                foreach (var type in myGraphDB.GetAllVertexTypes<IEnumerable<IVertexType>>(mySecurityToken,
                                                                                            myTransactionToken,
                                                                                            new RequestGetAllVertexTypes(),
                                                                                            (stats, vertexTypes) => vertexTypes))
                {
                    resultingVertices.Add(GenerateOutput(type));
                }

                #endregion
            }

            if (error != null)
                return new QueryResult("", SonesGQLConstants.GQL, 0L, ResultType.Failed, resultingVertices, error);
            else
                return new QueryResult("", SonesGQLConstants.GQL, 0L, ResultType.Successful, resultingVertices);
        }
开发者ID:loubo,项目名称:sones,代码行数:52,代码来源:DescribeTypeDefinition.cs


示例14: GetBinaryExpression

        public BinaryExpressionDefinition GetBinaryExpression(GQLPluginManager myPluginManager, IGraphDB myGraphDB, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
        {
            AExpressionDefinition right;
            var op = GetOperatorBySymbol(_OperatorSymbol);
            if (op == null)
            {
                throw new OperatorDoesNotExistException(_OperatorSymbol);
            }

            right = new ValueDefinition(1);

            var binExpr = new BinaryExpressionDefinition("*", _Expression, right);
            binExpr.Validate(myPluginManager, myGraphDB, mySecurityToken, myTransactionToken);

            return binExpr;
        }
开发者ID:loubo,项目名称:sones,代码行数:16,代码来源:UnaryExpressionDefinition.cs


示例15: Execute

        public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
        {
            QueryResult result = new QueryResult(myQuery, SonesGQLConstants.GQL, 0L, ResultType.Failed);

            try
            {
                var stat = myGraphDB.Truncate(mySecurityToken, myTransactionToken, new RequestTruncate(_TypeName), (stats) => stats);

                result = new QueryResult(myQuery, SonesGQLConstants.GQL, Convert.ToUInt64(stat.ExecutionTime.Milliseconds), ResultType.Successful);
            }
            catch(ASonesException e)
            {
                result = new QueryResult(myQuery, SonesGQLConstants.GQL, 0, ResultType.Failed, null, e);
            }

            return result;
        }
开发者ID:loubo,项目名称:sones,代码行数:17,代码来源:TruncateNode.cs


示例16: GetResult

        /// <summary>
        /// <seealso cref=" ADescribeDefinition"/>
        /// </summary>
        public override IEnumerable<IVertexView> GetResult(GQLPluginManager myPluginManager,
                                                IGraphDB myGraphDB,
                                                SecurityToken mySecurityToken,
                                                Int64 myTransactionToken)
        {
            var resultingVertices = new List<IVertexView>();

            if (!String.IsNullOrEmpty(_TypeName))
            {

                #region Specific type

                var request = new RequestGetVertexType(_TypeName);
                var type = myGraphDB.GetVertexType<IVertexType>(mySecurityToken, myTransactionToken, request, (stats, vertexType) => vertexType);

                if (type != null)
                {
                    resultingVertices = new List<IVertexView>() { (GenerateOutput(type, 1)) };
                }
                else
                {
                    throw new VertexTypeDoesNotExistException(_TypeName, "");
                }

                #endregion

            }
            else
            {

                #region All types

                foreach (var type in myGraphDB.GetAllVertexTypes<IEnumerable<IVertexType>>(mySecurityToken,
                                                                                            myTransactionToken,
                                                                                            new RequestGetAllVertexTypes(),
                                                                                            (stats, vertexTypes) => vertexTypes))
                {
                    resultingVertices.Add(GenerateOutput(type));
                }

                #endregion
            }

            return resultingVertices;
        }
开发者ID:anukat2015,项目名称:sones,代码行数:48,代码来源:DescribeTypeDefinition.cs


示例17: Execute

        public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
        {
            QueryResult qresult = null;
            ASonesException error = null;

            try
            {
                var stat = myGraphDB.DropIndex(mySecurityToken, myTransactionToken, new RequestDropIndex(_TypeName, _IndexName, _IndexEdition), (stats) => stats);

                qresult = new QueryResult(myQuery, "sones.gql", Convert.ToUInt64(stat.ExecutionTime.Milliseconds), ResultType.Successful);
            }
            catch (ASonesException e)
            {
                error = e;
            }

            return new QueryResult(myQuery, "sones.gql", qresult.Duration, qresult.TypeOfResult, qresult.Vertices, error);
        }
开发者ID:loubo,项目名称:sones,代码行数:18,代码来源:DropIndexNode.cs


示例18: Execute

        public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
        {
            QueryResult qresult = null;
            Query = myQuery;

            try
            {
                var request = new RequestRebuildIndices(_Types);

                qresult = myGraphDB.RebuildIndices<QueryResult>(mySecurityToken, myTransactionToken, request, GenerateOutput);
            }
            catch (ASonesException e)
            {
                qresult.Error = e;
            }

            return qresult;
        }
开发者ID:loubo,项目名称:sones,代码行数:18,代码来源:RebuildIndicesNode.cs


示例19: Execute

        public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, Int64 myTransactionToken)
        {
            var sw = Stopwatch.StartNew();

            QueryResult qresult = null;
            ASonesException error = null;

            try
            {
                qresult = _DescribeDefinition.GetResult(myPluginManager, myGraphDB, mySecurityToken, myTransactionToken);
            }
            catch (ASonesException e)
            {
                error = e;
            }

            sw.Stop();

            return new QueryResult(myQuery, "sones.gql", (ulong)sw.ElapsedMilliseconds, qresult != null ? qresult.TypeOfResult : ResultType.Failed, qresult != null ? qresult.Vertices : new IVertexView[0], error);
        }
开发者ID:ramz,项目名称:sones,代码行数:20,代码来源:DescribeNode.cs


示例20: Execute

        public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, TransactionToken myTransactionToken)
        {
            _query = myQuery;

            QueryResult result;

            try
            {
                result = myGraphDB.CreateVertexTypes<QueryResult>(
                        mySecurityToken,
                        myTransactionToken,
                        new RequestCreateVertexTypes(GenerateVertexTypePredefinitions()),
                        CreateQueryResult);
            }
            catch (ASonesException e)
            {
                result = new QueryResult(_query, SonesGQLConstants.GQL, 0, ResultType.Failed, null, e);
            }

            return result;
        }
开发者ID:loubo,项目名称:sones,代码行数:21,代码来源:CreateVertexTypesNode.cs



注:本文中的sones.GraphQL.GQL.Manager.Plugin.GQLPluginManager类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Security.SecurityToken类代码示例发布时间:2022-05-26
下一篇:
C# BasicTypes.ADBBaseObject类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap