3

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?

greatvovan
  • 2,439
  • 23
  • 43
  • 1
    Perhaps subtasks have more info: https://phabricator.wikimedia.org/T125493 – Stanislav Kralin Nov 30 '17 at 04:32
  • This is listed as a wikibase client setting but it could be useful. propertyOrderUrl, which points to https://www.wikidata.org/w/index.php?title=MediaWiki:Wikibase-SortedProperties This list is only used by the Scribunto data access on Wikidata clients. – Addshore Nov 13 '18 at 15:59

1 Answers1

0

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.

Addshore
  • 568
  • 3
  • 16