query-afa27730f83c4753ba944579fbd8f942

rq turtle/ttl

Somewhat:15:19, 24 July 2019 (UTC)) talk (Bouzinac ;) (Q19907)Death Star , very much looking [3]Just have a look on the map of this query 11:35, 24 July 2019 (UTC)) talk (Bouzinac (Q1223)Washington Do you perhaps know how to calculate the max E, max W, max S, max N of a "country" ? I'm surprised to see that it happens often to be a lack of data, eg . This query is in error, why ? (Q1558)Kansas Hello, there is a maxE, maxW, maxS, maxN value for

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?item ?country ?coord {
  VALUES ?country { wd:Q1558 } .
  ?country p:P1332 [ ps:P1332 ?north; psv:P1332 ?nValue ];
           p:P1333 [ ps:P1333 ?south; psv:P1333 ?sValue ];
           p:P1334 [ ps:P1334 ?east;  psv:P1334 ?eValue ];
           p:P1335 [ ps:P1335 ?west;  psv:P1335 ?wValue ].
  ?nValue wikibase:geoLatitude  ?nLat . 
  ?sValue wikibase:geoLatitude  ?sLat . 
  ?eValue wikibase:geoLongitude ?eLon . 
  ?wValue wikibase:geoLongitude ?wLon . 
  ?item p:P625 [ a wikibase:BestRank; ps:P625 ?coord; psv:P625 ?cValue ] .
  ?cValue wikibase:geoLatitude  ?lat  . 
  ?cValue wikibase:geoLongitude ?lon  . 
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q4830453. }              # exclude ENTREPRISES
  MINUS { ?item wdt:P131 [] } .  
  FILTER( ?sLat < ?lat && ?lat < ?nLat ) .
  FILTER( ?wLon < ?lon && ?lon < ?eLon ) .
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v17("?cValue") v16("?coord"):::projected v7("?country"):::projected v3("?eLon") v13("?eValue") v12("?east") v18("?item"):::projected v5("?lat") v2("?lon") v6("?nLat") v9("?nValue") v8("?north") v4("?sLat") v11("?sValue") v10("?south") v1("?wLon") v15("?wValue") v14("?west") a7((" ")) a1((" ")) a2((" ")) a3((" ")) a4((" ")) a5((" ")) a6((" ")) c22(["wd:Q4830453"]):::iri c16(["wikibase:BestRank"]):::iri f0[["?wLon < ?lon?lon < ?eLon"]] f0 --> v1 f0 --> v2 f0 --> v3 f1[["?sLat < ?lat?lat < ?nLat"]] f1 --> v4 f1 --> v5 f1 --> v6 bind2[/VALUES ?country/] bind2-->v7 bind20(["wd:Q1558"]) bind20 --> bind2 a1 --"p:statement/P1332"--> v8 a1 --"p:statement/value/P1332"--> v9 v7 --"p:P1332"--> a1 a2 --"p:statement/P1333"--> v10 a2 --"p:statement/value/P1333"--> v11 v7 --"p:P1333"--> a2 a3 --"p:statement/P1334"--> v12 a3 --"p:statement/value/P1334"--> v13 v7 --"p:P1334"--> a3 a4 --"p:statement/P1335"--> v14 a4 --"p:statement/value/P1335"--> v15 v7 --"p:P1335"--> a4 v9 --"wikibase:geoLatitude"--> v6 v11 --"wikibase:geoLatitude"--> v4 v13 --"wikibase:geoLongitude"--> v3 v15 --"wikibase:geoLongitude"--> v1 a5 --"a"--> c16 a5 --"p:statement/P625"--> v16 a5 --"p:statement/value/P625"--> v17 v18 --"p:P625"--> a5 v17 --"wikibase:geoLatitude"--> v5 v17 --"wikibase:geoLongitude"--> v2 subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v18 --"p:direct/P31"--> a6 a6 --"p:direct/P279"--> c22 end subgraph minus4["MINUS"] style minus4 stroke-width:6px,fill:pink,stroke:red; v18 --"p:direct/P131"--> a7 end