Dreams:projecttype: Difference between revisions

From DREAMS
Jump to navigation Jump to search
(→‎Project type data: projecttype-effect-index link)
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Project type data ==
== Projekttype-data ==
{{SPARQL | query=
{{SPARQL | query=
PREFIX target: <https://dreams.wikibase.cloud/entity/Q264>
PREFIX target: <https://dreams.wikibase.cloud/entity/Q264>
Line 5: Line 5:
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>


SELECT DISTINCT ?description ?value ?valueLabel ?valueUrl
SELECT DISTINCT  
  ?beskrivelse
  ?værdi ?værdiLabel ?værdiUrl
WHERE {
WHERE {
   BIND(target: AS ?effect)
   BIND(target: AS ?effect)
   {
   {
     BIND(1 AS ?order)
     BIND(1 AS ?order)
     BIND("Project type" AS ?description)
     BIND("Projekttype" AS ?beskrivelse)
     BIND(target: AS ?value) .
     BIND(target: AS ?værdi) .
   }
   }
   UNION
   UNION
   {
   {
     BIND(5 AS ?order)
     BIND(5 AS ?order)
     BIND("Supertype" AS ?description)
     BIND("Overbegreb" AS ?beskrivelse)
     target: dreamst:P10 ?value .
     target: dreamst:P10 ?værdi .
     BIND(SUBSTR(STR(?value), 38) AS ?q)  
     BIND(SUBSTR(STR(?værdi), 38) AS ?q)  
     BIND(CONCAT("#projecttype/", ?q) AS ?valueUrl)
     BIND(CONCAT("#projecttype/", ?q) AS ?værdiUrl)
   }
   }
   UNION
   UNION
   {
   {
     BIND(6 AS ?order)
     BIND(6 AS ?order)
     BIND("Subtype" AS ?description)
     BIND("Underbegreb" AS ?beskrivelse)
     target: ^dreamst:P10 ?value .
     target: ^dreamst:P10 ?værdi .
     BIND(SUBSTR(STR(?value), 38) AS ?q)  
     BIND(SUBSTR(STR(?værdi), 38) AS ?q)  
     BIND(CONCAT("#projecttype/", ?q) AS ?valueUrl)
     BIND(CONCAT("#projecttype/", ?q) AS ?værdiUrl)
   }
   }
   UNION
   UNION
   {
   {
     BIND(10 AS ?order)
     BIND(10 AS ?order)
     BIND("External description" AS ?description)
     BIND("Ekstern beskrivelse" AS ?beskrivelse)
     target: dreamst:P29 ?value .
     target: dreamst:P29 ?værdi .
     BIND(?value AS ?valueUrl)
     BIND(?værdi AS ?værdiUrl)
   }
   }
   UNION
   UNION
   {
   {
     BIND(100 AS ?order)
     BIND(100 AS ?order)
     BIND("Reports" AS ?description)
     BIND("Rapporter" AS ?beskrivelse)
     BIND("🔍" AS ?value)
     BIND("🔍" AS ?værdi)
     BIND(CONCAT("#projecttype/", SUBSTR(STR(target:), 38), "/report") AS ?valueUrl)
     BIND(CONCAT("#projecttype/", SUBSTR(STR(target:), 38), "/report") AS ?værdiUrl)
   }
   }
   UNION
   UNION
   {
   {
     BIND(101 AS ?order)
     BIND(101 AS ?order)
     BIND("Effects" AS ?description)
     BIND("Effekter" AS ?beskrivelse)
     BIND("🔍" AS ?value)
     BIND("🔍" AS ?værdi)
     BIND(CONCAT("#projecttype/", SUBSTR(STR(target:), 38), "/effect") AS ?valueUrl)
     BIND(CONCAT("#projecttype/", SUBSTR(STR(target:), 38), "/effect") AS ?værdiUrl)
   }
   }


Line 55: Line 57:
ORDER BY ?order}}
ORDER BY ?order}}


== Effects ==
== Mønstre ==
{{SPARQL | query=
PREFIX target: <https://dreams.wikibase.cloud/entity/Q264>
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
  ?number_of_patterns
 
  ?effect ?effectLabel
  (CONCAT("#effect/", SUBSTR(STR(?effect), 38)) AS ?effectUrl)
  ("🔎" AS ?zoom) 
  (CONCAT("#effect/", SUBSTR(STR(?effect), 38),
          "/projecttype/", SUBSTR(STR(target:), 38)) AS ?zoomUrl)
 
  ?example_pattern ?example_patternLabel
  (CONCAT("#pattern/", SUBSTR(STR(?example_pattern), 38)) AS ?example_patternUrl) 
WITH {
  SELECT
    (COUNT(?pattern) AS ?number_of_patterns)
    (SAMPLE(?pattern) AS ?example_pattern)
    ?effect
  WHERE {
    ?pattern dreamst:P2 dreams:Q263 ;
            dreamst:P16 / dreamst:P10* target: ;
            (dreamst:P33 | dreamst:P34) / dreamst:P10* ?effect .
  }
  GROUP BY ?effect
} AS %result
WHERE {
  INCLUDE %result
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}
ORDER BY DESC(?number_of_patterns)
}}
 
== Patterns ==
{{SPARQL | query=  
{{SPARQL | query=  
PREFIX target: <https://dreams.wikibase.cloud/entity/Q321>
PREFIX target: <https://dreams.wikibase.cloud/entity/Q321>
Line 104: Line 67:
SELECT
SELECT
   DISTINCT
   DISTINCT
   ?pattern ?patternLabel
   ?mønster ("🔍" AS ?mønsterLabel)
   (CONCAT("#pattern/", SUBSTR(STR(?pattern), 38)) AS ?patternUrl)   
   (CONCAT("#pattern/", SUBSTR(STR(?mønster), 38)) AS ?mønsterUrl)   


   ?subject ?subjectLabel ?subjectUrl
   ?rapport ?rapportLabel
  (CONCAT("#report/", SUBSTR(STR(?rapport), 38)) AS ?rapportUrl) 


   ?object ?objectLabel ?objectUrl
   ?subjekt ?subjektLabel ?subjektUrl
 
  ?påvirkning ?påvirkningLabel ?påvirkningUrl


   ?recipient ?recipientLabel ?recipientUrl
   ?recipient ?recipientLabel ?recipientUrl


   ?significance
   ?signifikans ?signifikansLabel


   ?mitigation ?mitigationLabel ?mitigationUrl
   ?afbødning ?afbødningLabel ?afbødningUrl


   ?quote
   ?citat


   ?project_phase ?project_phaseLabel
   ?projektfase ?projektfaseLabel
   (CONCAT("#projectphase/", SUBSTR(STR(?project_phase), 38)) AS ?project_phaseUrl)   
   (CONCAT("#projectphase/", SUBSTR(STR(?projektfase), 38)) AS ?projektfaseUrl)   


   ?report ?reportLabel
   ?link ?linkUrl
  (CONCAT("#report/", SUBSTR(STR(?report), 38)) AS ?reportUrl) 


WHERE {
WHERE {
   ?pattern dreamst:P2 dreams:Q263 ;
   ?mønster dreamst:P2 dreams:Q263 ;
           dreamst:P20? / dreamst:P16 / dreamst:P10* target: .
           dreamst:P20? / dreamst:P16 / dreamst:P10* target: .


   OPTIONAL {
   OPTIONAL {
     ?pattern dreamst:P33 ?subject .
     ?mønster dreamst:P33 ?subjekt .
     ?subject rdfs:label ?subject_label .
     ?subjekt rdfs:label ?subjekt_label .
     FILTER(LANG(?subject_label) = 'da')
     FILTER(LANG(?subjekt_label) = 'da')
     BIND(CONCAT("#effect/", SUBSTR(STR(?subject), 38)) AS ?subjectUrl)
     BIND(CONCAT("#effect/", SUBSTR(STR(?subjekt), 38)) AS ?subjektUrl)
   }
   }
   OPTIONAL { ?pattern dreamst:P47 ?subject_text }
   OPTIONAL { ?mønster dreamst:P47 ?subjekt_text }
   BIND(COALESCE(?subject, ?subject_text, "") AS ?subject)
   BIND(COALESCE(?subjekt, ?subjekt_text, "") AS ?subjekt)
   BIND(CONCAT(COALESCE(?subject_label, ""), ' (', ?subject_text, ')') AS ?subjectLabel)
   BIND(CONCAT(?subjekt_text, " (", COALESCE(?subjekt_label, ""), ")") AS ?subjektLabel)
      
      
   OPTIONAL {
   OPTIONAL {
     ?pattern dreamst:P34 ?object .  
     ?mønster dreamst:P34 ?påvirkning .  
     ?object rdfs:label ?object_label .
     ?påvirkning rdfs:label ?påvirkning_label .
     FILTER (LANG(?object_label) = 'da')
     FILTER (LANG(?påvirkning_label) = 'da')
     BIND(CONCAT("#effect/", SUBSTR(STR(?object), 38)) AS ?objectUrl)
     BIND(CONCAT("#effect/", SUBSTR(STR(?påvirkning), 38)) AS ?påvirkningUrl)
   }
   }
   OPTIONAL { ?pattern dreamst:P49 ?object_text }
   OPTIONAL { ?mønster dreamst:P49 ?påvirkning_text }
   BIND(COALESCE(?object, ?object_text) AS ?object)
   BIND(COALESCE(?påvirkning, ?påvirkning_text) AS ?påvirkning)
   BIND(CONCAT(COALESCE(?object_label, ""), ' (', ?object_text, ')') AS ?objectLabel)
   BIND(CONCAT(?påvirkning_text, " (", COALESCE(?påvirkning_label, ""), ")") AS ?påvirkningLabel)


   OPTIONAL {
   OPTIONAL {
     ?pattern dreamst:P55 ?recipient .
     ?mønster dreamst:P55 ?recipient .
     ?recipient rdfs:label ?recipient_label .
     ?recipient rdfs:label ?recipient_label .
     FILTER (LANG(?recipient_label) = 'da')
     FILTER (LANG(?recipient_label) = 'da')
     BIND(CONCAT("#effect/", SUBSTR(STR(?recipient), 38)) AS ?recipientUrl)
     BIND(CONCAT("#effect/", SUBSTR(STR(?recipient), 38)) AS ?recipientUrl)
   }
   }
   OPTIONAL { ?pattern dreamst:P54 ?recipient_text }
   OPTIONAL { ?mønster dreamst:P54 ?recipient_text }
   BIND(COALESCE(?recipient, ?recipient_text) AS ?recipient)
   BIND(COALESCE(?recipient, ?recipient_text) AS ?recipient)
   BIND(CONCAT(COALESCE(?recipient_label, ""), ' (', ?recipient_text, ')') AS ?recipientLabel)
   BIND(CONCAT(?recipient_text, " (", COALESCE(?recipient_label, ""), ")") AS ?recipientLabel)


   OPTIONAL {
   OPTIONAL {
     ?pattern dreamst:P56 ?mitigation .
     ?mønster dreamst:P56 ?afbødning .
     ?mitigation rdfs:label ?mitigation_label .
     ?afbødning rdfs:label ?afbødning_label .
     FILTER (LANG(?mitigation_label) = 'da')
     FILTER (LANG(?afbødning_label) = 'da')
     BIND(CONCAT("#effect/", SUBSTR(STR(?mitigation), 38)) AS ?mitigationUrl)
     BIND(CONCAT("#effect/", SUBSTR(STR(?afbødning), 38)) AS ?afbødningUrl)
   }
   }
   OPTIONAL { ?pattern dreamst:P53 ?mitigation_text }
   OPTIONAL { ?mønster dreamst:P53 ?afbødning_text }
   BIND(COALESCE(?mitigation, ?mitigation_text) AS ?mitigation)
   BIND(COALESCE(?afbødning, ?afbødning_text) AS ?afbødning)
   BIND(CONCAT(COALESCE(?mitigation_label, ""), ' (', ?mitigation_text, ')') AS ?mitigationLabel)
   BIND(CONCAT(?afbødning_text, " (", COALESCE(?afbødning_label, ""), ")") AS ?afbødningLabel)


   OPTIONAL { ?pattern dreamst:P18 ?quote . }
   OPTIONAL { ?mønster dreamst:P18 ?citat . }
   OPTIONAL { ?pattern dreamst:P19 ?project_phase . }
   OPTIONAL { ?mønster dreamst:P19 ?projektfase . }
   OPTIONAL { ?pattern dreamst:P20 ?report . }
   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)
  }


  OPTIONAL { ?pattern dreamst:P21 / dreamst:P44 ?symbol . }
  BIND(IF(BOUND(?symbol), ?symbol, "❓") AS ?significance)


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

Latest revision as of 13:24, 9 December 2022

Projekttype-data

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

SELECT DISTINCT 
  ?beskrivelse
  ?værdi ?værdiLabel ?værdiUrl
WHERE {
  BIND(target: AS ?effect)
  {
    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

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". }
}