richardlehane / siegfried

signature-based file format identification
http://www.itforarchivists.com/siegfried
Apache License 2.0
217 stars 30 forks source link

Enable return of revision history via Wikibase #166

Closed ross-spencer closed 3 years ago

ross-spencer commented 3 years ago

Cherry-picked version of 6cd46fe, 5c1c82f, with conflicts resolved.


This commit introduces a new version of Spargo called Wikiprov which is focused on returning revision history from Wikidata via the Wikidata API.

We also return a permalink for a Wikidata record which represents the status of the data at the time the signature was downloaded from the server.

The permalink for a record is returned with identification results. Inspect will return the history of a Wikidata/Wikibase record.

Wikibase instances should continue to be configurable though callers will need to specify a Wikidata query service endpoint as well as a URL for Wibibase permalinks to resolve to.

Testing has been increased to provide integration testing around this work making sure that compatible signature files are parsed correctly and return the correct identifications plus revision history and permalink.

Testing has also been increased to inspect JSON output from the identifier.