Packs¶
Analects ships three packs, in src/analects/packs/builtin/:
| Pack | Types |
|---|---|
_shared@0.1 |
organisation, person_base, and the source types every pack uses |
datacenter@0.1 |
data_center, permit, interconnection_request, power_supply, utility, financing: sites, their applications and appeals, grid connections and the money behind them |
politician-uk@0.1 |
person, position, vote, statement, interest: members of Westminster, Holyrood and councils, their offices, votes, words and interests |
analects schema show [<type>] prints what a pack declares, and analects schema test checks
every pack and its fixtures.
The format¶
Every key is documented at the top of
_shared@0.1/pack.yaml. In short:
- properties —
type(string, number, integer, date, enum, money, entity_ref),value_shape(point, range, point_with_range),temporal(static, valid_range, period, event),unit,max_age,multi,required; - edges —
to,evidence_policy,temporal,inverse_of,attributes; - identity —
external_ids,name_fields,blocking,discriminators,create_requires,normalisation; - expectations — rules for
analects gaps:required_when,requires_edge, ranges, freshness by status; - discovery — channel templates with
how,cadence_days,playbook,traps,evidenceandapplies_when; - queries — named SQL questions (
analects query run <name>); - places and postcodes — which nation a council or a postcode is in;
- site — how a published site speaks of each place's government (
places:appeals,direction,appeal,recovered_appeal,call_in,recalled,records), and, withsection_byandsection_label, how a scope over several of them is split into sections, in that order (D66f); - fixtures — resolver cases that must hold.
The engine enforces six hard rules and nothing else; everything a pack declares is a hint that improves results without blocking a write. See write a pack, and the design's packs section.