Weksa/schemas/cultnet/weksa.entity.schema.json
Weksa e7a3406b89 Entity forms carry a ruled pronunciation; lower --ipa emits it
LanguageForms gains an optional Pronunciation: bare stress-marked IPA, ruled_by,
date, source and a rejected list. The store checks its shape and freezes a
ruling once set. pronounce() and `weksa lower --ipa` print the stored IPA of each
cited entity and refuse with NoPronunciation / NoEntityReferent; rejected
variants are never read. Nibu is the first entry: ˈnibu, rejected ˈnɪbu.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 12:04:41 +00:00

171 lines
4.4 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Entity",
"description": "Key: the entity id. Forms only grow: see `EntityStore::put`.",
"type": "object",
"properties": {
"forms": {
"type": "array",
"items": {
"$ref": "#/$defs/LanguageForms"
}
},
"id": {
"$ref": "#/$defs/EntityId"
},
"origin": {
"$ref": "#/$defs/EntityOrigin"
}
},
"required": [
"id",
"forms",
"origin"
],
"$defs": {
"EntityId": {
"type": "string",
"pattern": "^entity:[a-z0-9]([a-z0-9-]{0,46}[a-z0-9])?$"
},
"EntityOrigin": {
"description": "Where an entity was minted.",
"oneOf": [
{
"description": "From a cast member's fixture: the persona and the fixture path the\nentity came from.",
"type": "object",
"properties": {
"Cast": {
"type": "object",
"properties": {
"fixture": {
"type": "string"
},
"persona": {
"type": "string"
}
},
"required": [
"persona",
"fixture"
]
}
},
"additionalProperties": false,
"required": [
"Cast"
]
},
{
"description": "From a public-domain work.",
"type": "object",
"properties": {
"PublicDomain": {
"type": "object",
"properties": {
"work": {
"type": "string"
}
},
"required": [
"work"
]
}
},
"additionalProperties": false,
"required": [
"PublicDomain"
]
},
{
"description": "Minted live by the named persona before it names the entity.",
"type": "object",
"properties": {
"Live": {
"type": "object",
"properties": {
"persona": {
"type": "string"
}
},
"required": [
"persona"
]
}
},
"additionalProperties": false,
"required": [
"Live"
]
}
]
},
"LanguageForms": {
"description": "An entity's forms in one language, as the corpus item language tag spells it.\nThe citation form comes first.",
"type": "object",
"properties": {
"forms": {
"description": "1 to 64 bytes each, no control or invisible format character, no edge\nwhitespace, none repeated.",
"type": "array",
"items": {
"type": "string"
}
},
"language": {
"type": "string"
},
"pronunciation": {
"description": "How the citation form (`forms[0]`) is said, when someone with the\nauthority to rule on it has. Absent means unruled, never \"spelled as\nread\".",
"anyOf": [
{
"$ref": "#/$defs/Pronunciation"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
"language",
"forms"
]
},
"Pronunciation": {
"description": "A ruled pronunciation of an entity's citation form in one language.",
"type": "object",
"properties": {
"date": {
"description": "`YYYY-MM-DD`.",
"type": "string"
},
"ipa": {
"description": "Broad IPA with stress marks, bare: no enclosing `/` or `[ ]`. 1 to 64\nbytes, NFC.",
"type": "string"
},
"rejected": {
"description": "Pronunciations that were considered and refused, same shape as `ipa`.\nKept so nobody re-proposes one; never emitted.",
"type": "array",
"default": [],
"items": {
"type": "string"
}
},
"ruled_by": {
"description": "Who ruled: the entity itself, a writer, an operator.",
"type": "string"
},
"source": {
"description": "Where the ruling was made: a room, a document, a run.",
"type": "string"
}
},
"required": [
"ipa",
"ruled_by",
"date",
"source"
]
}
}
}