Dreams:taxon-index: Difference between revisions

From DREAMS
Jump to navigation Jump to search
(→‎Taxons: Danish)
Line 13: Line 13:
     ?takson
     ?takson
   WHERE {
   WHERE {
     ?report dreamst:P28 ?takson .
     ?takson dreamst:P2 dreams:Q215 .
    OPTIONAL { ?report dreamst:P28 ?takson . }
   }
   }
   GROUP BY ?takson
   GROUP BY ?takson

Revision as of 14:02, 15 March 2023

Taksoner

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

SELECT 
  ?rapporter
  ?takson ?taksonLabel
  (CONCAT("#taxon/", SUBSTR(STR(?takson), 38)) AS ?taksonUrl)
WITH {
  SELECT
    (COUNT(DISTINCT ?report) AS ?rapporter)
    ?takson
  WHERE {
    ?takson dreamst:P2 dreams:Q215 .
    OPTIONAL { ?report dreamst:P28 ?takson . }
  }
  GROUP BY ?takson
} AS %result
WHERE {
  INCLUDE %result
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],da,en". }
}
ORDER BY DESC(?rapporter)