query-1b1c15b5b2a9f2e13d8bbc4e363b141c

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT ?place ?placeLabel ?sitelink ?coord ?image ?layer WHERE 
{ 
  SERVICE wikibase:box {
      ?place wdt:P625 ?location .
      bd:serviceParam wikibase:cornerSouthWest "Point(-17.0 27.8)"^^geo:wktLiteral .
      bd:serviceParam wikibase:cornerNorthEast "Point(-16.0 28.7)"^^geo:wktLiteral .
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } 
  ?place wdt:P625 ?coord .
  ?place wdt:P31 ?p31 . 
  OPTIONAL {?p31 rdfs:label ?layer . FILTER(lang(?layer)='en') }
  OPTIONAL {?sitelink schema:about ?place ; schema:isPartOf <https://commons.wikimedia.org/>.}
  OPTIONAL {?place wdt:P18 ?image } 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?coord"):::projected v7("?image"):::projected v1("?layer"):::projected v3("?location") v5("?p31") v2("?place"):::projected v6("?sitelink"):::projected c15([https://commons.wikimedia.org/]):::iri c1(["en"]):::literal c4(["bd:serviceParam"]):::iri c6([sPoint(-17.0 27.8)^^<http://www.opengis.net/ont/geosparql#wktLiteral>"]):::literal c8([sPoint(-16.0 28.7)^^<http://www.opengis.net/ont/geosparql#wktLiteral>"]):::literal subgraph s1["http://wikiba.se/ontology#box"] style s1 stroke-width:4px; v2 --"wdt:P625"--> v3 c4 --"wikibase:cornerSouthWest"--> c6 c4 --"wikibase:cornerNorthEast"--> c8 end subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c4 --"wikibase:language"--> c1 end v2 --"wdt:P625"--> v4 v2 --"wdt:P31"--> v5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."rdfs:label".-> v1 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -."schema:about".-> v2 v6 --"schema:isPartOf"--> c15 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P18".-> v7 end