来自名称的Wikidata实体值 [英] Wikidata entity value from name

查看:122
本文介绍了来自名称的Wikidata实体值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,如果我想获取Google的页面数据,是否可以根据实体名称获取Wikidata页面信息. 我认为必须使用带有相应实体值的实体"来完成,但是我不确定是否有任何简单的方法来确定实体值.

Is there a way to get Wikidata page information based on the name of the entity for example if I wanted to get page data for Google. I think it has to be done using "entity" with the corresponding entity value however I am not sure of there is any easy way to determine the entity value.

推荐答案

如果要使用API​​进行此操作,则应首先使用

If you want to do this using the API, you would first use wbsearchentities to find out which entity do you want. For example:

https://www.wikidata. org/w/api.php?action = wbsearchentities& search = Google& language = zh-CN

问题在于存在多个称为"Google"的实体:公司(Google Inc.),搜索引擎(Google Web Search),动词(to google)甚至是Wikipedia歧义消除页面.

The problem with this is that there are multiple entities called "Google": the company (Google Inc.), the search engine (Google Web Search), the verb (to google) and even a Wikipedia disambiguation page.

在确定要访问哪个实体后,请使用 实际获取您想要的信息:

After you somehow decide which entity to access, use wbgetentities to actually get the information you want:

https://www.wikidata. org/w/api.php?action = wbgetentities& ids = Q95& languages = zh-CN

或者,如果您不能决定使用哪个实体,则可以同时获取所有实体的信息:

Or, if you can't decide which entity to use, you could get information for all of them at the same time:

>://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q95|Q9366|Q961680|Q1156923&languages=zh-CN

这篇关于来自名称的Wikidata实体值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆