nx_ontology.nx
buildroot/runtime/nx_ontology.nx
about
nx_ontology.nx -- substrate-native ontology over RDF-style triples.
Per user directive 2026-05-14: "ontology needs to be recognized as a
part of what we are doing as we build this math layer" (Wikipedia:
Ontology (information science)).
Reads nxc2/specs/nx_ontology.txt (TSV: subject, predicate, object,
optional notes) and exposes count + lookup queries. Predicates are
free-form strings; consumers compare directly.
Composes with patent_check, provenance, emit_journal: substrate now
has a typed knowledge graph linking algorithm -> category -> source
-> license -> patent_status.
genealogy_id: substrate_ontology_2026_05_14
lineage_id: substrate_self_description
dependencies 4 imports · 3 importers
imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_str.nx
imported by: nx_ontology_test.nxnx_self_audit.nxnx_sovereign_qed_audit.nx
structs
| 34 | struct NxOntologyTriple |
| 42 | struct NxOntology |
consts
| 29 | const NX_ONT_MAX_TRIPLES: nx_int = 4096 |
| 30 | const NX_ONT_FIELD_CAP: nx_size = 96 |
| 40 | const NX_ONT_TRIPLE_BYTES: nx_size = 24 |
functions
| 51 | func nx_ont_parse_line(buf: *u8, lo: nx_int, hi: nx_int, |
| 150 | func nx_ontology_load(path: *u8) -> *NxOntology |
| 189 | func nx_ontology_n_triples(o: *NxOntology) -> nx_int { return o.n } called by 1: main |
| 192 | func nx_ontology_count_by_predicate(o: *NxOntology, pred: *u8) -> nx_int |
| 206 | func nx_ontology_count_with_po(o: *NxOntology, pred: *u8, obj: *u8) -> nx_int |
| 221 | func nx_ontology_has_triple(o: *NxOntology, subj: *u8, pred: *u8, obj: *u8) -> nx_int |
| 237 | func nx_ontology_in_domain(o: *NxOntology, subj: *u8, domain: *u8) -> nx_int |