Entity Type
Entity Type
Section titled “Entity Type”Definition
Section titled “Definition”An entity_type is the controlled vocabulary of entity classes the extraction pipeline may assign to a Knowledge-Graph entity mention — the kind of real-world thing a span of source text refers to (an organisation, a certification, a person, and so on). It is the Layer-5 (Ontology) class vocabulary the AI uses when it lifts entities out of a document body into the Knowledge Graph, and it is the allowed_types half of the owner’s allowed_types / allowed_relations register (ID-133 Decision B).
The vocabulary is closed at v1: the 12 baseline values below are the complete set, and the extraction gate HARD-rejects any entity type outside it. Enforcement is the Pydantic entity_type Literal on EntityMentionExtraction (scripts/cocoindex_pipeline/extraction.py:378–391) — a value not in the Literal raises a ValidationError (mapped to invalid_enum), exactly mirroring the closed-enum content_type HARD-reject. ID-133 does not edit that gate; it documents it. The register values are sourced verbatim from that Literal so the markdown register equals the runtime Literal at authoring time.
Synonyms / Acronyms
Section titled “Synonyms / Acronyms”- allowed_types — the owner’s name for this register;
entity_typeIS theallowed_typesvocabulary (ID-133 Decision B, theallowed_types/allowed_relationspair). - entity class / entity kind — informal names for an
entity_typevalue.
Baseline values
Section titled “Baseline values”The 12 closed entity classes, in Literal order. Each value is core and immutable at v1; the CV-level client_extensible: true is the forward bridge (see Notes), not a v1 capability.
| key | label | provenance | provenance_model | client_extensible | editable_via |
|---|---|---|---|---|---|
| organisation | Organisation | core | core | false | database_migration |
| certification | Certification | core | core | false | database_migration |
| regulation | Regulation | core | core | false | database_migration |
| framework | Framework | core | core | false | database_migration |
| capability | Capability | core | core | false | database_migration |
| person | Person | core | core | false | database_migration |
| technology | Technology | core | core | false | database_migration |
| project | Project | core | core | false | database_migration |
| sector | Sector | core | core | false | database_migration |
| product | Product | core | core | false | database_migration |
| standard | Standard | core | core | false | database_migration |
| methodology | Methodology | core | core | false | database_migration |
Relationships
Section titled “Relationships”- KG write-site —
entity_mentions(DB table). Each entity-mention row carries anentity_typecolumn drawn from this vocabulary; the value is set at extraction time and stays in the Canonical DB (it is never lifted out into a markdown record). - Sibling —
35-relationship.md(relationship, Layer 6). Entity mentions are the nodes;relationshippredicates are the edges between them —related_layers: [6]records the pairing. A(source, relationship, target)triple connects two entities, each of anentity_type. - Provenance chain. Every entity mention is stamped back to the source it was extracted from. Post-ID-131 the stamp’s parent FK is
source_document_id(see Notes /33-reference-item.mdfor the source-document chain).
Consumers
Section titled “Consumers”- Cocoindex extraction pipeline — sole writer.
extract_entity_mentions(scripts/cocoindex_pipeline/extraction.py) emitsEntityMentionExtractionrows; the Pydanticentity_typeLiteral (378–391) is the HARD-reject gate. The Literal mirrors the TSVALID_ENTITY_TYPESconst inlib/validation/schemas.ts. - Parity guard — the lockstep mechanism.
TestEntityTypeParity(scripts/tests/test_cocoindex_extraction.py) binds the triple Python Literal == TS const == register fixture. The public CI-visible fixture mirror is__tests__/fixtures/ontology/ontology-cv-baselines.json(expanded withentity_typeper ID-133 Decision A); the docs-site “parity-guard twin” keeps that fixture in lockstep with this markdown register. Drift in any of the three fails CI. - Knowledge Graph read surface.
entity_mentionsis the typed read surface over extracted entities; consumers filter and join onentity_type.
- Extraction stamp parent + entities stay in the DB (BI-8). Post-ID-131 the extraction stamp’s parent FK is
source_document_id(NOTcontent_items_id) — see ID-131 M2 /_ExtractionStampatscripts/cocoindex_pipeline/extraction.py:261–264for the lockstep re-parent. ID-133 does NOT edit that code (it is ID-131’s; this register only reflects it). The entity write-site stays in the Canonical DB: entity mentions (and the relationships in35-relationship.md) do not leave the DB into a markdown record (OKF v3 §7.1 / id-131 BI-14). - Closed at v1; forward bridge (Decision B). All 12 values are
coreand immutable, edited only bydatabase_migration. The CV-levelclient_extensible: trueis the forward-compat bridge, not a v1 capability: client-extensible entity types are research-deferred to v2, mirroringcontent_type’s “closed for v1” posture. If the product later makes them client-extensible, the per-valueprovenance_model/client_extensible/editable_viakeys are exactly the columns a future DB-backed provenance table would carry — promotion goes to thetaxonomy_domains-style DB register, NOT to a new markdown reader (Decision A drift-avoidance).