ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / internal/modules/ontology/adapters/nice.go

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / internal/modules/ontology/adapters/nice.go
DateNot specified in source
RepositoryJanady13/missionmatch
Revision720d47fae476b0d38477ae4401697d372b1ea2bc
Branchfeature/opportunity-to-outcome
Path or archive memberinternal/modules/ontology/adapters/nice.go
Original SHA-2569891ce2ea6e0a03598db9136ec13cff7de59353405ca6532738b41cfb75f5ada
Git blob SHA2f54233fb14fc95eae219797e9f19af87907be69
Reading-copy SHA-2569891ce2ea6e0a03598db9136ec13cff7de59353405ca6532738b41cfb75f5ada

Original source ↗

Every recorded occurrence

These 20 records contain identical original source bytes. Their paths and revisions remain part of the archive.

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gofeature/opportunity-to-outcome720d47fae476b0d38477ae4401697d372b1ea2bcOpen original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gocollision-deconfliction4ee5a09972608ed89f8377c6665542d5f450f0a6Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gows6-retrieval6c56e29231ec05735927fa265c97d517499dfeafOpen original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gom5-price-to-win41000ad30fff4129fdaf5ec84e15ba14c27d4890Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gows1-ontology-syncb596f449a32a1016fbd403c36505cc00a1ac9ee6Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gomaster1e9249840a4302ec82e123b9c9cb6f75badea3e4Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gows8-teaching-loopc823f0fb6bb2aba0f39001eb6de96f4000d9321fOpen original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gomag-substrateb82c7100a492dec67dfd1eda6b3f53def859be35Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gows3-clearance4b8e7ce594c068621867f9c9deed0ec64ae6c553Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gophase2-eval-fairnessd361af254701975fe239927656ababb56374655eOpen original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gotime-to-fill-survivalb66e1e505863d4f17741a4b9ede73509e45bd6c6Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gographrag-foundationb0ddeb9f633fd138d09309d1a17b7d13bc3a67f7Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gows9-bench-ingestionf585a9ef32fa554663ce1fba9a414a54b6e49cf0Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gows2-alias-relationshipe4dada4601c6eb101830f9d223a9655dfa120616Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gopresentation-readinesseb574acaa29d71ce4d0f852572e87c275c79fdb7Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.govendor-intelligencefe9796a19c261951d3f2565206c0c1b5ac294465Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gows7-federal-signal6a9f6ce9cfb13345ffb47770d4960e7c2d9c17c2Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gophase2-connectorse038d4c687aec16f8bd9bc4d907eea14d91f8704Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gofeature/aioe-upgrade2178e7298d0e5d9af83afa12402fd587f0ba6ed8Open original
Janady13/missionmatch / internal/modules/ontology/adapters/nice.gocapture-readinessbae6af7cb2997e819174a9e9cfff5e16067a1975Open original

Recovered source transcript

package adapters import ( "context" "encoding/json" "fmt" "io" "net/http" "strings" "time" "github.com/missionworkforce/missionmatch/internal/modules/ontology" ) // NICESource ingests the NIST NICE Workforce Framework for Cybersecurity (SP 800-181 Rev 1) // components JSON published by the NIST Cybersecurity and Privacy Reference Tool (CPRT). // It yields one KindWorkRole record per work_role element and one KindKSA record per task, // knowledge, or skill element. Structural element types (sort, category, competency_area, // opm_code) are skipped. type NICESource struct { url string client *http.Client } // NewNICESource builds the adapter. url is the NICE components JSON location published by NIST CPRT. func NewNICESource(url string, client *http.Client) *NICESource { if client == nil { client = &http.Client{Timeout: 120 * time.Second} } return &NICESource{url: url, client: client} } // Name is the provenance label stamped on every record this source yields. func (s *NICESource) Name() string { return "NICE Framework" } // Fetch downloads the NICE components JSON and yields one record per work role and TKS element. func (s *NICESource) Fetch(ctx context.Context, yield func(ontology.VocabRecord) error) error { data, err := s.download(ctx) if err != nil { return err } recs, err := parseNICE(data) if err != nil { return err } for _, r := range recs { if err := yield(r); err != nil { return err } } return nil } func (s *NICESource) download(ctx context.Context) ([]byte, error) { req, err := http.NewRequestWithContext(ctx, http.MethodGet, s.url, nil) if err != nil { return nil, fmt.Errorf("nice: new request: %w", err) } resp, err := s.client.Do(req) if err != nil { return nil, fmt.Errorf("nice: get: %w", err) } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("nice: provider returned %s", resp.Status) } return io.ReadAll(resp.Body) } // niceDocument mirrors the top-level shape of the NIST CPRT NICE components JSON // (v2-2-0_nf_components.json, confirmed from the live file at // https://csrc.nist.gov/csrc/media/Projects/cprt/documents/nice/v2-2-0_nf_components.json). type niceDocument struct { Elements []niceElement `json:"elements"` } // niceElement mirrors one entry in the elements array. The five fields below are the complete // set present in the real file; element_type values observed are: sort, category, competency_area, // opm_code, work_role, task, knowledge, skill. type niceElement struct { ElementType string `json:"element_type"` ElementIdentifier string `json:"element_identifier"` Title string `json:"title"` Text string `json:"text"` DocIdentifier string `json:"doc_identifier"` } // parseNICE decodes NICE components JSON bytes and returns one VocabRecord per work_role and // per TKS (task, knowledge, skill) element. All other element types are skipped. // // Schema notes confirmed from the live v2-2-0 file: // // work_role: identifier in element_identifier (e.g. OG-WRL-017), name in title, description in text. // task: identifier in element_identifier (e.g. T0006), title is empty, description in text. // knowledge: identifier in element_identifier (e.g. K0018), title is empty, description in text. // skill: identifier in element_identifier (e.g. S0011), title is empty, description in text. func parseNICE(data []byte) ([]ontology.VocabRecord, error) { var doc niceDocument if err := json.Unmarshal(data, &doc); err != nil { return nil, fmt.Errorf("nice: decode JSON: %w", err) } out := make([]ontology.VocabRecord, 0, len(doc.Elements)) for _, el := range doc.Elements { id := strings.TrimSpace(el.ElementIdentifier) if id == "" { continue } switch el.ElementType { case "work_role": term := strings.TrimSpace(el.Title) if term == "" { term = strings.TrimSpace(el.Text) } if term == "" { continue } raw, _ := json.Marshal(map[string]string{ "element_type": el.ElementType, "element_identifier": id, "title": el.Title, "text": el.Text, }) out = append(out, ontology.VocabRecord{ SourceName: "NICE Framework", SourceRecordID: id, Kind: ontology.KindWorkRole, Term: term, Code: id, Category: el.ElementType, Description: strings.TrimSpace(el.Text), Raw: raw, }) case "task", "knowledge", "skill": term := strings.TrimSpace(el.Text) if term == "" { term = strings.TrimSpace(el.Title) } if term == "" { continue } raw, _ := json.Marshal(map[string]string{ "element_type": el.ElementType, "element_identifier": id, "title": el.Title, "text": el.Text, }) out = append(out, ontology.VocabRecord{ SourceName: "NICE Framework", SourceRecordID: id, Kind: ontology.KindKSA, Term: term, Code: id, Category: el.ElementType, Description: term, Raw: raw, }) default: // sort, category, competency_area, opm_code and any future structural types are skipped. } } return out, nil }

Search equations, builds, manuscript text, and recovered sources.