Пример #1
0
        public PropertyGraphModel Transform(PropertyGraphModel graph)
        {
            var result = graph;

            if (WhereClause != null)
            {
                result = WhereClause.Transform(result);
            }

            if (CalculateClause != null)
            {
                result = CalculateClause.Transform(result);
            }

            if (SelectPropsClause != null)
            {
                result = SelectPropsClause.Transform(result);
            }

            if (GroupByClause != null)
            {
                result = GroupByClause.Transform(result);
            }

            if (LayoutClause != null)
            {
                result = LayoutClause.Transform(result);
            }

            result.ClearIfEmpty();

            return(result);
        }
Пример #2
0
        private GroupByClause ParseGroupByClause(ParseTreeNode node)
        {
            if (node.ChildNodes.Count == 0)
            {
                return(null);
            }

            // the clause is now limited to a sinlge props
            var result = new GroupByClause()
            {
                GroupingProp = node.ChildNodes[1].ChildNodes[0].FindToken().Value.ToString()
            };

            return(result);
        }