Module places

Source
Expand description

Where the artists on the shelf are from.

§Why this is not a field of the catalog

There is no widely used tag for an artist’s country. RELEASECOUNTRY exists, but it answers a different question — the country a release came out in — and answers this one wrongly: an American pressing of a French band is not an American band. So the fact comes from MusicBrainz, which means it lives in the attributed layer and not in the graph.

That makes this the first thing in the program a listing can be filtered by that the catalog does not know. The consequence is worth stating plainly rather than discovering: a library that has never run aede fetch has no countries at all, and every command here says so instead of answering with an empty table that looks like a library of stateless musicians.

§The vocabulary is read from the data

No table of countries is written down here. What aede countries lists is what MusicBrainz actually said about these artists, the way Catalog::roles_in_use reads the roles from the credits rather than from a fixed list. A country nobody on the shelf is from is not a country this program has an opinion about.

The price of that, stated rather than discovered: MusicBrainz answers the most specific area it holds for an artist, which is usually a country and is sometimes a county or a city. A reader’s shelf produced a row for County Antrim. These are the places the source named, and the listing says so; the ISO code is the only thing in the table that an authority assigned, which is why it has a column to itself.

§Short forms, and where they are allowed to come from

Nobody wants to type “United Kingdom”. The temptation is a table of synonyms — UK, GB, Great Britain, Royaume-Uni — and it is a slope with no bottom: whose vernacular, in which language, and who maintains it. So a country is resolved in four steps, and each one is derived from the source or from the name itself, never from a list this program invented:

  1. the name, exactly: united kingdom;
  2. the ISO code the source states: gb, fr, us;
  3. the initials of a multi-word name: uk, nz — computed from the name, so no country needs to be known about in advance, and offered only where they name one place on this shelf — see keep_usable_initials;
  4. any substring of the name: kingdom, united, which may reach several and says so.

USA and Royaume-Uni are therefore refused, and that is the intended answer rather than a gap: neither is the source’s name nor its code, and this program speaks English throughout. The error names aede countries, which lists every form that works — because what a screen displays must be what the parser accepts.

An unmatched value is an error naming the listing — the same contract --genre, --label and --role already have.

Structs§

Place
One country, and who on the shelf is from it.

Functions§

asked_about
How many artists on the shelf have been asked about at all.
countries
Every country the layer knows about, most artists first.
country_of
The country an artist is from, as the layer holds it.
find
Every country a typed value reaches, and how it reached them.
without_code
How many of these places carry no ISO code.