Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolandcrosby/936c84bd96d3396ecc6b943e5048a777 to your computer and use it in GitHub Desktop.
Save rolandcrosby/936c84bd96d3396ecc6b943e5048a777 to your computer and use it in GitHub Desktop.
SELECT ?ingredient ?ingredientLabel (GROUP_CONCAT(DISTINCT ?sandwichLabel; SEPARATOR = ", ") AS ?sandwiches) WHERE {
?sandwich ((wdt:P31?)/(wdt:P279*)) wd:Q28803;
wdt:P527 ?ingredient.
MINUS { ?ingredient (wdt:P279*) wd:Q7802. }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en", "fr".
?sandwich rdfs:label ?sandwichLabel.
?ingredient rdfs:label ?ingredientLabel.
}
}
GROUP BY ?ingredient ?ingredientLabel
ORDER BY DESC (COUNT(DISTINCT ?sandwich))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment