Dreams:pattern-index: Difference between revisions
Jump to navigation
Jump to search
(→Patterns: Name change from object to impact) |
|||
Line 12: | Line 12: | ||
?subject ?subjectLabel ?subjectUrl | ?subject ?subjectLabel ?subjectUrl | ||
? | ?impact ?impactLabel ?impactUrl | ||
?recipient ?recipientLabel ?recipientUrl | ?recipient ?recipientLabel ?recipientUrl | ||
Line 41: | Line 41: | ||
OPTIONAL { | OPTIONAL { | ||
?pattern dreamst:P34 ? | ?pattern dreamst:P34 ?impact . | ||
? | ?impact rdfs:label ?impact_label . | ||
FILTER (LANG(? | FILTER (LANG(?impact_label) = 'da') | ||
BIND(CONCAT("#effect/", SUBSTR(STR(? | BIND(CONCAT("#effect/", SUBSTR(STR(?impact), 38)) AS ?impactUrl) | ||
} | } | ||
OPTIONAL { ?pattern dreamst:P49 ? | OPTIONAL { ?pattern dreamst:P49 ?impact_text } | ||
BIND(COALESCE(? | BIND(COALESCE(?impact, ?impact_text) AS ?impact) | ||
BIND(CONCAT(COALESCE(? | BIND(CONCAT(COALESCE(?impact_label, ""), ' (', ?impact_text, ')') AS ?impactLabel) | ||
OPTIONAL { | OPTIONAL { | ||
Line 85: | Line 85: | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". } | ||
} | }}} | ||
}} | |||
== Reports == | == Reports == |
Revision as of 16:29, 8 December 2022
Patterns
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) ?subject ?subjectLabel ?subjectUrl ?impact ?impactLabel ?impactUrl ?recipient ?recipientLabel ?recipientUrl ?mitigation ?mitigationLabel ?mitigationUrl ?quote ?project_phase ?project_phaseLabel ?project_type ?project_typeLabel ?report ?reportLabel (CONCAT("#report/", SUBSTR(STR(?report), 38)) AS ?reportUrl) ?link ?linkUrl WHERE { ?pattern dreamst:P2 dreams:Q263 . OPTIONAL { ?pattern dreamst:P33 ?subject . ?subject rdfs:label ?subject_label . FILTER(LANG(?subject_label) = 'da') BIND(CONCAT("#effect/", SUBSTR(STR(?subject), 38)) AS ?subjectUrl) } OPTIONAL { ?pattern dreamst:P47 ?subject_text } BIND(COALESCE(?subject, ?subject_text, "") AS ?subject) BIND(CONCAT(COALESCE(?subject_label, ""), ' (', ?subject_text, ')') AS ?subjectLabel) OPTIONAL { ?pattern dreamst:P34 ?impact . ?impact rdfs:label ?impact_label . FILTER (LANG(?impact_label) = 'da') BIND(CONCAT("#effect/", SUBSTR(STR(?impact), 38)) AS ?impactUrl) } OPTIONAL { ?pattern dreamst:P49 ?impact_text } BIND(COALESCE(?impact, ?impact_text) AS ?impact) BIND(CONCAT(COALESCE(?impact_label, ""), ' (', ?impact_text, ')') AS ?impactLabel) OPTIONAL { ?pattern dreamst:P55 ?recipient . ?recipient rdfs:label ?recipient_label . FILTER (LANG(?recipient_label) = 'da') BIND(CONCAT("#effect/", SUBSTR(STR(?recipient), 38)) AS ?recipientUrl) } OPTIONAL { ?pattern dreamst:P54 ?recipient_text } BIND(COALESCE(?recipient, ?recipient_text) AS ?recipient) BIND(CONCAT(COALESCE(?recipient_label, ""), ' (', ?recipient_text, ')') AS ?recipientLabel) OPTIONAL { ?pattern dreamst:P56 ?mitigation . ?mitigation rdfs:label ?mitigation_label . FILTER (LANG(?mitigation_label) = 'da') BIND(CONCAT("#effect/", SUBSTR(STR(?mitigation), 38)) AS ?mitigationUrl) } OPTIONAL { ?pattern dreamst:P53 ?mitigation_text } BIND(COALESCE(?mitigation, ?mitigation_text) AS ?mitigation) BIND(CONCAT(COALESCE(?mitigation_label, ""), ' (', ?mitigation_text, ')') AS ?mitigationLabel) OPTIONAL { ?pattern dreamst:P18 ?quote . } OPTIONAL { ?pattern dreamst:P20 ?report . } OPTIONAL { ?pattern dreamst:P19 ?project_phase . } OPTIONAL { ?pattern dreamst:P16 ?project_type . } OPTIONAL { ?pattern dreamst:P20 ?report . ?report dreamst:P40 ?miljøportal . OPTIONAL { ?pattern 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". }
}
Reports
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 ?report ?reportLabel (CONCAT("#report/", SUBSTR(STR(?report), 38)) AS ?reportUrl) WITH { SELECT (COUNT(?pattern) AS ?number_of_patterns) ?report WHERE { ?pattern dreamst:P2 dreams:Q263 ; dreamst:P20 ?report . } GROUP BY ?report } AS %result WHERE { INCLUDE %result SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". } } ORDER BY DESC(?number_of_patterns)