Esempio n. 1
0
        public static IGremlinRelationshipQuery <TData> ExceptE <TData>(this IGremlinQuery query, string variable)
            where TData : class, new()
        {
            var newQuery = query.AddBlock(string.Format(".except({0})", variable));

            return(new GremlinRelationshipEnumerable <TData>(newQuery));
        }
Esempio n. 2
0
        public static IGremlinRelationshipQuery <TData> InE <TData>(this IGremlinQuery query)
            where TData : class, new()
        {
            var newQuery = query.AddBlock(inE);

            return(new GremlinRelationshipEnumerable <TData>(newQuery));
        }
Esempio n. 3
0
        public static IGremlinRelationshipQuery <TData> BackE <TData>(this IGremlinQuery query, string label)
            where TData : class, new()
        {
            var newQuery = query.AddBlock(".back({0})", label);

            return(new GremlinRelationshipEnumerable <TData>(newQuery));
        }
Esempio n. 4
0
        public static IGremlinNodeQuery <TNode> In <TNode>(this IGremlinQuery query, string label, IEnumerable <Filter> filters, StringComparison comparison = StringComparison.OrdinalIgnoreCase)
        {
            var newQuery    = query.AddBlock(@in, label);
            var filterQuery = newQuery.AddFilterBlock(string.Empty, filters, comparison);

            return(new GremlinNodeEnumerable <TNode>(filterQuery));
        }
Esempio n. 5
0
        public static IGremlinRelationshipQuery <TData> LoopE <TData>(this IGremlinQuery query, string label, uint loopCount)
            where TData : class, new()
        {
            var newQuery = query.AddBlock(".loop({0}){{ it.loops < {1} }}", label, loopCount);

            return(new GremlinRelationshipEnumerable <TData>(newQuery));
        }
Esempio n. 6
0
        public static IEnumerable <TResult> Table <TResult>(
            this IGremlinQuery query) where TResult : new()
        {
            var newQuery = query.AddBlock(".table(new Table()).cap");

            return(new GremlinProjectionEnumerable <TResult>(newQuery));
        }
Esempio n. 7
0
        public static IEnumerable <TResult> Table <TResult, TClosure1, TClosure2, TClosure3, TClosure4, TClosure5, TClosure6, TClosure7, TClosure8, TClosure9, TClosure10>(
            this IGremlinQuery query,
            Expression <Func <TClosure1, object> > closure1,
            Expression <Func <TClosure2, object> > closure2,
            Expression <Func <TClosure3, object> > closure3,
            Expression <Func <TClosure4, object> > closure4,
            Expression <Func <TClosure5, object> > closure5,
            Expression <Func <TClosure6, object> > closure6,
            Expression <Func <TClosure7, object> > closure7,
            Expression <Func <TClosure8, object> > closure8,
            Expression <Func <TClosure9, object> > closure9,
            Expression <Func <TClosure10, object> > closure10) where TResult : new()
        {
            var newQuery = query.AddBlock(".table(new Table())");

            newQuery = AddClosure(newQuery, closure1);
            newQuery = AddClosure(newQuery, closure2);
            newQuery = AddClosure(newQuery, closure3);
            newQuery = AddClosure(newQuery, closure4);
            newQuery = AddClosure(newQuery, closure5);
            newQuery = AddClosure(newQuery, closure6);
            newQuery = AddClosure(newQuery, closure7);
            newQuery = AddClosure(newQuery, closure8);
            newQuery = AddClosure(newQuery, closure9);
            newQuery = AddClosure(newQuery, closure10);
            newQuery = newQuery.AddBlock(".cap");
            return(new GremlinProjectionEnumerable <TResult>(newQuery));
        }
Esempio n. 8
0
        public static IGremlinQuery EmitProperty(this IGremlinQuery query,
                                                 string propertyName)
        {
            IGremlinQuery newQuery = query.AddBlock(string.Format(".{0}", propertyName));

            return(newQuery);
        }
Esempio n. 9
0
        public static IGremlinNodeQuery <TNode> AggregateV <TNode>(this IGremlinQuery query, string variable)
        {
            var newQuery = query.AddBlock(string.Format(".aggregate({0})", variable));

            newQuery.QueryDeclarations.Add(string.Format("{0} = [];", variable));
            newQuery = newQuery.PrependVariablesToBlock(newQuery);
            return(new GremlinNodeEnumerable <TNode>(newQuery));
        }
Esempio n. 10
0
        public static IGremlinRelationshipQuery AggregateE(this IGremlinQuery query, string variable)
        {
            var newQuery = query.AddBlock(string.Format(".aggregate({0})", variable));

            newQuery.QueryDeclarations.Add(string.Format("{0} = [];", variable));
            newQuery = newQuery.PrependVariablesToBlock(newQuery);
            return(new GremlinRelationshipEnumerable(newQuery));
        }
Esempio n. 11
0
        public static IGremlinQuery In(this IGremlinQuery query, string label,
                                       IEnumerable <Filter> filters, StringComparison comparison = StringComparison.OrdinalIgnoreCase)
        {
            IGremlinQuery newQuery    = query.AddBlock(IN, label);
            IGremlinQuery filterQuery = newQuery.AddFilterBlock(string.Empty, filters, comparison);

            return(filterQuery);
        }
Esempio n. 12
0
        public static IGremlinNodeQuery <TNode> In <TNode>(this IGremlinQuery query, string label, Expression <Func <TNode, bool> > filter, StringComparison comparison = StringComparison.OrdinalIgnoreCase)
        {
            var newQuery    = query.AddBlock(@in, label);
            var filters     = FilterFormatters.TranslateFilter(filter);
            var filterQuery = newQuery.AddFilterBlock(string.Empty, filters, comparison);

            return(new GremlinNodeEnumerable <TNode>(filterQuery));
        }
Esempio n. 13
0
        private void LoadNextPage()
        {
            _currentPageIndex++;
            _currentRowIndex = -1;
            int           drop      = _currentPageIndex * _pageSize;
            IGremlinQuery pageQuery = _query.AddBlock(".drop({0}).take({1})._()", drop, _pageSize);

            _currentPageData = _pageLoadCallback(pageQuery).ToArray();
        }
Esempio n. 14
0
        public static IGremlinQuery In <TNode>(this IGremlinQuery query, string label,
                                               Expression <Func <TNode, bool> > filter, StringComparison comparison = StringComparison.OrdinalIgnoreCase)
        {
            IGremlinQuery        newQuery    = query.AddBlock(IN, label);
            IEnumerable <Filter> filters     = FilterFormatters.TranslateFilter(filter);
            IGremlinQuery        filterQuery = newQuery.AddFilterBlock(string.Empty, filters, comparison);

            return(filterQuery);
        }
        void LoadNextPage()
        {
            currentPageIndex++;
            currentRowIndex = -1;
            var drop      = currentPageIndex * pageSize;
            var pageQuery = query.AddBlock(".drop({0}).take({1})._()", drop, pageSize);

            currentPageData = pageLoadCallback(pageQuery).ToArray();
        }
Esempio n. 16
0
        public static IGremlinRelationshipQuery <TData> StoreE <TData>(this IGremlinQuery query, string variable)
            where TData : class, new()
        {
            var newQuery = query.AddBlock(string.Format(".store({0})", variable));

            newQuery.QueryDeclarations.Add(string.Format("{0} = [];", variable));
            newQuery = newQuery.PrependVariablesToBlock(newQuery);
            return(new GremlinRelationshipEnumerable <TData>(newQuery));
        }
Esempio n. 17
0
        public static IEnumerable <TResult> Table <TResult, TClosure1>(
            this IGremlinQuery query,
            Expression <Func <TClosure1, object> > closure1) where TResult : new()
        {
            var newQuery = query.AddBlock(".table(new Table())");

            newQuery = AddClosure(newQuery, closure1);
            newQuery = newQuery.AddBlock(".cap");
            return(new GremlinProjectionEnumerable <TResult>(newQuery));
        }
Esempio n. 18
0
        public static IGremlinQuery StoreV(this IGremlinQuery query, string variable)
        {
            IGremlinQuery newQuery = query.AddBlock(string.Format(".store({0})", variable));

            return(newQuery);
        }
Esempio n. 19
0
        public static IGremlinQuery Is(this IGremlinQuery query, string node)
        {
            IGremlinQuery newQuery = query.AddBlock(string.Format(".Is('{0}')", node));

            return(newQuery);
        }
Esempio n. 20
0
        public static IGremlinQuery As(this IGremlinQuery query, string label)
        {
            IGremlinQuery newQuery = query.AddBlock(".as({0})", label);

            return(newQuery);
        }
Esempio n. 21
0
        public static IGremlinQuery All(this IGremlinQuery query)
        {
            IGremlinQuery newQuery = query.AddBlock(".All()");

            return(newQuery);
        }
Esempio n. 22
0
        public static IGremlinQuery GremlinSkip(this IGremlinQuery query, int count)
        {
            IGremlinQuery newQuery = query.AddBlock(".drop({0})._()", count);

            return(newQuery);
        }
Esempio n. 23
0
        public static IGremlinRelationshipQuery BothE(this IGremlinQuery query)
        {
            var newQuery = query.AddBlock(bothE);

            return(new GremlinRelationshipEnumerable(newQuery));
        }
Esempio n. 24
0
        public static IGremlinNodeQuery <TNode> InV <TNode>(this IGremlinQuery query)
        {
            var newQuery = query.AddBlock(inV);

            return(new GremlinNodeEnumerable <TNode>(newQuery));
        }
Esempio n. 25
0
        public static IGremlinRelationshipQuery ExceptE(this IGremlinQuery query, string variable)
        {
            var newQuery = query.AddBlock(string.Format(".except({0})", variable));

            return(new GremlinRelationshipEnumerable(newQuery));
        }
Esempio n. 26
0
        public static IGremlinNodeQuery <TNode> Out <TNode>(this IGremlinQuery query, string label)
        {
            var newQuery = query.AddBlock(@out, label);

            return(new GremlinNodeEnumerable <TNode>(newQuery));
        }
Esempio n. 27
0
        public static IGremlinNodeQuery <TNode> ExceptV <TNode>(this IGremlinQuery query, string variable)
        {
            var newQuery = query.AddBlock(string.Format(".except({0})", variable));

            return(new GremlinNodeEnumerable <TNode>(newQuery));
        }
Esempio n. 28
0
        public static IGremlinQuery Has(this IGremlinQuery query, string variable, string value)
        {
            IGremlinQuery newQuery = query.AddBlock(string.Format(".Has('{0}','{1}')", variable, value));

            return(newQuery);
        }
Esempio n. 29
0
        public static IGremlinQuery GremlinHasNext(this IGremlinQuery query)
        {
            IGremlinQuery newQuery = query.AddBlock(".hasNext()");

            return(newQuery);
        }
Esempio n. 30
0
        public static IGremlinQuery ExhaustMerge(this IGremlinQuery query)
        {
            IGremlinQuery newQuery = query.AddBlock(".exhaustMerge");

            return(newQuery);
        }