与this page等效的维基数据API是什么,它列出了所有已知的维基数据属性?我想搜索一个属性,例如'博士生导师',并回到P184。
items存在类似的功能,但我似乎无法找到属性的等价物。
答案 0 :(得分:6)
Using action=wbsearchentities
with type=property
应该这样做。维基数据API文档为here,搜索" = wb"获取特定于维基数据的功能。
答案 1 :(得分:4)
我用wikidata API的 action = wbgetentities 写了small script to query all properties。它使用
生成一个json文件键:值
正在
属性Pid:请求语言中的属性标签
我发布了outputs for a few languages,可以根据要求提供其他语言,直到有针对此需求的官方(和更清洁)答案
更新:感谢@nerab's answer,我更新了wikidata-properties-dumper以使用Quarry SQL结果:这是非常清晰的:)
更新2 :Quarry不灵活,我开始使用SPARQL query并将其包裹在Wikidata CLI命令中:wd props
答案 2 :(得分:3)
感谢@ maxlath&#39的项目中的评论,我发现了Quarry。
可以从
获取所有维基数据属性的列表http://quarry.wmflabs.org/run/45013/output/1/json
此特定列表是英文的,但query也可以修改为其他语言。
答案 3 :(得分:2)
您可以使用此SPARQL查询: 它返回属性名称,描述和逗号分隔,也称为英语标签:
SELECT ?property ?propertyLabel ?propertyDescription (GROUP_CONCAT(DISTINCT(?altLabel); separator = ", ") AS ?altLabel_list) WHERE {
?property a wikibase:Property .
OPTIONAL { ?property skos:altLabel ?altLabel . FILTER (lang(?altLabel) = "en") }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" .}
}
GROUP BY ?property ?propertyLabel ?propertyDescription
LIMIT 5000