Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | internal/modules/ontology/adapters/nice_test.go |
| Original SHA-256 | eb583da3d67b629a9596987dfc5969c9f941dc86907463c3ab08a3ae56d66251 |
| Git blob SHA | df5c37ae4218ed76f31f2aeb25daa228e93975ac |
| Reading-copy SHA-256 | eb583da3d67b629a9596987dfc5969c9f941dc86907463c3ab08a3ae56d66251 |
Every recorded occurrence
These 20 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | feature/opportunity-to-outcome | 720d47fae476b0d38477ae4401697d372b1ea2bc | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | collision-deconfliction | 4ee5a09972608ed89f8377c6665542d5f450f0a6 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | ws6-retrieval | 6c56e29231ec05735927fa265c97d517499dfeaf | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | m5-price-to-win | 41000ad30fff4129fdaf5ec84e15ba14c27d4890 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | ws1-ontology-sync | b596f449a32a1016fbd403c36505cc00a1ac9ee6 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | master | 1e9249840a4302ec82e123b9c9cb6f75badea3e4 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | ws8-teaching-loop | c823f0fb6bb2aba0f39001eb6de96f4000d9321f | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | mag-substrate | b82c7100a492dec67dfd1eda6b3f53def859be35 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | ws3-clearance | 4b8e7ce594c068621867f9c9deed0ec64ae6c553 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | phase2-eval-fairness | d361af254701975fe239927656ababb56374655e | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | time-to-fill-survival | b66e1e505863d4f17741a4b9ede73509e45bd6c6 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | graphrag-foundation | b0ddeb9f633fd138d09309d1a17b7d13bc3a67f7 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | ws9-bench-ingestion | f585a9ef32fa554663ce1fba9a414a54b6e49cf0 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | ws2-alias-relationship | e4dada4601c6eb101830f9d223a9655dfa120616 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | presentation-readiness | eb574acaa29d71ce4d0f852572e87c275c79fdb7 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | vendor-intelligence | fe9796a19c261951d3f2565206c0c1b5ac294465 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | ws7-federal-signal | 6a9f6ce9cfb13345ffb47770d4960e7c2d9c17c2 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | phase2-connectors | e038d4c687aec16f8bd9bc4d907eea14d91f8704 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | feature/aioe-upgrade | 2178e7298d0e5d9af83afa12402fd587f0ba6ed8 | Open original |
| Janady13/missionmatch / internal/modules/ontology/adapters/nice_test.go | capture-readiness | bae6af7cb2997e819174a9e9cfff5e16067a1975 | Open original |
Recovered source transcript
Download complete source text ↓171 lines · 4.9 KB
package adapters
import (
"testing"
"github.com/missionworkforce/missionmatch/internal/modules/ontology"
)
// niceFixture is a minimal NICE components JSON shaped exactly like the real v2-2-0 file.
// It contains one work_role element and one task element plus structural types that the parser
// must ignore (sort, category, competency_area, opm_code).
const niceFixture = `{
"documents": [
{
"doc_identifier": "SP_800_181_2_2_0",
"name": "Workforce Framework for Cybersecurity (NICE Framework) (NIST SP 800-181 Rev 1)",
"version": "2.2.0",
"website": "https://csrc.nist.gov/pubs/sp/800/181/r1/final"
}
],
"relationship_types": [
{
"relationship_identifier": "projection",
"description": "Represents a relationship between two elements."
}
],
"elements": [
{
"element_type": "sort",
"element_identifier": "S-OG",
"title": "00001",
"text": "",
"doc_identifier": "SP_800_181_2_2_0"
},
{
"element_type": "category",
"element_identifier": "OG",
"title": "OVERSIGHT and GOVERNANCE",
"text": "Provides leadership, management, direction, or development and advocacy so the organization may effectively conduct cybersecurity work.",
"doc_identifier": "SP_800_181_2_2_0"
},
{
"element_type": "work_role",
"element_identifier": "OG-WRL-017",
"title": "Cybersecurity Supply Chain Risk Management",
"text": "Responsible for developing cybersecurity supply chain risk management policies and procedures.",
"doc_identifier": "SP_800_181_2_2_0"
},
{
"element_type": "competency_area",
"element_identifier": "NF-COM-001",
"title": "AI Security",
"text": "Applies knowledge of AI concepts to secure systems.",
"doc_identifier": "SP_800_181_2_2_0"
},
{
"element_type": "task",
"element_identifier": "T0006",
"title": "",
"text": "Advocate organization's official position in legal and legislative proceedings",
"doc_identifier": "SP_800_181_2_2_0"
},
{
"element_type": "knowledge",
"element_identifier": "K0018",
"title": "",
"text": "Knowledge of encryption algorithms",
"doc_identifier": "SP_800_181_2_2_0"
},
{
"element_type": "skill",
"element_identifier": "S0011",
"title": "",
"text": "Skill in conducting information searches",
"doc_identifier": "SP_800_181_2_2_0"
},
{
"element_type": "opm_code",
"element_identifier": "2210",
"title": "Information Technology Management",
"text": "",
"doc_identifier": "SP_800_181_2_2_0"
}
]
}`
func TestParseNICE(t *testing.T) {
recs, err := parseNICE([]byte(niceFixture))
if err != nil {
t.Fatalf("parseNICE returned an error: %v", err)
}
// Expect 4 records: one work_role + three TKS (task, knowledge, skill).
// sort, category, competency_area, and opm_code must be skipped.
if len(recs) != 4 {
t.Fatalf("want 4 records (1 work_role + 3 TKS), got %d: %+v", len(recs), recs)
}
// Index by SourceRecordID for order-independent assertions.
byID := make(map[string]ontology.VocabRecord, len(recs))
for _, r := range recs {
byID[r.SourceRecordID] = r
}
// Work role assertions.
wr, ok := byID["OG-WRL-017"]
if !ok {
t.Fatal("expected a record with SourceRecordID OG-WRL-017")
}
if wr.Kind != ontology.KindWorkRole {
t.Errorf("work_role: want Kind %q, got %q", ontology.KindWorkRole, wr.Kind)
}
if wr.Term != "Cybersecurity Supply Chain Risk Management" {
t.Errorf("work_role: wrong Term %q", wr.Term)
}
if wr.Code != "OG-WRL-017" {
t.Errorf("work_role: wrong Code %q", wr.Code)
}
if wr.SourceName != "NICE Framework" {
t.Errorf("work_role: wrong SourceName %q", wr.SourceName)
}
if wr.Category != "work_role" {
t.Errorf("work_role: wrong Category %q", wr.Category)
}
// Task assertions.
tk, ok := byID["T0006"]
if !ok {
t.Fatal("expected a record with SourceRecordID T0006")
}
if tk.Kind != ontology.KindKSA {
t.Errorf("task: want Kind %q, got %q", ontology.KindKSA, tk.Kind)
}
if tk.Term != "Advocate organization's official position in legal and legislative proceedings" {
t.Errorf("task: wrong Term %q", tk.Term)
}
if tk.Category != "task" {
t.Errorf("task: wrong Category %q", tk.Category)
}
// Knowledge assertions.
kn, ok := byID["K0018"]
if !ok {
t.Fatal("expected a record with SourceRecordID K0018")
}
if kn.Kind != ontology.KindKSA {
t.Errorf("knowledge: want Kind %q, got %q", ontology.KindKSA, kn.Kind)
}
if kn.Term != "Knowledge of encryption algorithms" {
t.Errorf("knowledge: wrong Term %q", kn.Term)
}
if kn.Category != "knowledge" {
t.Errorf("knowledge: wrong Category %q", kn.Category)
}
// Skill assertions.
sk, ok := byID["S0011"]
if !ok {
t.Fatal("expected a record with SourceRecordID S0011")
}
if sk.Kind != ontology.KindKSA {
t.Errorf("skill: want Kind %q, got %q", ontology.KindKSA, sk.Kind)
}
if sk.Term != "Skill in conducting information searches" {
t.Errorf("skill: wrong Term %q", sk.Term)
}
if sk.Category != "skill" {
t.Errorf("skill: wrong Category %q", sk.Category)
}
}