Dreams:location

From DREAMS
Revision as of 07:48, 26 August 2022 by Fnielsen (talk | contribs)
Jump to navigation Jump to search

Location data

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

SELECT DISTINCT ?description ?value ?valueLabel ?valueUrl
WHERE {
  {
    BIND(1 AS ?order)
    BIND("Location" AS ?description)
    BIND(target: AS ?value) .
  }
  UNION
  {
    BIND(21 AS ?order)
    BIND("Scholia" AS ?description)
    target: dreamst:P3 ?value_ .
    BIND(CONCAT(STR(?value_), " ↗") AS ?value)
    BIND(CONCAT("https://scholia.toolforge.org/work/", STR(?value_)) AS ?valueUrl)
  }
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}
ORDER BY ?order


Reports

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

SELECT 
  ?report ?reportLabel
  (CONCAT("#report/", SUBSTR(STR(?report), 38)) AS ?reportUrl)
WHERE {
  ?report dreamst:P12 target: .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],da,en". }
}


Co-mentioned locations

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

SELECT 
  (COUNT(?report) AS ?count)
  ?location ?locationLabel
  (CONCAT("#location/", SUBSTR(STR(?location), 38)) AS ?locationUrl)
WHERE {
  ?report dreamst:P12 target: , ?location .
  FILTER (target: != ?location) 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],da,en". }
}
GROUP BY ?location ?locationLabel ?locationUrl