【发布时间】:2020-11-16 19:00:08
【问题描述】:
我有这个 Wikidata 查询,它返回所有足球场的名称、坐标、俱乐部标签和类似的东西。但我不知道如何获得体育场所在的国家和城市名称(也可能是城市的坐标)。
这是我的查询:
SELECT ?club ?clubLabel ?venue ?venueLabel ?coordinates
WHERE
{
?club wdt:P31 wd:Q476028 .
?club wdt:P115 ?venue .
?venue wdt:P625 ?coordinates .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
2020 年 11 月 19 日编辑:
我需要城市的时区,所以我在查看文档后尝试了这个查询,但它没有返回值。只需像“wd:Q6723”这样的链接:
SELECT DISTINCT ?timezone ?club ?locationLabel ?countryLabel ?clubLabel ?venue ?venueLabel ?coordinates
WHERE
{
?venue (wdt:P421|wd:Q12143) ?timezone .
?club wdt:P31 wd:Q476028 .
?club wdt:P115 ?venue .
?venue wdt:P625 ?coordinates .
OPTIONAL {?club wdt:P159|(wdt:P115/(wdt:P131|wdt:P276)) ?location .
OPTIONAL { ?location wdt:P17 ?country . }
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
} limit 500
【问题讨论】:
-
作为对未来的提示,Wikidata 有一个专门用于查询的优秀帮助台:wikidata.org/wiki/Wikidata:Request_a_query 我强烈推荐它。