Page MenuHomePhabricator

[feature request] allow selection by SE and NW corners on Wikidata Query Service wikibase:box
Closed, DuplicatePublic

Description

Per https://www.mediawiki.org/wiki/Wikidata_query_service/User_Manual#Search_within_box currently only the following are supported:

wikibase:cornerSouthWest The south-west corner of the box.
wikibase:cornerNorthEast The north-east corner of the box.

This feature request suggests to add the following:

wikibase:cornerSouthEast The south-east corner of the box.
wikibase:cornerNorthWest The north-west corner of the box.

Sample query, based on the current sample, should give comparable results:

#Schools between Winters and Ashrama (same as San Jose, CA and Sacramento, CA)
#defaultView:Map
SELECT * WHERE
{

wd:Q986857 wdt:P625 ?SJloc .
wd:Q2396418 wdt:P625 ?SCloc .
SERVICE wikibase:box {
    ?place wdt:P625 ?location .
    bd:serviceParam wikibase:cornerNorthWest ?SJloc .
    bd:serviceParam wikibase:cornerSouthEast ?SCloc .
  }
?place wdt:P31/wdt:P279* wd:Q3914 .

}

Link: https://query.wikidata.org/#%23%20Schools%20between%20Winters%20and%20Ashrama%20%28same%20as%20San%20Jose%2C%20CA%20and%20Sacramento%2C%20CA%29%0A%23defaultView%3AMap%0ASELECT%20%2a%20WHERE%20%7B%0A%20%20wd%3AQ986857%20wdt%3AP625%20%3FSJloc%20.%0A%20%20wd%3AQ2396418%20wdt%3AP625%20%3FSCloc%20.%0A%20%20SERVICE%20wikibase%3Abox%20%7B%0A%20%20%20%20%20%20%3Fplace%20wdt%3AP625%20%3Flocation%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3AcornerNorthWest%20%3FSJloc%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3AcornerSouthEast%20%3FSCloc%20.%0A%20%20%20%20%7D%0A%20%20%3Fplace%20wdt%3AP31%2Fwdt%3AP279%2a%20wd%3AQ3914%20.%0A%7D

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald Transcript