DotNetWikiBot Framework Documentation
For pages that have associated items on this function returns XElement object with all information provided by Wikidata. If page is not associated with a Wikidata item null is returned.

Namespace: DotNetWikiBot
Assembly: DotNetWikiBot (in DotNetWikiBot.dll) Version:


public XElement GetWikidataItem()

Return Value

Type: XElement
Returns XElement object or null.


 Copy imageCopy
Page p = new Page(enWikipedia, "Douglas Adams");
XElement wikidataItem = p.GetWikidataItem();
string description = (from desc in wikidataItem.Descendants("description")
                      where desc.Attribute("language").Value == "en"
                      select desc.Attribute("value").Value).FirstOrDefault();

See Also