16,603
edits
(Created page with "== SDGs == {{SPARQL | query= PREFIX dreams: <https://dreams.wikibase.cloud/entity/> PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/> SELECT ?goal ?goalLabel (CONCAT("#sdg/", SUBSTR(STR(?goal), 38)) AS ?goalUrl) ?goalDescription WHERE { ?goal dreamst:P2 dreams:Q22 . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],da,en". } } }}") |
No edit summary |
||
Line 5: | Line 5: | ||
SELECT | SELECT | ||
?count | |||
?goal ?goalLabel | ?goal ?goalLabel | ||
(CONCAT("#sdg/", SUBSTR(STR(?goal), 38)) AS ?goalUrl) | (CONCAT("#sdg/", SUBSTR(STR(?goal), 38)) AS ?goalUrl) | ||
?goalDescription | ?goalDescription | ||
WITH { | |||
SELECT | |||
(COUNT(?item) AS ?count) | |||
?goal | |||
WHERE { | |||
?goal dreamst:P2 dreams:Q22 . | |||
OPTIONAL { ?item dreamst:P42 ?goal . } | |||
} | |||
GROUP BY ?goal | |||
} AS %result | |||
WHERE { | WHERE { | ||
INCLUDE %result | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],da,en". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],da,en". } | ||
} | } | ||
ORDER BY DESC(?count) | |||
}} | }} |