Dreams:report

From DREAMS
Jump to navigation Jump to search

Rapportdata

PREFIX target: <https://dreams.wikibase.cloud/entity/Q158>
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/værdi/> 

SELECT DISTINCT ?beskrivelse
  ?værdi ?værdiLabel ?værdiUrl
WHERE {
  BIND(target: AS ?work)
  {
    BIND(1 AS ?order)
    BIND("Titel" AS ?beskrivelse)
    ?work dreamst:P1 ?værdi .
  }
  UNION
  {
    BIND(2 AS ?order)
    BIND("Forfatter" AS ?beskrivelse)
    target: dreamst:P24 ?iri .
    BIND(SUBSTR(STR(?iri), 38) AS ?q) 
    ?iri rdfs:label ?værdi . 
    FILTER (LANG(?værdi) = 'da')
    BIND(CONCAT("#author/", ?q) AS ?værdiUrl)
  }
  UNION
  {
    BIND(2.5 AS ?order)
    BIND("Sprog" AS ?beskrivelse)
    ?work dreamst:P11 ?iri .
    ?iri rdfs:label ?værdi_string .
    FILTER (LANG(?værdi_string) = 'da')
    BIND(STR(?værdi_string) AS ?værdi)
  }
  UNION
  {
    BIND(6 AS ?order)
    BIND("Udgivelsesdato" AS ?beskrivelse)
    ?work dreamsp:P6 / dreamspsv:P6 ?publication_date_værdi .
    ?publication_date_værdi wikibase:timePrecision ?time_precision ;
                            wikibase:timeValue ?publication_date .
    BIND(IF(?time_precision = 9, YEAR(?publication_date), xsd:date(?publication_date)) AS ?værdi)
  }
  UNION
  {
    BIND(7 AS ?order)
    BIND("Udgiver" AS ?beskrivelse)
    ?work dreamst:P26 ?iri .
    BIND(SUBSTR(STR(?iri), 38) AS ?q) 
    ?iri rdfs:label ?værdi_string . 
    FILTER (LANG(?værdi_string) = 'da')
    BIND(COALESCE(?værdi_string, ?q) AS ?værdi)
    BIND(CONCAT("#publisher/", ?q) AS ?værdiUrl)
  }
  UNION
  {
    BIND(10 AS ?order)
    BIND("Projekttype" AS ?beskrivelse)
    ?work dreamst:P16 ?værdi .
    BIND(CONCAT("#projecttype/", SUBSTR(STR(?værdi), 38)) AS ?værdiUrl)
  }
  UNION
  {
    BIND(21 AS ?order)
    BIND("Scholia" AS ?beskrivelse)
    ?work dreamst:P3 ?værdi_ .
    BIND(CONCAT(STR(?værdi_), " ↗") AS ?værdi)
    BIND(CONCAT("https://scholia.toolforge.org/work/", STR(?værdi_)) AS ?værdiUrl)
  }
  UNION
  {
    BIND(22 AS ?order)
    BIND("Miljøportal" AS ?beskrivelse)
    ?work dreamst:P40 ?værdi_ .
    BIND(CONCAT(STR(?værdi_), " ↗") AS ?værdi)
    BIND(CONCAT("https://daieproddreamspdfsto.blob.core.windows.net/files/", STR(?værdi_)) AS ?værdiUrl)
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],da,en". }
} 
ORDER BY ?order


Patterns

PREFIX target: <https://dreams.wikibase.cloud/entity/Q406>
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 ?significanceLabel

  ?mitigation ?mitigationLabel ?mitigationUrl

  ?quote 

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

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

  ?link ?linkUrl

WITH {
  SELECT DISTINCT 
    ?pattern
    ?subject ?subjectLabel ?subjectUrl
    ?object ?objectLabel ?objectUrl
    ?recipient ?recipientLabel ?recipientUrl
    ?significance ?significanceLabel
    ?mitigation ?mitigationLabel ?mitigationUrl
    ?quote
    ?project_phase
    ?project_type
    ?link ?linkUrl
  WHERE {
    ?pattern dreamst:P2 dreams:Q263 ;
             dreamst:P20 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(?subject_text, " (", COALESCE(?subject_label, ""), ")") 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(?object_text, " (", COALESCE(?object_label, ""), ")") 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(?recipient_text, " (", COALESCE(?recipient_label, ""), ")") 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(?mitigation_text, " (", COALESCE(?mitigation_label, ""), ")") AS ?mitigationLabel)

    OPTIONAL { ?pattern dreamst:P18 ?quote . }
   
    OPTIONAL { ?pattern dreamst:P19 ?project_phase . }
    
    OPTIONAL { ?pattern dreamst:P16 ?project_type1 . }
    OPTIONAL { ?pattern dreamst:P20 / dreamst:P16 ?project_type2 . }
    BIND(COALESCE(?project_type1, ?project_type2) AS ?project_type)
                 
    OPTIONAL {
      ?pattern dreamst:P21 ?significance .
      ?significance rdfs:label ?significance_text .
      FILTER (LANG(?significance_text) = 'da')
      OPTIONAL { ?significance dreamst:P44 ?symbol . }
      BIND(IF(BOUND(?symbol), ?symbol, "❓") AS ?significance_symbol)
      BIND(CONCAT(?significance_symbol, " ", ?significance_text) AS ?significanceLabel)
    }

    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)
    }
  }
} AS %result
WHERE {
  INCLUDE %result
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}


Steder

PREFIX target: <https://dreams.wikibase.cloud/entity/Q158>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
PREFIX dreamsp: <https://dreams.wikibase.cloud/prop/>
PREFIX dreamspr: <https://dreams.wikibase.cloud/prop/reference/>
PREFIX dreamsps: <https://dreams.wikibase.cloud/prop/statement/> 
PREFIX prov: <http://www.w3.org/ns/prov#>

SELECT 
  ?sted ?stedLabel
  (CONCAT("#location/", SUBSTR(STR(?sted), 38)) AS ?stedUrl)
  ?stedDescription

  ?citat
WHERE {
  target: dreamsp:P12 ?sted_statement .
  ?sted_statement dreamsps:P12 ?sted .
  OPTIONAL {
    ?sted_statement prov:wasDerivedFrom / dreamspr:P18 ?citat .
  }
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}


Citations SPARQL | query= PREFIX target: <https://dreams.wikibase.cloud/entity/Q100> 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

 ?title
 ("Scholia ↗" AS ?scholia) 
 ?scholiaUrl

WHERE {

 target: dreamst:P3 ?wikidata_q .
 BIND(IRI(CONCAT("http://www.wikidata.org/entity/", ?wikidata_q)) AS ?wikidata)
 
 SERVICE <https://query.wikidata.org/sparql> {
   ?wikidata wdt:P2860 ?cited .
   OPTIONAL {
     ?cited wdt:P1476 ?title .
   }
   BIND(CONCAT("https://scholia.toolforge.org/work/", SUBSTR(STR(?cited), 32)) AS ?scholiaUrl)
 }

} }}

Related works from co-citations 

SPARQL | query= PREFIX target: <https://dreams.wikibase.cloud/entity/Q100> PREFIX dreams: <https://dreams.wikibase.cloud/entity/> PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>

SELECT

 ?score
 ?title ?titleUrl
 ("Scholia ↗" AS ?scholia) ?scholiaUrl
 

WHERE {

 { 
   SELECT 
     (COUNT(*) AS ?score)
     ?work ?title
   WHERE {
     target: dreamst:P3 ?wikidata_q .
     BIND(IRI(CONCAT("http://www.wikidata.org/entity/", ?wikidata_q)) AS ?wikidata)
 
     SERVICE <https://query.wikidata.org/sparql> {
       ?wikidata (^wdt:P2860 | wdt:P2860) / (^wdt:P2860 | wdt:P2860)? ?work .
       FILTER (?wikidata != ?work)
       ?work wdt:P1476 ?title .
     }
   }
   GROUP BY ?work ?title 
   ORDER BY DESC(?count)
   LIMIT 500
 }
 BIND(CONCAT("https://scholia.toolforge.org/work/", SUBSTR(STR(?work), 32)) AS ?scholiaUrl)
 BIND(SUBSTR(STR(?work), 32) AS ?work_q)
 OPTIONAL {
   ?dreams_work dreamst:P3 ?work_q .
   BIND(CONCAT("#report/", SUBSTR(STR(?dreams_work), 38)) AS ?titleUrl)
 }

} ORDER BY DESC(?score) DESC(?titleUrl)

}}