Name the near miss by the row whose cell spells it, retire the rules the key-only selector makes false, and ask which key each table keeps

This commit is contained in:
2026-09-27 16:59:37 +02:00
committed by Lillem4n
parent e435f81296
commit 8c4ee8362e
2 changed files with 28 additions and 22 deletions
+10 -11
View File
@@ -342,10 +342,7 @@ a load error rather than a file silently ignored.
`municipality[0180]` reads as selection to anyone who has indexed an array, and `[St. `municipality[0180]` reads as selection to anyone who has indexed an array, and `[St.
Louis]` keeps a name whole where a colon or a dot-separated spelling could not; zsh Louis]` keeps a name whole where a colon or a dot-separated spelling could not; zsh
needs the brackets quoted, which the README's examples show. A name that spells another needs the brackets quoted, which the README's examples show.
row's key is refused at load rather than shadowed: a key names one row by contract, so
the name could never select its own, and the check is one lookup per row against the key
index that already exists.
## `parent` names the link column and the table alike ## `parent` names the link column and the table alike
@@ -397,7 +394,9 @@ parent. A row is selected or drawn alike.
out, and a record's link column still holds the key, since it is a column, not a path. out, and a record's link column still holds the key, since it is a column, not a path.
- A path may not step back down into a child table after a step up: - A path may not step back down into a child table after a step up:
`city[Oslo].country.city.name` could be Oslo or a city of Norway drawn afresh, so it is `city[Oslo].country.city.name` could be Oslo or a city of Norway drawn afresh, so it is
refused, naming `city[Oslo].name` and `country[NO].city.name`. refused, naming the path to the row it stepped up from, `city[Oslo].name`, and the path
down from the parent, `country[NO].city.name`; after a drawn row, `city.country.city.name`
names `city.name` and `country.city.name`.
- A route through another row is another path to the same data, not a second spelling: - A route through another row is another path to the same data, not a second spelling:
`city[Oslo].country.name` and `country[NO].name` both load. `city[Oslo].country.name` and `country[NO].name` both load.
@@ -407,10 +406,11 @@ the path ended.
## A selector names a row by its key alone ## A selector names a row by its key alone
Decided 2026-09-27 by the maintainer, for goal 4's one spelling per result. A table with Decided 2026-09-27 by the maintainer, for goal 4's one spelling per result; valid while
a `key` selects by it alone: `country[NO]` loads, and `country[Norway]` is refused every table either has a `key` or names its rows inside a parent. A table with a `key`
naming `[NO]`, since a name could spell another row's key. A table with no `key` selects by it alone: `country[NO]` loads, and `country[Norway]` is refused naming
selects by its `name` inside its parent, which is the key it has. `[NO]`, found by the row whose cell spells the selector. A table with no `key` selects by
its `name` inside its parent, which is the key it has.
## A parent row with no child row is a load error ## A parent row with no child row is a load error
@@ -632,8 +632,7 @@ claim fejkdata has no business making.
A flat list of names carries neither the code a PRI encodes nor a selector reaching it, A flat list of names carries neither the code a PRI encodes nor a selector reaching it,
and goal 3 draws the two as one fact. The canonical spelling losing to the one its and goal 3 draws the two as one fact. The canonical spelling losing to the one its
domain writes, above, settles the rest: a configuration writes `info`, so RFC 5424's domain writes, above, settles the rest: a configuration writes `info`, so RFC 5424's
`Informational` stays the `severity` column, and the code and the keyword hold the two `Informational` stays the `severity` column.
selector slots.
## `misc.tld` keys carry the leading dot, where other tables key on a bare code ## `misc.tld` keys carry the leading dot, where other tables key on a bare code
+18 -11
View File
@@ -179,10 +179,16 @@ by a `data-import/` script, as README goal 12 asks.
README's `city[Oslo].country` example with README's `city[Oslo].country` example with
`fejkdata -d ./mydata 'city[Oslo].country.name'`, rendering `Norway`. `fejkdata -d ./mydata 'city[Oslo].country.name'`, rendering `Norway`.
- Select a row by its key alone, as the decision "A selector names a row by its key - Select a row by its key alone, as the decision "A selector names a row by its key
alone" states: `geo.SE.municipality[Lund]` and `misc.territory[Sweden]` select a row alone" states, once the open question on each table's key is settled:
today, where the error should name `[1281]` and `[SE]`. Refuse a `name` option beside `geo.SE.municipality[Lund]` and `misc.territory[Sweden]` select a row today.
`key`, which then selects nothing, drop it from the shipped tables, and state the - Have a selector that misses name the key of the row whose cell spells it, matched
README's selectors and `CHANGELOG.md`'s "a path selects a row by key or name" to match. without case, else say the table selects by its key: `misc.territory[Sweden]` and
`misc.territory[se]` name `[SE]`, `misc.protocol[tcp]` its key, `misc.tld[se]`
`[.se]`, and `misc.loglevel[Error]` the row a column spells `Error` in.
- Refuse a `name` option beside `key`, which then selects nothing, and drop it from
the shipped tables.
- Rewrite what selects by name: README.md lines 20, 174, 183, 193, 198, 255, 257,
260, 473-491 and 499-504, and CHANGELOG.md lines 13-17 and 56.
- Render selected rows as the decision "A selected row is fixed, not drawn, and an - Render selected rows as the decision "A selected row is fixed, not drawn, and an
unnamed read beside it is refused" states: `New` refuses unnamed read beside it is refused" states: `New` refuses
`{/misc.territory[SE].capital} / {/misc.territory[FI].capital}` today, and a choice `{/misc.territory[SE].capital} / {/misc.territory[FI].capital}` today, and a choice
@@ -217,13 +223,6 @@ by a `data-import/` script, as README goal 12 asks.
`drawn.category`, `pinRow` names `t.path` and `mustRow` panics with `t.category`, so one `drawn.category`, `pinRow` names `t.path` and `mustRow` panics with `t.category`, so one
table is `territory` and `misc.territory`, and the short spelling names no file where two table is `territory` and `misc.territory`, and the short spelling names no file where two
folders hold that name. folders hold that name.
- Name a spelling that works when a row selector misses: `misc.protocol[tcp]`,
`misc.httpmethod[get]` and `misc.territory[se]` all answer "no row … has key or name"
and stop there, where a case-insensitive match could name the row that exists, and a
table with no `name` column could say it selects by key alone. `misc.tld[se]` misses
on the leading dot its keys carry rather than on case, and `misc.loglevel[Error]`
misses although a column carries `Error`, so the near miss is worth naming whatever
shape it takes.
- Let a table column carry a `datatype`, so `--format json` writes - Let a table column carry a `datatype`, so `--format json` writes
`"safe": true` and `--format sql` a boolean rather than the text `'true'`. Today only `"safe": true` and `--format sql` a boolean rather than the text `'true'`. Today only
a JSON field takes one, so `misc.httpmethod`'s booleans are typed in Go and text a JSON field takes one, so `misc.httpmethod`'s booleans are typed in Go and text
@@ -232,6 +231,14 @@ by a `data-import/` script, as README goal 12 asks.
### Open questions to settle ### Open questions to settle
- Decide which spelling each shipped table selects by, now a selector names its key
alone. Keeping today's key loses `geo.US.region[IL].locality[Springfield]` to a
numeric GEOID, `misc.loglevel[err]` to `[3]`, `misc.tld[.рф]` to `[.xn--p1ai]`,
`misc.currency[Euro]`, `misc.protocol`'s second spelling and
`geo.SE.region[Skåne län]`. The tables carrying both today: `geo.SE` and `geo.US`
region, municipality and US locality, `misc` currency, httpstatus, language,
loglevel, mimetype, protocol, territory and tld, and both locales' `sex`. Decide too
whether the `name` option, left meaning "the key inside a parent", keeps its name.
- Decide whether a goal 5 violation joins the comprehension gate's exception list: the - Decide whether a goal 5 violation joins the comprehension gate's exception list: the
`{/sel}|{/sel}` panic waits behind the whole round at 5.9, and `{/sel}|{/sel}` panic waits behind the whole round at 5.9, and
`{/geo.SE.locality}|{/geo.SE.municipality}` mispairs the shipped data meanwhile, though a `{/geo.SE.locality}|{/geo.SE.municipality}` mispairs the shipped data meanwhile, though a