I am searching wikipedia using the Wikipedia API for all articles that contain the Template:Death date and age template. This can be done with the following request

http://en.wikipedia.org//w/api.php?action=query&list=embeddedin&format=xml&eititle=Template%3ADeath%20date%20and%20age&eilimit=10

I would like to modify my query in order to search using two or more templates. For example I would like to retrieve articles that have BOTH "Template:Death date and age" and "Template:Birth date". How can I do this?

有帮助吗?

解决方案

The eititle parameter accepts only single value, and AFAIK there is no other way to do this. This means that you'll have to make one request per template and then merge them in your code.

Another option would be to get access to the templatelinks table. You can get that either by downloading the templatelinks.sql dump or by getting access to Tool Labs, from which you can access the database directly.

其他提示

It would be better to use DBpedia for queries like this, since the api doesn't really support the kind of query you're doing.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top