Dreams:projecttype: Difference between revisions

(Created page with "{{SPARQL | query = PREFIX dreams: <https://dreams.wikibase.cloud/entity/> PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/> SELECT ?pattern ?patternLabel WHERE { ?pattern dreamst:P2 dreams:Q195 . ?pattern dreamst:P16 / dreamst:P10* dreams:Q170 SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da". } } }}")
 
 
(43 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{SPARQL | query =  
== Projekttype-data ==
{{SPARQL | query=
PREFIX target: <https://dreams.wikibase.cloud/entity/Q264>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>


SELECT  
SELECT DISTINCT
   ?pattern ?patternLabel
   ?beskrivelse
  ?værdi ?værdiLabel ?værdiUrl
WHERE {
WHERE {
   ?pattern dreamst:P2 dreams:Q195 .
   BIND(target: AS ?effect)
   ?pattern dreamst:P16 / dreamst:P10* dreams:Q170
  {
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da". }
    BIND(1 AS ?order)
    BIND("Projekttype" AS ?beskrivelse)
    BIND(target: AS ?værdi) .
  }
  UNION
  {
    BIND(5 AS ?order)
    BIND("Overbegreb" AS ?beskrivelse)
    target: dreamst:P10 ?værdi .
    BIND(SUBSTR(STR(?værdi), 38) AS ?q)
    BIND(CONCAT("#projecttype/", ?q) AS ?værdiUrl)
  }
  UNION
  {
    BIND(6 AS ?order)
    BIND("Underbegreb" AS ?beskrivelse)
    target: ^dreamst:P10 ?værdi .
    BIND(SUBSTR(STR(?værdi), 38) AS ?q)
    BIND(CONCAT("#projecttype/", ?q) AS ?værdiUrl)
   }
  UNION
  {
    BIND(10 AS ?order)
    BIND("Ekstern beskrivelse" AS ?beskrivelse)
    target: dreamst:P29 ?værdi .
    BIND(?værdi AS ?værdiUrl)
  }
  UNION
  {
    BIND(100 AS ?order)
    BIND("Rapporter" AS ?beskrivelse)
    BIND("🔍" AS ?værdi)
    BIND(CONCAT("#projecttype/", SUBSTR(STR(target:), 38), "/report") AS ?værdiUrl)
  }
  UNION
  {
    BIND(101 AS ?order)
    BIND("Effekter" AS ?beskrivelse)
    BIND("🔍" AS ?værdi)
    BIND(CONCAT("#projecttype/", SUBSTR(STR(target:), 38), "/effect") AS ?værdiUrl)
  }
 
   SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}
}
ORDER BY ?order}}
== Mønstre ==
{{SPARQL | query=
PREFIX target: <https://dreams.wikibase.cloud/entity/Q321>
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
  DISTINCT
  ?mønster ("🔍" AS ?mønsterLabel)
  (CONCAT("#pattern/", SUBSTR(STR(?mønster), 38)) AS ?mønsterUrl) 
  ?rapport ?rapportLabel
  (CONCAT("#report/", SUBSTR(STR(?rapport), 38)) AS ?rapportUrl) 
  ?subjekt ?subjektLabel ?subjektUrl
  ?påvirkning ?påvirkningLabel ?påvirkningUrl
  ?recipient ?recipientLabel ?recipientUrl
  ?signifikans ?signifikansLabel
  ?afbødning ?afbødningLabel ?afbødningUrl
  ?citat
  ?projektfase ?projektfaseLabel
  (CONCAT("#projectphase/", SUBSTR(STR(?projektfase), 38)) AS ?projektfaseUrl) 
  ?link ?linkUrl
WHERE {
  ?mønster dreamst:P2 dreams:Q263 ;
          dreamst:P20? / dreamst:P16 / dreamst:P10* target: .
  OPTIONAL {
    ?mønster dreamst:P33 ?subjekt .
    ?subjekt rdfs:label ?subjekt_label .
    FILTER(LANG(?subjekt_label) = 'da')
    BIND(CONCAT("#effect/", SUBSTR(STR(?subjekt), 38)) AS ?subjektUrl)
  }
  OPTIONAL { ?mønster dreamst:P47 ?subjekt_text }
  BIND(COALESCE(?subjekt, ?subjekt_text, "") AS ?subjekt)
  BIND(CONCAT(?subjekt_text, " (", COALESCE(?subjekt_label, ""), ")") AS ?subjektLabel)
   
  OPTIONAL {
    ?mønster dreamst:P34 ?påvirkning .
    ?påvirkning rdfs:label ?påvirkning_label .
    FILTER (LANG(?påvirkning_label) = 'da')
    BIND(CONCAT("#effect/", SUBSTR(STR(?påvirkning), 38)) AS ?påvirkningUrl)
  }
  OPTIONAL { ?mønster dreamst:P49 ?påvirkning_text }
  BIND(COALESCE(?påvirkning, ?påvirkning_text) AS ?påvirkning)
  BIND(CONCAT(?påvirkning_text, " (", COALESCE(?påvirkning_label, ""), ")") AS ?påvirkningLabel)
  OPTIONAL {
    ?mønster dreamst:P55 ?recipient .
    ?recipient rdfs:label ?recipient_label .
    FILTER (LANG(?recipient_label) = 'da')
    BIND(CONCAT("#effect/", SUBSTR(STR(?recipient), 38)) AS ?recipientUrl)
  }
  OPTIONAL { ?mønster dreamst:P54 ?recipient_text }
  BIND(COALESCE(?recipient, ?recipient_text) AS ?recipient)
  BIND(CONCAT(?recipient_text, " (", COALESCE(?recipient_label, ""), ")") AS ?recipientLabel)
  OPTIONAL {
    ?mønster dreamst:P56 ?afbødning .
    ?afbødning rdfs:label ?afbødning_label .
    FILTER (LANG(?afbødning_label) = 'da')
    BIND(CONCAT("#effect/", SUBSTR(STR(?afbødning), 38)) AS ?afbødningUrl)
  }
  OPTIONAL { ?mønster dreamst:P53 ?afbødning_text }
  BIND(COALESCE(?afbødning, ?afbødning_text) AS ?afbødning)
  BIND(CONCAT(?afbødning_text, " (", COALESCE(?afbødning_label, ""), ")") AS ?afbødningLabel)
  OPTIONAL { ?mønster dreamst:P18 ?citat . }
  OPTIONAL { ?mønster dreamst:P19 ?projektfase . }
  OPTIONAL { ?mønster dreamst:P20 ?rapport . }
  OPTIONAL {
    ?mønster dreamst:P21 ?signifikans .
    ?signifikans rdfs:label ?signifikans_text .
    FILTER (LANG(?signifikans_text) = 'da')
    OPTIONAL { ?signifikans dreamst:P44 ?symbol . }
    BIND(IF(BOUND(?symbol), ?symbol, "❓") AS ?signifikans_symbol)
    BIND(CONCAT(?signifikans_symbol, " ", ?signifikans_text) AS ?signifikansLabel)
  }
  OPTIONAL {
    ?mønster dreamst:P20 ?rapport .
    ?rapport dreamst:P40 ?miljøportal .
    OPTIONAL { ?mønster dreamst:P46 ?page }
    BIND(IF(BOUND(?page), CONCAT(?page, " ↗"), " ↗") AS ?link)
    BIND(CONCAT("https://daieproddreamspdfsto.blob.core.windows.net/files/", STR(?miljøportal),
                IF(BOUND(?page), CONCAT("#page=", ?page), "")) AS ?linkUrl)
  }


  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}
}}
}}