Main Page: Difference between revisions

From DREAMS
Jump to navigation Jump to search
No edit summary
(→‎Object class quickstatements: Recipient class quickstatements)
 
(11 intermediate revisions by the same user not shown)
Line 230: Line 230:


== Quickstatements generation ==
== Quickstatements generation ==
=== Object class ===
=== Subject text count ===
<pre>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
 
SELECT
  (COUNT(?pattern) AS ?count) ?text
WHERE {
 
    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P47 ?text .
    MINUS { ?pattern dreamst:P33 [] }
GROUP BY ?text
ORDER BY DESC(?count)
</pre>
 
=== Object text count ===
<pre>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
 
SELECT
  (COUNT(?pattern) AS ?count) ?text
WHERE {
 
    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P49 ?text .
    MINUS { ?pattern dreamst:P34 [] }
GROUP BY ?text
ORDER BY DESC(?count)
</pre>
 
=== Recipient text count ===
<pre>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
 
SELECT
  (COUNT(?pattern) AS ?count) ?text
WHERE {
 
    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P54 ?text .
    MINUS { ?pattern dreamst:P55 [] }
GROUP BY ?text
ORDER BY DESC(?count)
</pre>
 
=== Mitigation text count ===
<pre>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
 
SELECT
  (COUNT(?pattern) AS ?count) ?text
WHERE {
 
    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P53 ?text .
    MINUS { ?pattern dreamst:P56 [] }
GROUP BY ?text
ORDER BY DESC(?count)
</pre>
 
=== Subject class quickstatements ===
<pre>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
 
SELECT
  ?qs
  # (COUNT(?pattern) AS ?count) ?object_text
WHERE {
  { BIND("qid,P33" AS ?qs) }
  UNION
  {
    BIND(dreams:Q113 AS ?target)
    { ?target rdfs:label ?target_text . }
    UNION
    { ?target skos:altLabel ?target_text . }
    FILTER(LANG(?target_text) = 'da')
    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P47 ?target_text .
    MINUS { ?pattern dreamst:P33 [] }
    BIND(CONCAT(SUBSTR(STR(?pattern), 38), ',', SUBSTR(STR(?target) , 38)) AS ?qs)
  }
}
</pre>
 
=== Object class quickstatements ===
<pre>
<pre>
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/>
PREFIX dreamsp: <https://dreams.wikibase.cloud/prop/>
PREFIX dreamspsv: <https://dreams.wikibase.cloud/prop/statement/value/>


SELECT
SELECT
Line 252: Line 343:
     ?pattern dreamst:P49 ?target_text .
     ?pattern dreamst:P49 ?target_text .
     MINUS { ?pattern dreamst:P34 [] }
     MINUS { ?pattern dreamst:P34 [] }
    BIND(CONCAT(SUBSTR(STR(?pattern), 38), ',', SUBSTR(STR(?target) , 38)) AS ?qs)
  }
}
</pre>
=== Recipient class quickstatements ===
<pre>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
SELECT
  ?qs
  # (COUNT(?pattern) AS ?count) ?object_text
WHERE {
  { BIND("qid,P55" AS ?qs) }
  UNION
  {
    BIND(dreams:Q951 AS ?target)
    { ?target rdfs:label ?target_text . }
    UNION
    { ?target skos:altLabel ?target_text . }
    FILTER(LANG(?target_text) = 'da')
    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P54 ?target_text .
    MINUS { ?pattern dreamst:P55 [] }
    BIND(CONCAT(SUBSTR(STR(?pattern), 38), ',', SUBSTR(STR(?target) , 38)) AS ?qs)
  }
}
</pre>
=== Mitigation class quickstatements ===
<pre>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
SELECT
  ?qs
  # (COUNT(?pattern) AS ?count) ?object_text
WHERE {
  { BIND("qid,P56" AS ?qs) }
  UNION
  {
    BIND(dreams:Q825 AS ?target)
    { ?target rdfs:label ?target_text . }
    UNION
    { ?target skos:altLabel ?target_text . }
    FILTER(LANG(?target_text) = 'da')
    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P53 ?target_text .
    MINUS { ?pattern dreamst:P56 [] }
     BIND(CONCAT(SUBSTR(STR(?pattern), 38), ',', SUBSTR(STR(?target) , 38)) AS ?qs)
     BIND(CONCAT(SUBSTR(STR(?pattern), 38), ',', SUBSTR(STR(?target) , 38)) AS ?qs)
   }  
   }  

Latest revision as of 20:39, 24 November 2022

Items

Dokuments

Projects

Effect patterns

Query

Ontology

Items

Properties

Queries

Subclass graph

#defaultView:Graph
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>

SELECT ?concept2 ?concept2Label ?concept1 ?concept1Label {
  ?concept2 dreamst:P10 ?concept1 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}

Query

Graph example

#defaultView:Map
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>

SELECT ?report ?reportLabel ?location ?locationLabel ?geo {
  ?report dreamst:P12 ?location .
  ?location dreamst:P13 ?geo
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}

Sustainable Development Goals

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

SELECT ?sdg ?sdgLabel {
  ?sdg dreamst:P2 dreams:Q22 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Impact graph from ontology

#defaultView:Graph
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>

SELECT ?concept2 ?concept2Label ?concept1 ?concept1Label {
  ?concept2 dreamst:P14 ?concept1 .
  { BIND (dreams:Q49 AS ?concept1) }
  UNION
  {
    ?concept1 dreamst:P14+ dreams:Q49 .
    ?concept2 dreamst:P14+ dreams:Q49 .
  }    
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}

Subactivities ontology

#defaultView:Graph
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>

SELECT ?concept1 ?concept1Label ?rgb ?concept2 ?concept2Label  {
    ?concept1 dreamst:P14 ?concept2 .
    { BIND (dreams:Q106 AS ?concept2) }
    UNION
    {
      ?concept1 dreamst:P14+ dreams:Q106 .
    }
    OPTIONAL {
      ?concept1 dreamst:P19 ?project_phase1 . 
      BIND( IF(?project_phase1 = dreams:Q97, "3182BD", "E6550D") AS ?rgb)
    } 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}

Query

Effect graph

#defaultView:Graph
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>

SELECT
  ?subactivity ?subactivityLabel ?rgb
  ?impact ?impactLabel
{
  BIND( IF(EXISTS { ?subactivity dreamst:P14+ dreams:Q106 }, "3182BD", "E6550D") AS ?rgb)
  # ?impact dreamst:P14+ dreams:Q49 .
  ?subactivity dreamst:P9 ?impact .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
} 

Effect with "has effect" and effect patterns:

#defaultView:Graph
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>

SELECT
  ?effect1 ?effect1Label
  ?effect2 ?effect2Label
  # ?effect3 ?effect3Label
WHERE {

  {
    [] dreamst:P33 ?effect1 ;
       dreamst:P34 ?effect2 .
  }
  UNION 
  {
    ?effect1 dreamst:P10* / dreamst:P9 ?effect2 .
  }
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
} 

Query

Project types

#defaultView:Graph
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>

SELECT
  ?project1 ?project1Label
  ?project2 ?project2Label
WHERE {
  { ?project1 dreamst:P14+ dreams:Q91 .
    ?project2 dreamst:P14+ dreams:Q91 }
  UNION
  { BIND(dreams:Q91 AS ?project1) }
  ?project2 dreamst:P14 ?project1 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}

Query

Effect patterns subject-object graph

#defaultView:Graph
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>

SELECT
  ?subject ?subjectLabel
  ?object ?objectLabel
WHERE {
  [] dreamst:P2 dreams:Q263 ;
     dreamst:P33 ?subject ;
     dreamst:P34 ?object .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}

Query

Quotes

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

SELECT DISTINCT
  ?pattern
  ?quote
WHERE {
  ?pattern dreamst:P18 ?quote .
}

Quote

Number of pages through time

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

SELECT 
  ?year
  ?pages
  ?report ?reportLabel
WHERE {
  ?report dreamst:P2 dreams:Q4 ;
          dreamst:P27 ?pages ;
          dreamst:P6 ?publication_datetime .
  BIND(STR(YEAR(?publication_datetime)) AS ?year)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?year

Quotes

Quickstatements generation

Subject text count

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

SELECT
  (COUNT(?pattern) AS ?count) ?text
WHERE {

    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P47 ?text .
    MINUS { ?pattern dreamst:P33 [] }
}   
GROUP BY ?text
ORDER BY DESC(?count) 

Object text count

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

SELECT
  (COUNT(?pattern) AS ?count) ?text
WHERE {

    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P49 ?text .
    MINUS { ?pattern dreamst:P34 [] }
}   
GROUP BY ?text
ORDER BY DESC(?count) 

Recipient text count

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

SELECT
  (COUNT(?pattern) AS ?count) ?text
WHERE {

    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P54 ?text .
    MINUS { ?pattern dreamst:P55 [] }
}   
GROUP BY ?text
ORDER BY DESC(?count) 

Mitigation text count

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

SELECT
  (COUNT(?pattern) AS ?count) ?text
WHERE {

    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P53 ?text .
    MINUS { ?pattern dreamst:P56 [] }
}   
GROUP BY ?text
ORDER BY DESC(?count) 

Subject class quickstatements

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

SELECT
  ?qs
  # (COUNT(?pattern) AS ?count) ?object_text
WHERE {
  { BIND("qid,P33" AS ?qs) }
  UNION
  {
    BIND(dreams:Q113 AS ?target) 
    { ?target rdfs:label ?target_text . }
    UNION
    { ?target skos:altLabel ?target_text . }
    FILTER(LANG(?target_text) = 'da')
    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P47 ?target_text .
    MINUS { ?pattern dreamst:P33 [] }
    BIND(CONCAT(SUBSTR(STR(?pattern), 38), ',', SUBSTR(STR(?target) , 38)) AS ?qs)
  } 
}

Object class quickstatements

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

SELECT
  ?qs
  # (COUNT(?pattern) AS ?count) ?object_text
WHERE {
  { BIND("qid,P34" AS ?qs) }
  UNION
  {
    BIND(dreams:Q2450 AS ?target) 
    { ?target rdfs:label ?target_text . }
    UNION
    { ?target skos:altLabel ?target_text . }
    FILTER(LANG(?target_text) = 'da')
    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P49 ?target_text .
    MINUS { ?pattern dreamst:P34 [] }
    BIND(CONCAT(SUBSTR(STR(?pattern), 38), ',', SUBSTR(STR(?target) , 38)) AS ?qs)
  } 
}

Recipient class quickstatements

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

SELECT
  ?qs
  # (COUNT(?pattern) AS ?count) ?object_text
WHERE {
  { BIND("qid,P55" AS ?qs) }
  UNION
  {
    BIND(dreams:Q951 AS ?target) 
    { ?target rdfs:label ?target_text . }
    UNION
    { ?target skos:altLabel ?target_text . }
    FILTER(LANG(?target_text) = 'da')
    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P54 ?target_text .
    MINUS { ?pattern dreamst:P55 [] }
    BIND(CONCAT(SUBSTR(STR(?pattern), 38), ',', SUBSTR(STR(?target) , 38)) AS ?qs)
  } 
}

Mitigation class quickstatements

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

SELECT
  ?qs
  # (COUNT(?pattern) AS ?count) ?object_text
WHERE {
  { BIND("qid,P56" AS ?qs) }
  UNION
  {
    BIND(dreams:Q825 AS ?target) 
    { ?target rdfs:label ?target_text . }
    UNION
    { ?target skos:altLabel ?target_text . }
    FILTER(LANG(?target_text) = 'da')
    ?pattern dreamst:P2 dreams:Q263 .
    ?pattern dreamst:P53 ?target_text .
    MINUS { ?pattern dreamst:P56 [] }
    BIND(CONCAT(SUBSTR(STR(?pattern), 38), ',', SUBSTR(STR(?target) , 38)) AS ?qs)
  } 
}

Cradle queries

Reports

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

SELECT
  (GROUP_CONCAT(?q; separator=",") AS ?reports)
WHERE {
  ?report dreamst:P2 dreams:Q4 .
  BIND(SUBSTR(STR(?report), 38) AS ?q)
  BIND(1 AS ?dummy)
}
GROUP BY ?dummy

Significance types

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

SELECT
  (GROUP_CONCAT(?q; separator=",") AS ?item)
WHERE {
  {
    SELECT 
      ?item ?itemLabel
    WHERE {
      ?item dreamst:P2 dreams:Q177 .
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
    }
    ORDER BY ?itemLabel
  }
  BIND(SUBSTR(STR(?item), 38) AS ?q)
  BIND(1 AS ?dummy)
}
GROUP BY ?dummy