MeridianMERIDIAN

Weight

Person weight in kg, lbs, or other units (e.g., 75kg, 165lbs). Transforms to DOUBLE (kilograms). Decompose extracts value and unit.

Weight

identity.person.weight

Person weight in kg, lbs, or other units (e.g., 75kg, 165lbs). Transforms to DOUBLE (kilograms). Decompose extracts value and unit.

Domain
identity
Category
person
Casts to
DOUBLE
Scope
Universal

Try it

CLI
$ finetype infer -i "75 kg" --mode column
→ identity.person.weight

DuckDB

Detect
SELECT ft_infer('75 kg');
-- → 'identity.person.weight'
Cast expression
CASE
  WHEN UPPER({col}) LIKE '%LB%' THEN CAST(REGEXP_EXTRACT({col}, '^([0-9.]+)') AS DOUBLE) / 2.20462
  ELSE CAST(REGEXP_EXTRACT({col}, '^([0-9.]+)') AS DOUBLE)
END
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(ft_cast(my_column) AS DOUBLE) AS clean_value
FROM my_table
WHERE ft_infer(my_column) = 'identity.person.weight';

Struct Expansion

Expression
unit: UPPER(COALESCE(REGEXP_EXTRACT({col}, '([A-Z]+)$'), CASE WHEN CAST(REGEXP_EXTRACT({col}, '^([0-9.]+)') AS DOUBLE) > 100 THEN 'LBS' ELSE 'KG' END))
value: CAST(REGEXP_EXTRACT({col}, '^([0-9.]+)') AS DOUBLE)

JSON Schema

finetype taxonomy identity.person.weight -o json-schema
{
  "$id": "https://meridian.online/schemas/identity.person.weight",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Person weight in kg, lbs, or other units (e.g., 75kg, 165lbs). Transforms to DOUBLE (kilograms). Decompose extracts value and unit.",
  "examples": [
    "75 kg",
    "165 lbs",
    "68.5 kg",
    "170 pounds"
  ],
  "pattern": "^[0-9]+(\\.[0-9]+)?\\s*(kg|lbs|lb|g|oz|stones)?$",
  "title": "Weight",
  "type": "string",
  "x-finetype-label": "identity.person.weight",
  "x-finetype-pii": false
}

Examples

75 kg165 lbs68.5 kg170 pounds

Type Registry