使用Wikimedia API获取位置 [英] Get location with Wikimedia API
问题描述
如何使用Mediawiki API从城市/国家/地区获取Wikipedia文章的位置?假设我要确定圣家堂大教堂位于哪个国家/地区?我应该使用什么财产?
How to get location of the Wikipedia article with Mediawiki API in terms of city/country? Let's say I want to determine what country, what city the Sagrada Familia cathedral is located in? What property should I use?
推荐答案
尝试以下查询:
我不确定是否可以使用Wikipedia API获取城市名称,但是有一些方法可以将坐标转换为城市名称,请参见: a Wikidata上的SPARQL查询. (该查询是此答案中的副本,其半径和坐标已更改.)
I'm not sure if we can get the city name using Wikipedia API, but there are some ways to convert a coordinate to a city name, see: Given the lat/long coordinates, how can we find out the city/country? or use a SPARQL query on wikidata. (the query is a copy of the one in this answer, with radius and coordinates changed.)
这篇关于使用Wikimedia API获取位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!