Hi all,
I’m currently attempting to get a list of articles near a set of coordinates (e.g. inside a bounding box in a map).
Ultimately I’d like an API call that can answer the question “What are (e.g.) museums/landmarks in this bounding box?”.
I’ve thus far identified 2 ways to do it, but both techniques have their shortcomings.
Technique 1 – GET’ting the following URL:
returns a list of articles sorted as “top links”, but I’m not sure how I can limit the results to those of type “landmark”.
Technique 2 – Using SPARQL:
SELECT ?place ?placeLabel ?location
WHERE {
?link schema:isPartOf <https://en.wikipedia.org/>;
SERVICE wikibase:box {
?place wdt:P625 ?location.
bd:serviceParam wikibase:cornerSouthWest "Point(-99.19583534720724 31.360033395287584)"^^geo:wktLiteral.
bd:serviceParam wikibase:cornerNorthEast "Point(-98.68085116910731 32.05052263746356)"^^geo:wktLiteral.
}
?place wdt:P31 wd:Q33506.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
LIMIT 50
I can effectively filter by “museum”, but 1) the query is very slow to compute and 2) I’m not sure how I can sort by top links. A lot of the results I get are secondary (e.g. less popular museums).
Thank you!