tetrak_authority.wikidata¶
A polite client for Wikidata’s SPARQL endpoints and its search API.
Wikidata asks three things of a bulk reader: identify yourself in the user agent, go one request at a time, and back off when told to. The client does all three and counts its requests, so a snapshot can say how many it made.
Two SPARQL endpoints are known. The Wikidata Query Service is live but times out on the queries that enumerate a subset by label language; the QLever mirror answers those in a second from a copy a little behind live. The snapshot records which one it used.
Module Attributes
|
The Wikidata Query Service, live, 60-second query limit. |
|
a copy a little behind live, no practical query limit. |
|
The Wikidata API, for |
|
take a URL and headers, return the body. |
Functions
|
The user agent Wikimedia's policy asks for: a name, a version, a contact. |
Classes
|
One bound value in a SPARQL result row. |
|
A rate-limited reader of one SPARQL endpoint and the Wikidata API. |
Exceptions
|
A request failed after the retries the client allows, or the endpoint rejected the query. |