public QueryGroupPatterns Rest() { QueryGroupPatterns group = new QueryGroupPatterns(); group.itsPatterns.AddRange(itsPatterns.GetRange(1, itsPatterns.Count - 1)); return(group); }
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); }
public QueryGroup Resolve(ResourceMap map) { QueryGroupPatterns newGroup = new QueryGroupPatterns(); foreach (Pattern pattern in itsPatterns) { newGroup.Add(pattern.Resolve(map)); } return(newGroup); }
public PatternGroup() { itsPatterns = new ArrayList(); itsAlternateGroups = new ArrayList(); itsConstraints = new ArrayList(); itsQueryPartAlternate = new QueryGroupOr(); itsQueryPartPatterns = new QueryGroupPatterns(); itsQueryPartOptionalPatterns = new QueryGroupPatterns(); itsQueryPartOptional = new QueryGroupOptional(itsQueryPartOptionalPatterns); itsQueryPartConstraints = new QueryGroupConstraints( ); }