tetrak_authority.snapshot¶
Build a dated snapshot: the subset, the fetch, the files.
A snapshot is a directory holding snapshot.json, the manifest (when
it was made, from which endpoint, with which queries, how many of each
kind, how many requests), and entities.jsonl, one Entity
per line. The manifest is what a measurement cites, beside the library
version: the same queries on another day give another snapshot.
The subset is a Scope:
People: items that are human (P31 Q5) with a label or alias in the scope’s languages, or with one of the scope’s ethnicities (P172) or citizenships (P27), so that royalty and saints with a label but no modern tag come in through the label and a diaspora figure with no Armenian label comes in through the tag.
Organisations: items of the scope’s organisation classes with a label in the languages.
Places: items with coordinates (P625) inside the scope’s box and a label or alias in the languages. The default box is an approximation of historic Armenia and the lands around it, where a place is likeliest to carry names in several languages: the far west of Turkey to Tehran, Jerusalem to the northern edge of Georgia.
Enumeration needs an endpoint that can filter by label language over the whole of Wikidata, which the Query Service cannot within its limit and the QLever mirror can; the fetch of names and facts, in batches of item ids, works on either.
Module Attributes
|
organisation and the kinds a catalogue meets as a creator or a subject. |
|
2 stores each name's fold key beside it. |
|
property → the name it is kept under. |
|
the far west of modern Turkey to Tehran, Jerusalem to the northern edge of Georgia. |
|
Armenian and Western Armenian labels, Armenians, Armenia, and the historic region. |
Functions
|
One record from a batch's rows. |
|
Consecutive slices of items, each at most size long. |
|
Enumerate, fetch and write a snapshot; return its manifest. |
|
How many items each kind of the scope holds, one query per kind. |
|
The item ids of one kind, in a stable order. |
|
The facts in |
|
Fetch names and facts for one batch of ids and assemble their records. |
|
Fetch a batch, halving it when the endpoint refuses it, and skipping an item it will not answer. |
|
Every label and alias, in every language, of the given items. |
|
|
|
Recompute every key in a snapshot with the installed tetrak-translit, in place. |
|
The scope as the manifest records it. |
|
The year of a Wikidata time value ( |
Classes
|
A bounding box in degrees: west and east longitudes, south and north latitudes. |
|
What a snapshot covers. |