Dreams:projecttype-index

From DREAMS
Jump to navigation Jump to search

Projekttyper

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

SELECT
  ?mønstre
  ?rapporter
  ?projekttype ?projekttypeLabel ?projekttypeUrl
WITH {
  SELECT 
    (COUNT(DISTINCT ?pattern) AS ?mønstre)
    (COUNT(DISTINCT ?report) AS ?rapporter)
    ?projekttype
  WHERE {
    ?projekttype dreamst:P10* dreams:Q91 .
    OPTIONAL {
      ?pattern dreamst:P2 dreams:Q263 ;
               dreamst:P16 / dreamst:P10* ?projekttype .
    }
    OPTIONAL {
      ?report dreamst:P2 / dreamst:P10* dreams:Q8 ;
              dreamst:P16 / dreamst:P10* ?projekttype .
    }            
  } 
  GROUP BY ?projekttype
} AS %result
WHERE {
  INCLUDE %result
  BIND(CONCAT("#projecttype/", SUBSTR(STR(?projekttype), 38)) AS ?projekttypeUrl)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}
ORDER BY DESC(?mønstre) DESC(?rapporter)