MeridianMERIDIAN

Boolean Terms (True/False, Yes/No)

representation.boolean.terms

Boolean value represented as a full word or phrase: true/false, yes/no, on/off, enabled/disabled, active/inactive. Any casing (TRUE, True, true). Transforms to DuckDB BOOLEAN type.

Worked samples

DuckDB 1.5.5 · finetype 0.6.64

ValueAs BOOLEAN
truetrue
falsefalse
yestrue
nofalse
ontrue
offfalse
Truetrue
Falsefalse

Background

Origin

FineType defines Boolean Terms itself, as a boolean value written as a full word: true/false, yes/no, on/off, enabled/disabled or active/inactive, in any casing.[1] The Boolean data type is named after George Boole, who first defined an algebraic system of logic in the mid-19th century.[2]

The core schema in YAML 1.2.2 resolves only true, True, TRUE, false, False and FALSE to the boolean tag.[3] The SQL:1999 standard introduced a BOOLEAN data type as an optional feature (T031).[2]

Use

RFC 8259, the JSON standard, says the literal names false, null and true must be lowercase.[4] XML Schema 1.1 gives boolean a lexical space of four literals: true, false, 1 and 0.[5] The Frictionless Table Schema casts strings in a boolean field using trueValues and falseValues, which default to true, True, TRUE and 1, and false, False, FALSE and 0.[6] PostgreSQL's boolean input accepts true, yes, on and 1 for the true state, and false, no, off and 0 for the false state.[7] PostgreSQL's boolean input ignores leading or trailing whitespace, and case does not matter.[7]

The StrictYAML documentation, in a page titled The Norway Problem, shows PyYAML loading an unquoted NO in a list of country codes as the boolean False.[8] The StrictYAML documentation gives quoting the value, as 'NO', as the quick fix.[8] When a yes/no column sits next to country codes, language codes or initials, check that a short code has not been turned into a boolean somewhere upstream. (Meridian's view)

Where you'll meet it

GLEIF's LEI-CDF Format 3.1 says an EntityStatus value in a conforming file shall be one of the code strings ACTIVE, INACTIVE or NULL.[9] GLEIF's LEI-CDF Format 3.1 describes NULL as meaning the entity status is not applicable.[9]

Detection notes

Full-word boolean encoding. The most common format in application data and user-facing systems. DuckDB natively accepts true/false, yes/no, on/off (case-insensitive) for CAST to BOOLEAN.

In Meridian's open data

  • gleifentity_statusconfidence 1

Use it

CLI · DuckDB
$ finetype infer -i "true" --mode column
→ representation.boolean.terms

SELECT ft_infer('true');
-- → 'representation.boolean.terms'
Cast expression
CAST(CASE WHEN lower({col}) IN ('on', 'enabled', 'active') THEN 'true' WHEN lower({col}) IN ('off', 'disabled', 'inactive') THEN 'false' ELSE {col} END AS BOOLEAN)

Schema

https://meridian.online/schemas/representation.boolean.terms · Frictionless type boolean

finetype taxonomy representation.boolean.terms -o json-schema

Aliases

word_booltext_bool

Type Registry