// Package ontology ingests the GovCon vocabulary from free federal sources into the global ontology // store. It mirrors the opportunity_intelligence ingestion shape: a streaming source contract, a single // ingester that retains each raw payload and upserts the normalized record, and one audit event per run. package ontology import "encoding/json" // TermKind is the closed set of vocabulary record kinds. A closed set keeps the global table queryable // and lets the WS2 promotion step reason about provenance. type TermKind string const ( KindSkill TermKind = "skill" KindLaborCategory TermKind = "labor_category" KindWorkRole TermKind = "work_role" KindKSA TermKind = "ksa" KindPSC TermKind = "psc_code" KindMissionArea TermKind = "mission_area" ) // Valid reports whether k is one of the allowed kinds (it must match the CHECK in migration 0021). func (k TermKind) Valid() bool { switch k { case KindSkill, KindLaborCategory, KindWorkRole, KindKSA, KindPSC, KindMissionArea: return true } return false } // VocabRecord is one normalized vocabulary item from any ontology source. SourceName and SourceRecordID // form the upsert key. Term is the canonical text, Code is the source's own identifier (a PSC code, a SOC // code, a NICE element id), Category groups it, and Raw is the retained source payload. type VocabRecord struct { SourceName string SourceRecordID string Kind TermKind Term string Code string Category string Description string Raw json.RawMessage }