Querying: Difference between revisions

Jump to navigation Jump to search
Line 193: Line 193:


=== Fetch missing geocoordinates from Wikidata ===
=== Fetch missing geocoordinates from Wikidata ===
This query is not working yet. [test og:Q287 og:Q497 og:Q6421]
This query is not working yet.  
 
#Seat with Wikidata Qids but without geolocation
PREFIX og: <https://ottgaz.org/entity/>
PREFIX ogs: <https://ottgaz.org/entity/statement/>
PREFIX ogv: <https://ottgaz.org/value/>
PREFIX ogt: <https://ottgaz.org/prop/direct/>
PREFIX ogp: <https://ottgaz.org/prop/>
PREFIX ogps: <https://ottgaz.org/prop/statement/>
PREFIX ogpq: <https://ottgaz.org/prop/qualifier/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
 
SELECT  ?seat ?seatLabel ?wdURL ?coords
 
WHERE
{
  VALUES ?center {og:Q287 og:Q497 og:Q6421}
  ?seat ogt:P6 ?center.
  ?seat ogt:P3 ?wdQid.
  MINUS {?seat ogt:P10 ?geo.}
  BIND (URI(CONCAT("https://www.wikidata.org/wiki/",
  ENCODE_FOR_URI(?wdQid))) as ?wdURL).
  SERVICE <https://query.wikidata.org/sparql> {
    SELECT ?wdURL ?coords {
    ?wdURL wdt:P625 ?coords .
    }
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}


== Help ==
== Help ==

Navigation menu