tripleCollections[i] = tcManager.getMGraph(recipeIDs.get(i));
}
UnionMGraph unionMGraph = new UnionMGraph(tripleCollections);
RuleList matchingRules = new RuleList();
try {
SelectQuery query = (SelectQuery) QueryParser.getInstance().parse(sparql);
ResultSet resultSet = tcManager.executeSparqlQuery(query, unionMGraph);
while (resultSet.hasNext()) {
SolutionMapping solutionMapping = resultSet.next();
UriRef recipeID = (UriRef) solutionMapping.get("recipe");
UriRef ruleID = (UriRef) solutionMapping.get("rule");
Literal description = (Literal) solutionMapping.get("description");
try {
Recipe recipe = getRecipe(recipeID);
Rule rule = new RecipeRule(recipe, getRule(recipe, ruleID));
if (description != null) {
rule.setDescription(description.getLexicalForm());
}
matchingRules.add(rule);
} catch (NoSuchRecipeException e) {
// in this case go on in the iteration by fetching other matching recipes
} catch (RecipeConstructionException e) {
// in this case go on in the iteration by fetching other matching recipes
} catch (NoSuchRuleInRecipeException e) {