Dreams:effect: Difference between revisions

 
(8 intermediate revisions by the same user not shown)
Line 5: Line 5:
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
PREFIX dreamsp: <https://dreams.wikibase.cloud/prop/>
PREFIX dreamsp: <https://dreams.wikibase.cloud/prop/>
PREFIX dreamspsv: <https://dreams.wikibase.cloud/prop/statement/value/>  
PREFIX dreamspsv: <https://dreams.wikibase.cloud/prop/statement/værdi/>  


SELECT DISTINCT (?description AS ?beskrivelse) ?value ?valueLabel ?valueUrl
SELECT DISTINCT (?description AS ?beskrivelse) ?værdi ?værdiLabel ?værdiUrl
WHERE {
WHERE {
   BIND(target: AS ?effect)
   BIND(target: AS ?effect)
Line 13: Line 13:
     BIND(1 AS ?order)
     BIND(1 AS ?order)
     BIND("Effekt" AS ?description)
     BIND("Effekt" AS ?description)
     BIND(target: AS ?value) .
     BIND(target: AS ?værdi) .
   }
   }
   UNION
   UNION
Line 19: Line 19:
     BIND(5 AS ?order)
     BIND(5 AS ?order)
     BIND("Overbegreb" AS ?description)
     BIND("Overbegreb" AS ?description)
     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("#effect/", ?q) AS ?valueUrl)
     BIND(CONCAT("#effect/", ?q) AS ?værdiUrl)
   }
   }
   UNION
   UNION
   {
   {
     BIND(6 AS ?order)
     BIND(6 AS ?order)
     BIND("Overbegreb" AS ?description)
     BIND("Underbegreb" AS ?description)
     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("#effect/", ?q) AS ?valueUrl)
     BIND(CONCAT("#effect/", ?q) AS ?værdiUrl)
   }
   }
   UNION
   UNION
Line 35: Line 35:
     BIND(6 AS ?order)
     BIND(6 AS ?order)
     BIND("Påvirker" AS ?description)
     BIND("Påvirker" AS ?description)
     target: dreamst:P9 ?value .
     target: dreamst:P9 ?værdi .
     BIND(CONCAT("#effect/", SUBSTR(STR(?value), 38)) AS ?valueUrl)
     BIND(CONCAT("#effect/", SUBSTR(STR(?værdi), 38)) AS ?værdiUrl)
   }
   }
   UNION
   UNION
Line 42: Line 42:
     BIND(2 AS ?order)
     BIND(2 AS ?order)
     BIND("Er påvirket af" AS ?description)
     BIND("Er påvirket af" AS ?description)
     target: ^dreamst:P9 ?value .
     target: ^dreamst:P9 ?værdi .
     BIND(CONCAT("#effect/", SUBSTR(STR(?value), 38)) AS ?valueUrl)
     BIND(CONCAT("#effect/", SUBSTR(STR(?værdi), 38)) AS ?værdiUrl)
   }
   }
   UNION
   UNION
Line 49: Line 49:
     BIND(10 AS ?order)
     BIND(10 AS ?order)
     BIND("SDG" AS ?description)
     BIND("SDG" AS ?description)
     target: dreamst:P42 ?value .
     target: dreamst:P10* / dreamst:P10* / dreamst:P42 ?værdi .
     BIND(CONCAT("#sdg/", SUBSTR(STR(?value), 38)) AS ?valueUrl)
     BIND(CONCAT("#sdg/", SUBSTR(STR(?værdi), 38)) AS ?værdiUrl)
   }
   }
   UNION
   UNION
Line 56: Line 56:
     BIND(11 AS ?order)
     BIND(11 AS ?order)
     BIND("arter.dk" AS ?description)
     BIND("arter.dk" AS ?description)
     target: dreamst:P45 ?value_ .
     target: dreamst:P45 ?værdi_ .
     BIND(CONCAT(?value_, " ↗") AS ?value)
     BIND(CONCAT(?værdi_, " ↗") AS ?værdi)
     BIND(CONCAT("https://arter.dk/taxa/taxon/details/", ?value_) AS ?valueUrl)
     BIND(CONCAT("https://arter.dk/taxa/taxon/details/", ?værdi_) AS ?værdiUrl)
   }
   }
   UNION
   UNION
Line 64: Line 64:
     BIND(20 AS ?order)
     BIND(20 AS ?order)
     BIND("Scholia" AS ?description)
     BIND("Scholia" AS ?description)
     target: dreamst:P3 ?value_ .
     target: dreamst:P3 ?værdi_ .
     BIND(CONCAT(?value_, " ↗") AS ?value)
     BIND(CONCAT(?værdi_, " ↗") AS ?værdi)
     BIND(CONCAT("https://scholia.toolforge.org/topic/", ?value_) AS ?valueUrl)
     BIND(CONCAT("https://scholia.toolforge.org/topic/", ?værdi_) AS ?værdiUrl)
   }
   }
    
    
Line 83: Line 83:
PREFIX dreamspsv: <https://dreams.wikibase.cloud/prop/statement/value/>  
PREFIX dreamspsv: <https://dreams.wikibase.cloud/prop/statement/value/>  


SELECT
SELECT DISTINCT
   ?mønster ("🔍" AS ?mønsterLabel)
   ?mønster ("🔍" AS ?mønsterLabel)
   (CONCAT("#pattern/", SUBSTR(STR(?mønster), 38)) AS ?mønsterUrl)   
   (CONCAT("#pattern/", SUBSTR(STR(?mønster), 38)) AS ?mønsterUrl)   


   ?report ?reportLabel
   ?rapport ?rapportLabel
   (CONCAT("#report/", SUBSTR(STR(?report), 38)) AS ?reportUrl)   
   (CONCAT("#report/", SUBSTR(STR(?rapport), 38)) AS ?rapportUrl)   


   ?subject ?subjectLabel ?subjectUrl
   ?subjekt ?subjektLabel ?subjektUrl


   ?impact ?impactLabel ?impactUrl
   ?påvirkning ?påvirkningLabel ?påvirkningUrl


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


   ?significance ?significanceLabel
   ?signifikans ?signifikansLabel


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


   ?quote  
   ?quote  


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


   ?link ?linkUrl
   ?link ?linkUrl
Line 112: Line 112:


OPTIONAL {
OPTIONAL {
     ?mønster 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 { ?mønster 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(?subject_text, " (", COALESCE(?subject_label, ""), ")") AS ?subjectLabel)
   BIND(CONCAT(?subjekt_text, " (", COALESCE(?subjekt_label, ""), ")") AS ?subjektLabel)
      
      
   OPTIONAL {
   OPTIONAL {
     ?mønster dreamst:P34 ?impact .  
     ?mønster dreamst:P34 ?påvirkning .  
     ?impact rdfs:label ?impact_label .
     ?påvirkning rdfs:label ?påvirkning_label .
     FILTER (LANG(?impact_label) = 'da')
     FILTER (LANG(?påvirkning_label) = 'da')
     BIND(CONCAT("#effect/", SUBSTR(STR(?impact), 38)) AS ?impactUrl)
     BIND(CONCAT("#effect/", SUBSTR(STR(?påvirkning), 38)) AS ?påvirkningUrl)
   }
   }
   OPTIONAL { ?mønster dreamst:P49 ?impact_text }
   OPTIONAL { ?mønster dreamst:P49 ?påvirkning_text }
   BIND(COALESCE(?impact, ?impact_text) AS ?impact)
   BIND(COALESCE(?påvirkning, ?påvirkning_text) AS ?påvirkning)
   BIND(CONCAT(?impact_text, " (", COALESCE(?impact_label, ""), ")") AS ?impactLabel)
   BIND(CONCAT(?påvirkning_text, " (", COALESCE(?påvirkning_label, ""), ")") AS ?påvirkningLabel)


   OPTIONAL {
   OPTIONAL {
Line 142: Line 142:


   OPTIONAL {
   OPTIONAL {
     ?mønster 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 { ?mønster 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(?mitigation_text, " (", COALESCE(?mitigation_label, ""), ")") AS ?mitigationLabel)
   BIND(CONCAT(?afbødning_text, " (", COALESCE(?afbødning_label, ""), ")") AS ?afbødningLabel)


   OPTIONAL { ?mønster dreamst:P18 ?quote . }
   OPTIONAL { ?mønster dreamst:P18 ?quote . }
   OPTIONAL { ?mønster dreamst:P19 ?project_phase . }
   OPTIONAL { ?mønster dreamst:P19 ?projektfase . }
   OPTIONAL { ?mønster dreamst:P20 ?report . }
   OPTIONAL { ?mønster dreamst:P20 ?rapport . }


   OPTIONAL {
   OPTIONAL {
     ?mønster dreamst:P21 ?significance .
     ?mønster dreamst:P21 ?signifikans .
     ?significance rdfs:label ?significance_text .
     ?signifikans rdfs:label ?signifikans_text .
     FILTER (LANG(?significance_text) = 'da')
     FILTER (LANG(?signifikans_text) = 'da')
     OPTIONAL { ?significance dreamst:P44 ?symbol . }
     OPTIONAL { ?signifikans dreamst:P44 ?symbol . }
     BIND(IF(BOUND(?symbol), ?symbol, "❓") AS ?significance_symbol)
     BIND(IF(BOUND(?symbol), ?symbol, "❓") AS ?signifikans_symbol)
     BIND(CONCAT(?significance_symbol, " ", ?significance_text) AS ?significanceLabel)
     BIND(CONCAT(?signifikans_symbol, " ", ?signifikans_text) AS ?signifikansLabel)
   }
   }


   OPTIONAL {
   OPTIONAL {
     ?mønster dreamst:P20 ?report .
     ?mønster dreamst:P20 ?rapport .
     ?report dreamst:P40 ?miljøportal .
     ?rapport dreamst:P40 ?miljøportal .
     OPTIONAL { ?mønster dreamst:P46 ?page }
     OPTIONAL { ?mønster dreamst:P46 ?page }
     BIND(IF(BOUND(?page), CONCAT(?page, " ↗"), " ↗") AS ?link)
     BIND(IF(BOUND(?page), CONCAT(?page, " ↗"), " ↗") AS ?link)
Line 173: Line 173:
   }
   }


  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}
}}
== Er påvirket af ==
{{SPARQL | query=
PREFIX target: <https://dreams.wikibase.cloud/entity/Q6>
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
  ?pattern ?patternLabel
  (CONCAT("#pattern/", SUBSTR(STR(?pattern), 38)) AS ?patternUrl) 
  ?effect ?effectLabel
  (CONCAT("#effect/", SUBSTR(STR(?effect), 38)) AS ?effectUrl) 
  ?significance ?significanceLabel
  ?quote
  ?project_phase ?project_phaseLabel
  (CONCAT("#projectphase/", SUBSTR(STR(?project_phase), 38)) AS ?project_phaseUrl) 
  ?project_type ?project_typeLabel
  (CONCAT("#projecttype/", SUBSTR(STR(?project_type), 38)) AS ?project_typeUrl) 
  ?report ?reportLabel
  (CONCAT("#report/", SUBSTR(STR(?report), 38)) AS ?reportUrl) 
  ?link ?linkUrl
WHERE {
  ?pattern dreamst:P2 dreams:Q263 ;
          dreamst:P34 / dreamst:P10* target:
  OPTIONAL { ?pattern dreamst:P33 ?effect . }
  OPTIONAL { ?pattern dreamst:P18 ?quote . }
  OPTIONAL {
    ?pattern dreamst:P20 ?report .
 
    OPTIONAL {
      ?report dreamst:P40 ?miljøportal .
      BIND("↗" AS ?link1)
      BIND(CONCAT("https://daieproddreamspdfsto.blob.core.windows.net/files/", STR(?miljøportal)) AS ?link1Url)
    }
    OPTIONAL {
      ?report dreamst:P40 ?miljøportal .
      ?pattern dreamst:P46 ?page .
      BIND(CONCAT(?page, " ↗") AS ?link2)
      BIND(CONCAT("https://daieproddreamspdfsto.blob.core.windows.net/files/", ?miljøportal,
                  "#page=", ?page) AS ?link2Url)
    }
    # This doesn't not make sense
    BIND(COALESCE(?link2, ?link1) AS ?link)
    BIND(COALESCE(?link2Url, ?link1Url) AS ?linkUrl)
  }
  OPTIONAL { ?pattern dreamst:P21 ?significance }  # / dreamst:P44 ?symbol . }
  # BIND(IF(BOUND(?symbol), ?symbol, "❓") AS ?significance)
  OPTIONAL { ?pattern dreamst:P19 ?project_phase . }
  OPTIONAL { ?pattern dreamst:P16 ?project_type . }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}
}
}}
}}