query-113fa108e05176fdb394b9bb00395b98

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?build ?buildLabel ?countryLabel ?placeLabel ?heritLabel ?location ?wikipedia
# gives the archaeological sites around Avignon
WHERE {
  SERVICE wikibase:box {
    ?build wdt:P625 ?location .
    bd:serviceParam wikibase:cornerWest "Point(4.29 43.6)"^^geo:wktLiteral .
    bd:serviceParam wikibase:cornerEast "Point(5.31 44.3)"^^geo:wktLiteral .
  } # bbox for Avignon map
  ?build wdt:P31/wdt:P279* wd:Q839954 . # a building
  OPTIONAL { ?build wdt:P17 ?country. }
  OPTIONAL { ?build wdt:P131 ?place. }
  OPTIONAL { ?build wdt:P1435 ?herit. }
  OPTIONAL {
    ?wikipedia schema:about ?build .
    ?wikipedia schema:isPartOf <https://en.wikipedia.org/> .
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  #SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?build"):::projected v3("?country") v5("?herit") v2("?location"):::projected v4("?place") v6("?wikipedia"):::projected a1((" ")) c7([sPoint(5.31 44.3)^^<http://www.opengis.net/ont/geosparql#wktLiteral>"]):::literal c5([sPoint(4.29 43.6)^^<http://www.opengis.net/ont/geosparql#wktLiteral>"]):::literal c19(["en"]):::literal c10(["wd:Q839954"]):::iri c16([https://en.wikipedia.org/]):::iri c3(["bd:serviceParam"]):::iri subgraph s1["http://wikiba.se/ontology#box"] style s1 stroke-width:4px; v1 --"wdt:P625"--> v2 c3 --"wikibase:cornerWest"--> c5 c3 --"wikibase:cornerEast"--> c7 end v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c10 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P17".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P131".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P1435".-> v5 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v6 -."schema:about".-> v1 v6 --"schema:isPartOf"--> c16 end subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c3 --"wikibase:language"--> c19 end