CXuesong / WikiClientLibrary

/*🌻*/ Wiki Client Library is an asynchronous MediaWiki API client library targeting modern .NET platforms
https://github.com/CXuesong/WikiClientLibrary/wiki
Apache License 2.0
80 stars 16 forks source link

Enity SiteLink URL is always null #76

Open FaFre opened 3 years ago

FaFre commented 3 years ago

For some reason the URL for SIteLink's is always null.

var entity = new Entity(_wikiDataSite, "Q1022");
                await entity.RefreshAsync(
                    EntityQueryOptions.FetchAllProperties
                );

image

I also tried around with EntityQueryOptions e.g. setting only FetchSiteLinkURL and so on, but I couldn't get it working. Is this a library Problem, or has it something to do with the Wiki-Site I'm querying? (Wikidata)

CXuesong commented 3 years ago

That's interesting since there is unit test covering this part https://github.com/CXuesong/WikiClientLibrary/blob/19a365830ffe1859218aad7640161a0f0d4efc9d/UnitTestProject1/Tests/WikibaseTests.cs#L149-L154

Can you perhaps check the actual response from MW? E.g.

https://www.wikidata.org/wiki/Special:ApiSandbox#action=wbgetentities&format=json&ids=Q1234&props=sitelinks