Dreams:recipient-index

From DREAMS
Jump to navigation Jump to search

Recipienter

PREFIX target: <https://dreams.wikibase.cloud/entity/Q153>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
PREFIX dreamsp: <https://dreams.wikibase.cloud/prop/>
PREFIX dreamspsv: <https://dreams.wikibase.cloud/prop/statement/value/> 

SELECT
  ?mønstre

  ?recipient ?recipientLabel
  (CONCAT("#recipient/", SUBSTR(STR(?recipient), 38)) AS ?recipientUrl)  

  ?eksempel_mønster ?eksempel_mønsterLabel
  (CONCAT("#pattern/", SUBSTR(STR(?eksempel_mønster), 38)) AS ?eksempel_mønsterUrl)  
 
WITH {
  SELECT 
    (COUNT(?pattern) AS ?mønstre)
    (SAMPLE(?pattern) AS ?eksempel_mønster)
    ?recipient
  WHERE {
    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P55 ?recipient .
  }
  GROUP BY ?recipient
} AS %result
WHERE {
  INCLUDE %result
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}
ORDER BY DESC(?mønstre)