Dreams:pattern-index: Difference between revisions

From DREAMS
Jump to navigation Jump to search
(→‎Patterns: Removed quotation mark)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Patterns ==
== Mønstre ==
{{SPARQL | query=
{{SPARQL | query=
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
Line 7: Line 7:


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


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


   ?object ?objectLabel ?objectUrl
   ?påvirkning ?påvirkningLabel ?påvirkningUrl


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


   ?quote
   ?afbødning ?afbødningLabel ?afbødningUrl
  ?project_phase ?project_phaseLabel
  ?project_type ?project_typeLabel


   ?report ?reportLabel
   ?citat
   (CONCAT("#report/", SUBSTR(STR(?report), 38)) AS ?reportUrl)
  ?projektfase ?projektfaseLabel
  ?projekttype ?projekttypeLabel
 
  ?rapport ?rapportLabel
   (CONCAT("#report/", SUBSTR(STR(?rapport), 38)) AS ?rapportUrl)


   ?link ?linkUrl
   ?link ?linkUrl


WHERE {
WHERE {
   ?pattern dreamst:P2 dreams:Q263 .
   ?mønster dreamst:P2 dreams:Q263 .


   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(COALESCE(?subjekt_label, ""), ' (', ?subjekt_text, ')') 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(COALESCE(?påvirkning_label, ""), ' (', ?påvirkning_text, ')') 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(COALESCE(?recipient_label, ""), ' (', ?recipient_text, ')') AS ?recipientLabel)


   OPTIONAL { ?pattern dreamst:P18 ?quote . }
  OPTIONAL {
   OPTIONAL { ?pattern dreamst:P20 ?report . }
    ?mønster dreamst:P56 ?afbødning .
   OPTIONAL { ?pattern dreamst:P19 ?project_phase . }
    ?afbødning rdfs:label ?afbødning_label .
   OPTIONAL { ?pattern dreamst:P16 ?project_type . }
    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(COALESCE(?afbødning_label, ""), ' (', ?afbødning_text, ')') AS ?afbødningLabel)
 
   OPTIONAL { ?mønster dreamst:P18 ?citat . }
   OPTIONAL { ?mønster dreamst:P20 ?rapport . }
   OPTIONAL { ?mønster dreamst:P19 ?projektfase . }
   OPTIONAL { ?mønster dreamst:P16 ?projekttype . }
    
    
   OPTIONAL {
   OPTIONAL {
     ?pattern dreamst:P20 ?report .
     ?mønster dreamst:P20 ?rapport .
     ?report dreamst:P40 ?miljøportal .
     ?rapport dreamst:P40 ?miljøportal .
     OPTIONAL { ?pattern 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)
     BIND(CONCAT("https://daieproddreamspdfsto.blob.core.windows.net/files/", STR(?miljøportal),  
     BIND(CONCAT("https://daieproddreamspdfsto.blob.core.windows.net/files/", STR(?miljøportal),  
Line 76: Line 88:
}}
}}


== Reports ==
== Rapporter ==
{{SPARQL | query=  
{{SPARQL | query=  
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
Line 84: Line 96:


SELECT  
SELECT  
   ?number_of_patterns
   ?mønstre


   ?report
   ?rapport
   ?reportLabel
   ?rapportLabel
   (CONCAT("#report/", SUBSTR(STR(?report), 38)) AS ?reportUrl)
   (CONCAT("#report/", SUBSTR(STR(?rapport), 38)) AS ?rapportUrl)
            
            
WITH {
WITH {
   SELECT
   SELECT
     (COUNT(?pattern) AS ?number_of_patterns)
     (COUNT(?pattern) AS ?mønstre)
     ?report
     ?rapport
   WHERE {
   WHERE {
     ?pattern dreamst:P2 dreams:Q263 ;
     ?pattern dreamst:P2 dreams:Q263 ;
             dreamst:P20 ?report .
             dreamst:P20 ?rapport .
   }
   }
   GROUP BY ?report
   GROUP BY ?rapport
} AS %result
} AS %result
WHERE {
WHERE {
Line 104: Line 116:
   SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}
}
ORDER BY DESC(?number_of_patterns)
ORDER BY DESC(?mønstre)
}}
}}

Latest revision as of 17:02, 9 December 2022

Mønstre

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ønster ?mønsterLabel
  (CONCAT("#pattern/", SUBSTR(STR(?mønster), 38)) AS ?mønsterUrl)

  ?subjekt ?subjektLabel ?subjektUrl

  ?påvirkning ?påvirkningLabel ?påvirkningUrl

  ?recipient ?recipientLabel ?recipientUrl

  ?afbødning ?afbødningLabel ?afbødningUrl

  ?citat 
  ?projektfase ?projektfaseLabel
  ?projekttype ?projekttypeLabel

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

  ?link ?linkUrl

WHERE {
  ?mønster dreamst:P2 dreams:Q263 .

  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(COALESCE(?subjekt_label, ""), ' (', ?subjekt_text, ')') 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(COALESCE(?påvirkning_label, ""), ' (', ?påvirkning_text, ')') 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(COALESCE(?recipient_label, ""), ' (', ?recipient_text, ')') 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(COALESCE(?afbødning_label, ""), ' (', ?afbødning_text, ')') AS ?afbødningLabel)

  OPTIONAL { ?mønster dreamst:P18 ?citat . }
  OPTIONAL { ?mønster dreamst:P20 ?rapport . }
  OPTIONAL { ?mønster dreamst:P19 ?projektfase . }
  OPTIONAL { ?mønster dreamst:P16 ?projekttype . }
  
  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". }
}


Rapporter

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

  ?rapport 
  ?rapportLabel
  (CONCAT("#report/", SUBSTR(STR(?rapport), 38)) AS ?rapportUrl)
          
WITH {
  SELECT
    (COUNT(?pattern) AS ?mønstre)
    ?rapport
  WHERE {
    ?pattern dreamst:P2 dreams:Q263 ;
             dreamst:P20 ?rapport .
  }
  GROUP BY ?rapport
} AS %result
WHERE {
  INCLUDE %result
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}
ORDER BY DESC(?mønstre)