Esempio n. 1
0
        public QueryGroupAnd Rest()
        {
            QueryGroupAnd group = new QueryGroupAnd();

            group.itsGroups.AddRange(itsGroups.GetRange(1, itsGroups.Count - 1));
            return(group);
        }
Esempio n. 2
0
        public QueryGroup Resolve(TripleStore triples)
        {
            QueryGroupAnd groupAnd = new QueryGroupAnd();

            QueryGroupPatterns groupRequired = new QueryGroupPatterns();

            foreach (Pattern pattern in itsPatterns)
            {
                groupRequired.Add(pattern.Resolve(triples));
            }
            groupAnd.Add(groupRequired);

            if (null != itsOptionalPatterns)
            {
                try {
                    QueryGroupPatterns groupOptional = new QueryGroupPatterns();
                    foreach (Pattern pattern in itsOptionalPatterns.Patterns)
                    {
                        groupOptional.Add(pattern.Resolve(triples));
                    }
                    groupAnd.Add(new QueryGroupOptional(groupOptional));
                }
                catch (UnknownGraphMemberException) {
                    // NOOP
                }
            }

            QueryGroupConstraints groupConstraints = new QueryGroupConstraints();

            foreach (Constraint constraint in itsConstraints)
            {
                groupConstraints.Add(constraint);
            }
            groupAnd.Add(groupConstraints);

            QueryGroupOr alternateGroups = new QueryGroupOr();

            alternateGroups.Add(groupAnd);


            foreach (PatternGroup group in itsAlternateGroups)
            {
                try {
                    QueryGroupPatterns groupAlternate = new QueryGroupPatterns();
                    foreach (Pattern pattern in group.Patterns)
                    {
                        groupAlternate.Add(pattern.Resolve(triples));
                    }
                    alternateGroups.Add(groupAlternate);
                }
                catch (UnknownGraphMemberException) {
                    // NOOP
                }
            }

            return(alternateGroups);
        }
Esempio n. 3
0
        public QueryGroup Resolve(ResourceMap map)
        {
            QueryGroupAnd newGroup = new QueryGroupAnd();

            foreach (QueryGroup group in itsGroups)
            {
                newGroup.Add(group.Resolve(map));
            }
            return(newGroup);
        }