Get the order of claims as on Wikidata page

Viewed 279

I request data about Wikidata entities (API action wbgetentities) and I need to have the same order of claims as on Wikidata page of an entity. I explored all the returned JSON but I did not find a property to sort them on. The order of claims keys is different even in raw API response (and it would be very inconvenient to rely on this order since I parse JSON into Python dictionary not having the concept of order for keys).

Does anybody have any suggestions?

1 Answers

Looking in the WikibaseRepo code the default order on a repo comes from the MediaWiki:Wikibase-SortedProperties of the repo.

So for wikidata.org that is https://www.wikidata.org/wiki/MediaWiki:Wikibase-SortedProperties

Client sites can be configured differently but currently this points to the same page.

There is currently no more structured way to access this data, other than just getting the wikitext.

Related