6

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?

Midhuna
  • 4,523
  • 4
  • 21
  • 22
  • is this Linq-to-wikipedia (https://linqtowikipedia.codeplex.com/) or LinqtoWiki (https://www.nuget.org/packages/LinqToWiki)? – Marco Sep 25 '14 at 11:11
  • It is LinqtoWiki(nuget.org/packages/LinqToWiki). – Midhuna Sep 25 '14 at 11:15
  • Wikipedia is an encyclopedy, not a database. Please consider using Wikidata instead, that'll provide you Wikipedia sitelinks that you can filter. See https://stackoverflow.com/questions/18394863/how-do-you-filter-wikivoyage-api-results-by-city too. – framawiki Nov 28 '17 at 18:24

1 Answers1

1

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.

Community
  • 1
  • 1
Keith
  • 100
  • 1