586
edits
Line 1,551: | Line 1,551: | ||
#title:a map of BN items near a chosen starting point in England | #title:a map of BN items near a chosen starting point in England | ||
#defaultView:Map | |||
## create a thingy for the start point | ## create a thingy for the start point change the Qxxx ID in the following PREFIX var_start line to chosen location. | ||
## **MUST** a) be in England and b) have a wikidata item that has coordinate location! | ## **MUST** a) be in England and b) have a wikidata item that has coordinate location! | ||
Line 1,568: | Line 1,569: | ||
## TODO is there a way to get the location itemLabel and use it in the map title... | ## TODO is there a way to get the location itemLabel and use it in the map title... | ||
SELECT distinct ?item ?itemLabel ?locationLabel ?location ?wikidata ?wd_geo ?distance #?wd_long ?wd_lat | SELECT distinct ?item ?itemLabel ?locationLabel ?location ?wikidata ?wd_geo ?distance #?wd_long ?wd_lat | ||
Line 1,577: | Line 1,576: | ||
{?item bnwdt:P29 ?location . } # resided at location | {?item bnwdt:P29 ?location . } # resided at location | ||
union | union | ||
{?item bnwdt:P2 ?location . } # item has property P2 location | {?item bnwdt:P2 ?location . } # item has property P2 location | ||
# | # other possibles ? | ||
## limit to places in admin territory p33 england q617. (keep numbers down to avoid wikidata timing out) | ## limit to places in admin territory p33 england q617. (keep numbers down to avoid wikidata timing out) | ||
Line 1,596: | Line 1,593: | ||
#BIND(geof:latitude(?wd_geo) AS ?wd_lat) . | #BIND(geof:latitude(?wd_geo) AS ?wd_lat) . | ||
bind(geof:distance(?wd_geo, ?start) as ?distance). | bind(geof:distance(?wd_geo, ?start) as ?distance). | ||
FILTER(?distance < | |||
FILTER(?distance < 40). # < xx km from start_wd | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } |
edits