query-2c8fb1596a57ac1dec8d5e81453ca03f
Join Swedish and Norway recipients SELECT ?year_received ?swedish_recipients ?norway_recipients WHERE { { SELECT DISTINCT ?year_received (GROUP_CONCAT(DISTINCT ?itemLabel; SEPARATOR = ", ") AS ?swedish_recipients) WHERE { ?item wdt:P27 wd:Q34; p:P166 ?prize. ?prize ps:P166 wd:Q1233326; pq:P585 ?date_received. BIND(YEAR(?date_received) AS ?year_received) SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,es". ?item rdfs:label ?itemLabel. } } GROUP BY ?year_received } { SELECT DISTINCT ?year_received (GROUP_CONCAT(DISTINCT ?itemLabel; SEPARATOR = ", ") AS ?norway_recipients) WHERE { ?item wdt:P27 wd:Q20; p:P166 ?prize. ?prize ps:P166 wd:Q1233326; pq:P585 ?date_received. BIND(YEAR(?date_received) AS ?year_received) SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,es". ?item rdfs:label ?itemLabel. } } GROUP BY ?year_received } } ORDER BY (?year_received)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Join Swedish and Norway recipients
SELECT ?year_received ?swedish_recipients ?norway_recipients
WHERE {
{
SELECT DISTINCT ?year_received (GROUP_CONCAT(DISTINCT ?itemLabel; SEPARATOR = ", ") AS ?swedish_recipients)
WHERE {
?item wdt:P27 wd:Q34; p:P166 ?prize.
?prize ps:P166 wd:Q1233326; pq:P585 ?date_received.
BIND(YEAR(?date_received) AS ?year_received)
SERVICE wikibase:label {
bd:serviceParam wikibase:language "fr,en,de,es".
?item rdfs:label ?itemLabel.
}
}
GROUP BY ?year_received
}
{
SELECT DISTINCT ?year_received (GROUP_CONCAT(DISTINCT ?itemLabel; SEPARATOR = ", ") AS ?norway_recipients)
WHERE {
?item wdt:P27 wd:Q20; p:P166 ?prize.
?prize ps:P166 wd:Q1233326; pq:P585 ?date_received.
BIND(YEAR(?date_received) AS ?year_received)
SERVICE wikibase:label {
bd:serviceParam wikibase:language "fr,en,de,es".
?item rdfs:label ?itemLabel.
}
}
GROUP BY ?year_received
}
}
ORDER BY (?year_received)