Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get all city pages from Wikipedia by using LINQ-to-Wiki?

I have used LINQ-to-Wiki to get pages from Wikipedia to my ASP.NET MVC webapplication.I have used the below query to get Pages having title like "India".

var wikipedia = new Wiki("Example");
var data = wikipedia.Query.allpages()
        .Where(i => i.prefix == "India")
        .ToList();

But it gives all pages related to "India" not only Places/Cities.How to get only Places/Cities from this query?Or how to search a place by 'categorymembers' property.Can anyone please help?

like image 635
Midhuna Avatar asked Sep 25 '14 10:09

Midhuna


1 Answers

Check out this other SO answer: Wikipedia API - is there a general 'music' category?.

Wikipedia's OpenSearch implementation does not support categories in the search text.

like image 66
Keith Avatar answered Nov 05 '22 19:11

Keith