Dreams:pattern: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 1: Line 1:
== Pattern data ==
== Pattern data ==
{{SPARQL | query=  
{{SPARQL | query=  
PREFIX target: <https://dreams.wikibase.cloud/entity/Q939>
PREFIX target: <https://dreams.wikibase.cloud/entity/Q935>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
Line 12: Line 12:
   {
   {
     BIND(1 AS ?order)
     BIND(1 AS ?order)
     BIND("Subject&nbsp;(effector)" AS ?description)
     BIND("Subject (effector)" AS ?description)
     OPTIONAL {
     OPTIONAL {
       ?pattern dreamst:P33 ?value .  
       ?pattern dreamst:P33 ?value .  
       ?value rdfs:label ?value_label .
       ?value rdfs:label ?value_label .
       FILTER (LANG(?value_label) = 'da')
       FILTER (LANG(?value_label) = 'da')
      BIND(CONCAT("#effect/", SUBSTR(STR(?value), 38)) AS ?valueUrl)
     }
     }
     OPTIONAL { ?pattern dreamst:P47 ?value_text }
     OPTIONAL { ?pattern dreamst:P47 ?value_text }
    BIND(COALESCE(?value, ?value_text) AS ?value)
     BIND(CONCAT(COALESCE(?value_label, ""), ' ("', ?value_text, '")') AS ?valueLabel)
     BIND(CONCAT(COALESCE(?value_label, ""), ' ("', ?value_text, '")') AS ?valueLabel)
    BIND(IF(!BOUND(?value), ?value_text) AS ?value)
    BIND(CONCAT("#effect/", SUBSTR(STR(?value), 38)) AS ?valueUrl)
   }
   }
   UNION
   UNION
   {
   {
     BIND(2 AS ?order)
     BIND(2 AS ?order)
     BIND("Object&nbsp;(affected)" AS ?description)
     BIND("Object (affected)" AS ?description)
     OPTIONAL {
     OPTIONAL {
       ?pattern dreamst:P34 ?value .
       ?pattern dreamst:P34 ?value .
Line 34: Line 34:
     }
     }
     OPTIONAL { ?pattern dreamst:P49 ?value_text }
     OPTIONAL { ?pattern dreamst:P49 ?value_text }
    BIND(COALESCE(?value, ?value_text) AS ?value)
     BIND(CONCAT(COALESCE(?value_label, ""), ' ("', ?value_text, '")') AS ?valueLabel)
     BIND(CONCAT(COALESCE(?value_label, ""), ' ("', ?value_text, '")') AS ?valueLabel)
   }
   }

Navigation menu