Control plane
Dataset namespaces, upload metadata, idempotent compilation jobs, artifact roots, qualification and atomic publication.
services/api · ngkg-catalog · operators
Engineering book · Release 1.0
c8 documentation
Open-source engineering
This book is a feature-first map of the Release 1.0 implementation. It groups first-party entry points by behavior, names the functions to read first and makes the current activation and qualification boundaries explicit.
95
Rust source files
32
REST operations
338/338
Recorded query/result tests
01 · system map
Dataset namespaces, upload metadata, idempotent compilation jobs, artifact roots, qualification and atomic publication.
services/api · ngkg-catalog · operators
Bounded TriG scanning, semantic projection, deterministic dictionaries, partition reduction and Arrow/Parquet generation.
distributed-worker · ngkg-distributed-build · ngkg-projection
OWL 2 DL qualification, pinned imports, HermiT exact reasoning, proofs and completeness certificates.
ngkg-owl-direct · ngkg-online-reasoning · HermiT adapter
Authorized immutable snapshots, SPARQL Protocol, c8 query evidence, query routing, locator lookup and hydration.
online-serving · ngkg-sparql-compiler · ngkg-reference
Typed algebra/path DAGs, stable partition ownership, Arrow exchange, joins, frontiers, checkpoints and spill.
ngkg-query-planner · ngkg-query-executor · ngkg-grace-join
Checksums, snapshot and graph-set hashes, manifests, proof support and differential equality against the scalar oracle.
ngkg-types · contracts · reference qualification
A request is admitted for a tenant, restricted to authorized graph IRIs, bound to one active snapshot, planned and executed under explicit ceilings, then returned only when its result and evidence are complete. Unknown semantic coverage routes to exact reasoning; it is never reinterpreted as false.
02 · implementation lanes
95 source files
Services, CRD controllers, deterministic plans, bounded Tokio/blocking lanes, Arrow/Parquet, Grace joins, mmap locators, NVMe spill, caching and integrity validation.
HermiT adapter
OWLAPI loads the pinned import closure; HermiT validates global consistency and answers exact OWL 2 Direct-Semantics entailment requests through a checksum-bound process boundary.
0 first-party files
Phase 42 is the documented acceleration lane for measured sparse kernels such as CSR traversal, bitmap intersection and SIMD decode. It is not active in this candidate.
Why this division matters: Rust supplies memory safety and predictable bounded concurrency for the always-on database path. HermiT supplies standards-grounded logical completeness. A future C++ kernel must beat the Rust reference on a measured workload and pass byte-independent differential equality before it can enter the trusted path.
03 · design law
Never construct a query or reasoner dataset before tenant admission and graph authorization. Exact OWL input is authorized */semkg plus pinned imports only.
Snapshot, graph-set, request, partition and artifact identities are deterministic and checksum-bound. Do not introduce mutable aliases into trusted execution.
Missing or duplicate partitions, bad checksums, partial workers and exceeded ceilings fail closed. Success cannot mean best effort.
The scalar evaluator is the correctness oracle. A distributed operator becomes normal-path eligible only after differential equality passes for its supported domain.
04 · contribution loop
cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspace --all-features
mvn --batch-mode --no-transfer-progress \
-f adapters/hermit-reasoner/pom.xml clean test package
helm lint charts/ngkg-crds
helm lint charts/ngkg-platform
helm lint charts/ngkg-workloads
python3 scripts/structural_validate.py --root .If those tools are unavailable, report the gate as unexecuted. Source inspection is useful review evidence, but it is not a substitute for native compilation or runtime qualification.
05 · next milestones
Exchange Arrow partitions between pods, execute scalar-oracle stages where needed, require complete sets and gate each operator by equality.
Connect NFA frontiers to snapshot adjacency indexes, fragment pods and atomic checkpoints; resume safely and feed bindings back to SPARQL.
Implement secured SERVICE/SERVICE SILENT, dataset parameters, remaining result negotiation, SSRF controls and qualified service description.
Prove scaling, skew, hot vertices, NVMe spill, worker death, duplicate delivery, drain, upgrade, rollback, backup, restore and soak behavior.
The direct raw upload is bounded at 100 GiB. Version-bound cloud-object registration, resumable multipart upload and sharded source manifests for hundreds of GiB are proposals, not current behavior.
Run W3C/Jena differential suites, security and tenant-isolation tests, SBOM/license/CVE scans and signed reproducible offline builds.
06 · ordered delivery
The sequence is dependency-ordered: make cloud objects deterministic compilation inputs, build and qualify the semantic snapshot, activate distributed runtimes, then prove storage, scaling, security, standards and release behavior.
Convert frozen cloud manifests into syntax-aware distributed RDF decode and partition plans; existing bucket TriG becomes an automatic compilation input without HTTP upload.
Build GUID dictionaries, graph partitions, Parquet payloads, adjacency structures, semantic indexes and union-default metadata across nodes; large datasets become efficiently queryable artifacts.
Assemble authorized asserted */semkg graphs with pinned imports and validate profile, datatypes and consistency; each snapshot receives deterministic semantic identity and qualification evidence.
Generate certified finite closure, semantic extents, equality components, property-chain consequences and proof support with distributed workers plus exact HermiT verification.
Certify every compiler and reasoner partition before atomically publishing; cloud-hosted TriG becomes visible through ordinary /sparql and /query routes without partial exposure.
Enable distributed OPTIONAL, UNION, MINUS, aggregation, sorting, DISTINCT, subqueries, modifiers and all query forms while preserving exact equality with the scalar oracle.
Connect adjacency indexes to frontiers, hot-vertex splitting, spill, checkpoint recovery and termination detection for massive graph traversal across cores and nodes.
Implement controlled SERVICE/SERVICE SILENT, variable endpoints, protocol datasets, result negotiation and service description for secured federated RDF environments.
Qualify replication, relocation, node loss, retries, duplicate delivery, checksum failure, backup and restore so snapshots remain deterministic and recoverable.
Exercise Kueue, HPA/KEDA, cluster autoscaling, scale-from-zero pools, workload isolation and cgroup-aware budgets without changing results.
Complete workload identity, tenant isolation, encryption, network policy, audit trails, rate limits, observability, SLOs and disaster procedures.
Pass applicable SPARQL, TriG, OWL Direct-Semantics, result-format, federation and failure suites against HermiT and Apache Jena.
Benchmark ingestion, traversal, reasoning, concurrency, latency and cost against Apache Jena on representative enterprise datasets.
Complete multinode soak, chaos, upgrade, rollback, backup, restore, Helm, image, SBOM, CVE, license and reproducible-build gates.
Freeze APIs, schemas, images, Helm charts, documentation, checksums and qualification reports for final acceptance testing.
Resolve RC defects and publish signed, reproducible artifacts for the production autoscaling RDF/OWL database—with no ontology-alignment or raw-data-mapping claim.
07 · distributed skew
Yes—this is a blended distributed-software and Kubernetes multi-node feature. A hot vertex is an RDF node with an unusually large adjacency list. If USA has 50 million inbound locatedIn edges, assigning the vertex to one partition can exhaust one worker while the rest of the cluster sits idle.
Deterministic split · complete merge
Hot vertex
millions of edges
Worker pod A
edges 0–999,999
Worker pod B
edges 1M–1,999,999
Worker pod C
edges 2M–end
Completion barrier
verify every split
merge + deduplicate
advance exact frontier
| Layer | Responsibility | Capacity signal |
|---|---|---|
| c8 software | Detect skew, create deterministic splits, preserve SPARQL semantics, checkpoint, merge, deduplicate and fail closed. | Split count · frontier work |
| Rust / HPC runtime | Process bounded edge ranges with CPU lanes, Arrow batches, partitioned adjacency indexes and NVMe spill. | CPU · memory · spill bytes |
| Kubernetes | Schedule split workers across nodes while enforcing anti-affinity, resource guarantees and disruption policy. | Pending pods · node fit |
| Kueue / HPA / KEDA / autoscaler | Add workload and node capacity as pending split work, frontier size, pressure or queue delay grows. | Queue depth · delay · utilization |
Kubernetes never understands the graph vertex. c8 creates deterministic graph work units and enforces semantic completion; Kubernetes supplies and scales the physical compute that runs them.
08 · source index
Public dataset, source, ingestion, snapshot, SPARQL, reasoning and physical-retrieval surfaces.
services/api/src/main.rsControl-plane HTTP service for datasets, raw TriG uploads, asynchronous compilation jobs and snapshot publication.
create_datasetupload_trig_sourceinspect_trigcreate_ingestionget_jobcancel_jobget_snapshotpublish_snapshotservices/online-serving/src/main.rsServing-plane routes for SPARQL Protocol, c8 JSON queries, Direct-Semantics validation/routing, locator lookup and hydration.
sparql_getsparql_postsparql_service_descriptionexecute_sparql_protocolquerylocatehydrateThis candidate exposes 32 explicit REST operations plus two Swagger asset handlers. Ingestion is polled through the jobs route; there are no callbacks or webhooks.
09 · source index
Checksum-bound object-store materialization, immutable snapshot identity and compare-and-swap publication.
crates/ngkg-artifact-store/src/lib.rsFetches and publishes immutable artifacts while enforcing declared digests and resource budgets.
from_base_urlmaterialize_verifiedmaterialize_verified_with_budgetput_file_immutablecrates/ngkg-snapshot/src/lib.rsValidates serving manifests and activates qualified snapshots without mutating prior versions.
validate_manifestpublishcrates/ngkg-distributed-artifacts/src/lib.rsBuilds and finalizes partitioned Arrow/Parquet and catalog artifacts, then compares independent roots.
materialize_artifact_partitionfinalize_artifact_partitionsfinalize_catalog_artifact_partitionscompare_artifact_roots10 · source index
Durable control-plane truth, deterministic entity identity and collision-safe dictionary construction.
crates/ngkg-catalog/src/lib.rsOwns dataset, compilation, distributed-plan, work-completion, certification and active-snapshot records in PostgreSQL.
create_datasetcreate_or_get_compilationregister_distributed_plancommit_distributed_workcommit_serving_rootget_active_serving_snapshotpublish_snapshotcrates/ngkg-identity/src/lib.rsDerives stable GUIDs and fact identities from canonical IRIs and merges deterministic dictionary runs.
guid_for_canonical_iriskolem_irifact_identityverify_fact_collisionmerge_dictionary_runs11 · source index
Named-graph catalogs, graph roles, visibility labels and authorized active-dataset assembly.
crates/ngkg-dataset/src/lib.rsCompiles graph catalogs, resolves service datasets and restricts them to admitted roles before planning or reasoning.
compile_catalogresolve_datasetvalidate_resolved_datasetrestrict_resolved_dataset_to_rolesvalid_authorization_labelservices/online-serving/src/main.rsApplies tenant admission and graph authorization before computing the active graph-set and dataset hashes.
authorize_requestresolve_authorized_datasetvalidate_active_snapshot12 · source index
Bounded, restartable TriG scanning and partition work for compilation and physical artifact creation.
crates/ngkg-distributed-build/src/lib.rsScans TriG under ceilings, projects stable partitions, reduces runs and compares independently computed roots.
safe_scan_trigproject_partitionreduce_projection_runsfinalize_reducerscompare_rootsservices/distributed-worker/src/main.rsWorker binary that executes locator, artifact, scan, projection, reduce, finalize and comparison work items.
compile_locatormaterialize_artifactssafe_scanprojectreducefinalizecompareservices/distributed-worker/src/object_stage.rsPlans and executes object-store-backed stages through artifact and serving-root preparation.
planprojectreducefinalizeprepare_artifactsmaterialize_artifact_object_storeprepare_serving_root_object_store13 · source index
Whole-core budgets, bounded Rust concurrency, Grace hash joins and NVMe-backed spill accounting.
crates/ngkg-hpc-runtime/src/lib.rsValidates runtime thread budgets and reports node capabilities against workload saturation targets.
node_saturation_targetvalidate_thread_budgetcapability_reportcrates/ngkg-grace-join/src/lib.rsRuns bounded Grace hash joins with streaming inputs and observable spill usage.
openjoinjoin_streamactive_spill_bytescrates/ngkg-shuffle-cache/src/lib.rsCaches checksum-addressed shuffle objects with bounded usage and invalidation.
digestopengetinsertinvalidateusage14 · source index
Turns semantic GUID results into bounded physical Parquet reads without weakening graph authorization.
crates/ngkg-locator/src/lib.rsCompiles and queries sharded GUID-to-Parquet locator indexes and coalesces safe byte ranges.
compile_sharded_locatoropenlookupvalidateowner_forcoalesce_rangescrates/ngkg-hydration/src/lib.rsPlans and performs graph-filtered payload hydration after verifying every referenced shard.
verify_payload_shardplan_hydrationhydrate_sharded_payloadhydrate_sharded_payload_for_graphstruncate_optional_contextcrates/ngkg-index/src/lib.rsOpens physical indexes only after integrity checks succeed.
verify_open15 · source index
CRD state machines, phase barriers, dedicated worker pools and workload ownership for RKE2/Kubernetes.
crates/ngkg-kube/src/lib.rsDefines the namespaced ngkg.io/v1alpha1 NgkgCompilation custom resource shared by the API and both controllers.
NgkgCompilationNgkgCompilationSpecNgkgCompilationStatuscrates/ngkg-operator-core/src/lib.rsPure reconciliation decisions and Phase 40 resource ceilings used by the controllers.
next_actionPhase40Ceilingsservices/distributed-operator/src/main.rsSchedules distributed stages, enforces completion barriers and reconciles worker-job state.
mainreconcilereconcile_artifact_barrierschedule_stageensure_jobpatch_statusservices/operator/src/main.rsCoordinates reference compilation and top-level compilation lifecycle.
mainreconcileensure_reference_jobreference_jobpatch_statuscharts/ngkg-workloads/Deploys dedicated query, fragment, locator, hydration and reasoner roles with HPAs, affinity and policy.
values.schema.jsontemplates/HPAsNetworkPolicies16 · source index
Direct-Semantics legality, authorized ontology assembly, HermiT execution, proof binding and complete partition merging.
crates/ngkg-owl-direct/src/lib.rsExtracts candidate OWL Direct-Semantics BGP templates and classifies legal graph patterns.
extract_direct_bgp_templateclassify_direct_bgpscrates/ngkg-online-reasoning/src/lib.rsSelects authorized semkg modules, builds reasoner partitions, retries dispatch and rejects incomplete result sets.
select_authorized_asserted_modulesvalidate_ontology_snapshot_bindingbuild_distributed_reasoner_plandispatch_exact_partitions_with_retrycomplete_distributed_exact_bgpcrates/ngkg-direct-reasoner/src/lib.rsBuilds, executes and merges exact Direct-BGP partition requests with deterministic request-set identity.
execute_exact_direct_bgpprepare_exact_direct_bgp_requestsexecute_exact_direct_partitionmerge_partition_resultsdirect_exact_request_set_sha256crates/ngkg-reasoner-client/src/lib.rsValidates legality, result, certificate and proof bindings before accepting reasoner output.
require_legal_direct_bgpreasondecide_coveragecrates/ngkg-reference/src/direct_exact.rsAssembles the active exact ontology only from authorized */semkg graphs and pinned imports.
build_direct_active_ontology_bundlecrates/ngkg-reference/src/reasoner.rsInvokes the checksum-pinned HermiT adapter under bounded execution rules.
invoke_reasoneradapters/hermit-reasoner/src/main/java/io/ngkg/reasoner/DirectBgpExecutor.javaExecutes OWLAPI/HermiT Direct-BGP requests and emits bounded exact evidence.
executerenderResultsrenderProofSupport17 · source index
Exact NFA traversal state, origin-preserving frontiers, partition ownership, checkpoints and termination.
crates/ngkg-query-executor/src/distributed_path.rsSeeds, partitions and expands path frontiers; validates complete iterations and atomic resume checkpoints.
seed_path_frontierpath_partition_ownerpath_expansion_work_itemsexpand_path_work_itemcomplete_path_iterationbuild_path_checkpointvalidate_path_checkpointThe kernel and contracts are present. Live adjacency retrieval and endpoint activation still require Phase 40.13.9 integration and differential qualification.
crates/ngkg-sparql-compiler/src/lib.rsCompiles SPARQL path expressions into exact distributed property-path plans.
distributed_property_path_plans18 · source index
Scalar correctness path, semantic compilation, expected-result verification and differential gates.
crates/ngkg-reference/src/query.rsBuilds the standards-correct scalar store, executes compiled queries and canonicalizes results for comparison.
build_storebuild_store_with_dataset_policyexecute_compiled_querycanonical_result_hashverify_bindingsload_rdf_fixturecrates/ngkg-reference/src/compiler.rsCompiles source manifests into semantic catalogs and certifies representative query behavior.
compile_from_manifestvalidate_graph_catalogwrite_semantic_capabilitiescertify_queriescrates/ngkg-reference/src/rdf.rsParses TriG/N-Quads, normalizes facts and enforces the RDF/datatype policy.
parse_trigparse_nquadsnormalized_factsnquad_linentriple_lineservices/reference-worker/src/object_compile.rsRuns object-store-backed reference attempts, uploads artifacts and certifies sharded hydration.
compile_object_storerun_attemptcertify_sharded_hydrationupload_snapshot19 · source index
Parsing, canonical algebra, graph fragments, bounded partition operators and scalar differential comparison.
crates/ngkg-sparql-compiler/src/lib.rsParses SPARQL, applies base IRIs, requires certifiable constructs and emits canonical or distributed plans.
parseparse_with_base_irirequire_certifiablecanonical_ssedistributed_graph_fragmentsdistributed_algebra_plancrates/ngkg-query-planner/src/lib.rsValidates typed distributed plans, computes execution waves, routes relevant graphs and chooses exchanges.
validate_distributed_algebra_planalgebra_execution_wavesroute_relevant_graphschoose_exchangecrates/ngkg-query-executor/src/lib.rsReads/writes Arrow streams and implements stable partition ownership, exact semijoins, joins, projection and frontier utilities.
read_arrow_streamwrite_arrow_streampartition_rowsexact_semijoininner_joinproject_sparql_jsonnext_frontiercrates/ngkg-query-executor/src/distributed_algebra.rsImplements native UNION, OPTIONAL/left join, MINUS, DISTINCT, grouping, ordered merge and global slicing under complete-partition barriers.
execute_native_algebra_taskunion_sparql_jsonleft_join_sparql_jsonminus_sparql_jsondistinct_sparql_jsongroup_owned_partitionsmerge_ordered_partitions_byglobal_slice_sparql_jsonThe normal endpoint retains the scalar correctness path until every optimized operator is transported to workers and passes its differential gate.
services/online-serving/src/main.rsCoordinates protocol parsing, scalar execution, exact reasoning and the distributed evidence lane.
execute_sparql_protocolexecute_distributed_queryexecute_fragmentexecute_partitioned_shuffleexecute_uncertified_exact_querycrates/ngkg-query-cache/src/lib.rsStores deterministic query results under snapshot-, graph-set- and plan-bound cache keys.
digestopengetinsertinvalidateusage20 · source index
Typed requests, plans, certificates, proofs and manifests that bind every result to inputs and completeness evidence.
crates/ngkg-types/src/direct_bgp.rsDefines and validates normalized Direct-BGP result envelopes.
validate_resultcrates/ngkg-types/src/direct_certificate.rsValidates exact certificates, result hashes and snapshot/graph bindings.
validate_certificatevalidate_result_hashcrates/ngkg-types/src/direct_exact.rsDefines exact requests and partition results with integrity validation.
validate_exact_requestvalidate_partition_resultcrates/ngkg-types/src/direct_proof.rsBuilds support identities and validates proof manifests and bundles.
support_idsupport_hashvalidate_manifestvalidate_bundlecontracts/Versioned JSON Schemas for graph catalogs, distributed plans, snapshots, Direct-BGP evidence and serving roots.
graph-catalogdirect-bgpdirect-proofdistributed-*serving-root