Dreams:projecttype: Difference between revisions

From DREAMS
Jump to navigation Jump to search
(→‎Patterns: Extend subject, object and add recipient and mitigation)
Line 122: Line 122:
   ?significance
   ?significance


   ?migitation ?mitigationLabel ?mitigationUrl
   ?mitigation ?mitigationLabel ?mitigationUrl


   ?quote  
   ?quote  

Revision as of 13:30, 16 November 2022

Project type 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 ?description ?value ?valueLabel ?valueUrl
WHERE {
  BIND(target: AS ?effect)
  {
    BIND(1 AS ?order)
    BIND("Project type" AS ?description)
    BIND(target: AS ?value) .
  }
  UNION
  {
    BIND(5 AS ?order)
    BIND("Supertype" AS ?description)
    target: dreamst:P10 ?value .
    BIND(SUBSTR(STR(?value), 38) AS ?q) 
    BIND(CONCAT("#projecttype/", ?q) AS ?valueUrl)
  }
  UNION
  {
    BIND(6 AS ?order)
    BIND("Subtype" AS ?description)
    target: ^dreamst:P10 ?value .
    BIND(SUBSTR(STR(?value), 38) AS ?q) 
    BIND(CONCAT("#projecttype/", ?q) AS ?valueUrl)
  }
  UNION
  {
    BIND(10 AS ?order)
    BIND("External description" AS ?description)
    target: dreamst:P29 ?value .
    BIND(?value AS ?valueUrl)
  }

  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}
ORDER BY ?order


Effects

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


Reports

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

SELECT 
  ?project_type ?project_typeLabel
  (CONCAT("#projecttype/", SUBSTR(STR(?project_type), 38)) AS ?project_typeUrl)

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

WHERE {
  ?project_type dreamst:P10* target: .
  ?report dreamst:P2 / dreamst:P10* dreams:Q8 ;   
          dreamst:P16 ?project_type .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en,it". }
}


Patterns

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
  ?pattern ?patternLabel
  (CONCAT("#pattern/", SUBSTR(STR(?pattern), 38)) AS ?patternUrl)  

  ?subject ?subjectLabel ?subjectUrl

  ?object ?objectLabel ?objectUrl

  ?recipient ?recipientLabel ?recipientUrl

  ?significance

  ?mitigation ?mitigationLabel ?mitigationUrl

  ?quote 

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

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

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

  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 ?object . 
    ?object rdfs:label ?object_label .
    FILTER (LANG(?object_label) = 'da')
    BIND(CONCAT("#effect/", SUBSTR(STR(?object), 38)) AS ?objectUrl)
  }
  OPTIONAL { ?pattern dreamst:P49 ?object_text }
  BIND(COALESCE(?object, ?object_text) AS ?object)
  BIND(CONCAT(COALESCE(?object_label, ""), ' (', ?object_text, ')') AS ?objectLabel)

  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:P19 ?project_phase . }
  OPTIONAL { ?pattern dreamst:P20 ?report . }

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

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