维基百科的API - 有一个一般的“音乐”类别? [英] Wikipedia API - is there a general 'music' category?

查看:149
本文介绍了维基百科的API - 有一个一般的“音乐”类别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有维基百科的API的一个问题。我使用的OpenSearch获得链接到维基百科的页面结果。但是打开搜索似乎不支持+ incategory。更重要的是,我想搜索音乐歌手(乐队,独唱歌手和所有其他类型的音乐家)。不过,我无法找到名为音乐任何类别。类别太具体(即20世纪80年代的音乐团体,独唱等)。然而,当你看看维基百科的消歧义页例如,对于后代可以看到这个'音乐':

I have a problem with Wikipedia API. I am using openSearch to get results with links to wikipedia pages. However open search doesn't seem to support +incategory. What is more, I would like to search for music artist (bands, solo singer and all other type of musicians). However I can't find any category named 'music'. The categories are too specific (i.e. 1980s music groups, solo singers etc.). However when you look at disambiguation page of wikipedia for example for offspring you can see this 'in music':

http://en.wikipedia.org/wiki/Offspring_%28disambiguation%29

所以,总结一下:

A)我如何使用与操作= OpenSearch的类别?我需要这个动作,因为我需要维基百科网址,我不知道如何以另一种方式检索此。

A) how can I use categories with action=opensearch? I need this action because I need the wikipedia url and I don't know how to retrieve this in another way.

B)如何设置像音乐?

B) how to set up a general category like 'music'?

推荐答案

A)看来,维基百科的OpenSearch的实施确实只页面标题一个preFIX搜索。有没有办法来指定类别看,你应该看看 =行动查询和放大器;列表=搜索 代替。请注意,您可以轻松地百分号编码它只是创建页面标题维基百科网址并将其附加到 http://en.wikipedia.org/wiki/

A) It appears that Wikipedia's OpenSearch implementation does a prefix search on page titles only. There is no way to specify categories to look in. You should look into action=query&list=search instead. Note that you can easily create a Wikipedia url from the page title by simply percent-encoding it and appending it to http://en.wikipedia.org/wiki/.

B)正如您所指出的,维基百科的分类系统一般避开大类,如赞成更具体的层次乐。在这个时候,也没有办法在一个类别的子类别进行搜索。你可以建立这样一个类别说服维基百科社区改变他们的方式做事情(去这里),但你不可能满足任何成功。

B) As you've noted, Wikipedia's categorization system generally eschews broad categories such as "Music" in favor of more specific hierarchies. At this time, there is no way to search in subcategories of a category. You could "set up" such a category by convincing the Wikipedia community to change the way they do things (go here), but you're unlikely to meet with any success.

的音乐,你可能会消除歧义页面上看到有无关,与你也许可以查询或搜索的类别,它只是一个以用于组织列表中没有从节头不同的页面节姊妹网站,在 Wikipedia上关于堆栈溢出文章。

The "In music" you might see on a disambiguation page has nothing to do with categories you might be able to query or search on, it's just a section in the page used to organize the list no different from the section header "Sister sites" in Wikipedia's article about Stack Overflow.

这篇关于维基百科的API - 有一个一般的“音乐”类别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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