Dreams:taxon-index: Difference between revisions

From DREAMS
Jump to navigation Jump to search
(→‎Taxons: taxonUrl)
(→‎Taxons: Danish)
Line 1: Line 1:
== Taxons ==
== Taksoner ==
{{SPARQL | query=  
{{SPARQL | query=  
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
Line 5: Line 5:


SELECT  
SELECT  
   ?reports
   ?rapporter
   ?taxon ?taxonLabel
   ?takson ?taksonLabel
   (CONCAT("#taxon/", SUBSTR(STR(?taxon), 38)) AS ?taxonUrl)
   (CONCAT("#taxon/", SUBSTR(STR(?takson), 38)) AS ?taksonUrl)
WITH {
WITH {
   SELECT
   SELECT
     (COUNT(DISTINCT ?report) AS ?reports)
     (COUNT(DISTINCT ?report) AS ?rapporter)
     ?taxon
     ?takson
   WHERE {
   WHERE {
     ?report dreamst:P28 ?taxon .
     ?report dreamst:P28 ?takson .
   }
   }
   GROUP BY ?taxon
   GROUP BY ?takson
} AS %result
} AS %result
WHERE {
WHERE {
Line 21: Line 21:
   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(?reports)
ORDER BY DESC(?rapporter)
}}
}}

Revision as of 17:11, 9 December 2022

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 {
    ?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)