Dreams:sdg-index: Difference between revisions

From DREAMS
Jump to navigation Jump to search
(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". } } }}")
 
(→‎Verdensmål: Broadened query)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
== SDGs ==
== Verdensmål ==
{{SPARQL | query=
{{SPARQL | query=
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
Line 5: Line 5:


SELECT  
SELECT  
   ?goal ?goalLabel
   ?antal
   (CONCAT("#sdg/", SUBSTR(STR(?goal), 38)) AS ?goalUrl)
  ?mål ?målLabel
   ?goalDescription
   (CONCAT("#sdg/", SUBSTR(STR(?mål), 38)) AS ?målUrl)
   ?målDescription
WITH {
  SELECT
    (COUNT(?item) AS ?antal)
    ?mål
  WHERE {
    { ?mål dreamst:P2 dreams:Q22 . }
    UNION
    { ?mål dreamst:P2 dreams:Q5594 . }
 
    OPTIONAL { ?item dreamst:P42 / dreamst:P10* ?mål . }
  }
  GROUP BY ?mål
} AS %result
WHERE {
WHERE {
   ?goal dreamst:P2 dreams:Q22 .
   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(?antal)
}}
}}

Latest revision as of 22:26, 15 December 2022

Verdensmål

PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>

SELECT 
  ?antal
  ?mål ?målLabel 
  (CONCAT("#sdg/", SUBSTR(STR(?mål), 38)) AS ?målUrl)
  ?målDescription
WITH {
  SELECT
    (COUNT(?item) AS ?antal)
    ?mål
  WHERE {
    { ?mål dreamst:P2 dreams:Q22 . }
    UNION
    { ?mål dreamst:P2 dreams:Q5594 . }

    OPTIONAL { ?item dreamst:P42 / dreamst:P10* ?mål . }
  }
  GROUP BY ?mål
} AS %result
WHERE {
  INCLUDE %result
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],da,en". }
}
ORDER BY DESC(?antal)