Abstract
Operational knowledge about streaming infrastructure—who produces to a topic, which team owns it, what breaks if it fails—is scattered across dashboards, configuration files and tribal memory. Modern observability stacks capture metrics, logs and traces, but rarely the semantic relationships (ownership, lineage, blast radius, provenance) in an interoperable, queryable form. We present Black Fox, an open-source operational knowledge graph for Apache Kafka that represents topology, ownership, configuration and provenance in RDF, exposes them through SPARQL and a deterministic natural-language router, and keeps high-volume telemetry in a wide-column store. Black Fox reuses W3C standards (RDF, SPARQL, SHACL, PROV‑O) and a modular ontology, mints deterministic IRIs, and reifies every observation with a collector identity, timestamp, confidence and evidence source, enabling multi-source fusion and auditability. A guarded SPARQL facade and an LLM-optional query router keep the system safe and reproducible. The reference implementation runs from a laptop (embedded RDFLib + SQLite) to a production stack (Apache Jena Fuseki + Apache Cassandra) from a single container image. We report reproducible experiments, packaged as a Jupyter notebook, showing linear triple amplification (≈20 triples/observation), interactive transitive blast-radius queries (14–37 ms as the graph grows to 104 triples), and negligible router overhead (<0.02 ms for bounded intents).
Keywords: knowledge graph; RDF; SPARQL; SHACL; PROV-O; semantic interoperability; Apache Kafka; observability; provenance; operational intelligence; deterministic query.
1. Introduction
Apache Kafka has become the default nervous system of event-driven organisations, but the operational understanding of a Kafka estate remains stubbornly fragmented. Topic ownership lives in a wiki, partition layout in a CLI dump, retention policy in a YAML file, consumer lag in one dashboard and incident history in another. When an engineer asks a fundamentally relational question—"if orders.v1 degrades, which applications, teams and downstream topics are affected?"—there is no single system that can answer it, because the answer is a graph traversal over data that was never modelled as a graph.
This paper argues that the missing layer is a semantic operational knowledge graph: a standards-based, interoperable representation of infrastructure entities and their relationships, coupled to—but kept distinct from—the high-volume time-series telemetry that observability tools already collect. We instantiate this idea in Black Fox, a working system that is deliberately usable without a large language model: natural-language questions are mapped to bounded, deterministic operations, and raw SPARQL remains available to authorised clients.
The contributions of this paper are:
- A modular ontology for Kafka-centric operational infrastructure that reuses RDF/RDFS, OWL and PROV-O, covering clusters, brokers, topics, partitions, consumer groups, connectors, applications, teams, hosts and Kubernetes nodes (§5).
- A provenance-first ingestion model that maps collector observations to deterministic IRIs and reifies each asserted relationship with a confidence score, evidence source, collector identity and timestamp, enabling multi-source fusion and temporal reasoning (§6).
- A trust-preserving query surface: an auditable, LLM-optional natural-language router over a bounded intent set, and a guarded SPARQL facade that admits only read queries (§7).
- A reproducible reference implementation deployable from laptop to production from a single image, and a Jupyter-notebook experiment suite quantifying ingestion, query and routing behaviour (§8–9).
Black Fox extends a line of work on lightweight semantic interoperability at the network edge [10] and semantic data models for heterogeneous integration [12] to the operational core: the streaming platforms that connect edge, cloud and legacy systems.
2. Background & motivation
2.1 Why a graph, and why semantics
Operational questions in streaming systems are intrinsically relational and transitive: blast radius, lineage, ownership roll-ups and dependency chains are all path queries. Property graphs can express these, but they lack the global identifiers, schema semantics and provenance vocabulary needed to integrate data from many independent collectors and to remain interoperable across organisations. RDF supplies dereferenceable IRIs, SPARQL supplies standardised path and aggregate queries, SHACL supplies validation, and PROV-O supplies an interoperable provenance model. Choosing this stack means Black Fox data can be federated, validated and cited using off-the-shelf tooling rather than a bespoke API.
2.2 Separating the graph from the firehose
Not everything belongs in a triplestore. Per-second byte rates and consumer-lag samples are high-cardinality, append-heavy and short-lived—a poor fit for RDF but an excellent fit for a wide-column store. Black Fox therefore splits the world into a slowly-changing semantic graph (topology, ownership, configuration, provenance) and a fast telemetry store (metrics, events), linking them by stable entity IRIs. This mirrors the author's earlier position that semantics at constrained tiers must be lightweight—a light in the fog rather than a fog of its own [10].
3. Related work
Semantic web and knowledge graphs. Black Fox builds directly on the W3C stack: RDF 1.1 [1], SPARQL 1.1 [2], SHACL [3], PROV-O [4] and OWL 2 [5]. The industrial knowledge-graph literature [9] documents the value of a shared entity layer for heterogeneous integration; we specialise that pattern to streaming operations.
Observability and lineage. OpenTelemetry [7] standardises the collection of metrics, logs and traces, including messaging semantic conventions, but targets signals rather than a queryable entity graph. OpenLineage [8] models dataset-level lineage for data pipelines; Black Fox is complementary, focusing on the operational topology and blast radius of the messaging substrate itself and interoperating with these standards at ingestion time.
Kafka tooling. Kafka [6] ships administrative metadata (brokers, topics, partitions, consumer groups); commercial control planes surface it in dashboards. Black Fox differs by persisting that metadata as a provenance-annotated RDF graph that can be queried with SPARQL and reasoned over, rather than rendered and discarded.
Prior work by the author. This system continues a trajectory from lightweight edge-intelligence semantics [10], through semantic data models for cross-domain integration (the Traffik Analysis Hub Ontology [12]), to semantics for edge-intelligence-enabled smart sensors in federated automotive diagnostics [11]. Black Fox applies the same interoperability-first philosophy to the operational plane that connects those systems.
4. System architecture
Black Fox is a small FastAPI service around two pluggable stores and a static browser client. Collectors and client SDKs submit observations over an HTTP/JSON contract; the ingestion service projects them into an RDF named graph and a metric store; a query facade exposes topology, telemetry, a deterministic natural-language router and a guarded SPARQL endpoint. Figure 1 shows the data flow.
Three storage tiers share one code path and one image, so a demo and a production deployment differ only by configuration:
| Mode | RDF | Metrics | Intended use |
|---|---|---|---|
demo | RDFLib (embedded) | SQLite | laptop, static hosting + container backend |
hybrid | Apache Jena Fuseki | SQLite | semantic integration testing |
full | Fuseki / TDB2 | Apache Cassandra | multi-node, production-oriented |
If an external store is unavailable at startup the service falls back to its embedded equivalents unless STRICT_EXTERNAL_STORES is set, so the same artefact degrades gracefully from a cluster to a laptop.
5. Ontology design
The ontology is intentionally modular—core, kafka, observability, provenance and security modules—so that adopters can extend one facet without touching the others. The core module defines the abstract bf:Resource and its observation reifications; kafka specialises it. All terms live under the https://blackfox.io/ontology/core# namespace (prefix bf:).
bf:KafkaCluster rdfs:subClassOf bf:Resource .
bf:Broker rdfs:subClassOf bf:Resource .
bf:Topic rdfs:subClassOf bf:Resource .
bf:ConsumerGroup rdfs:subClassOf bf:Resource .
bf:Connector rdfs:subClassOf bf:Application .
bf:producesTo a owl:ObjectProperty ; rdfs:domain bf:Application ; rdfs:range bf:Topic .
bf:consumesFrom a owl:ObjectProperty ; rdfs:domain bf:Application ; rdfs:range bf:Topic .
bf:belongsToCluster a owl:ObjectProperty ; rdfs:range bf:KafkaCluster .
bf:leads a owl:ObjectProperty ; rdfs:domain bf:Topic ; rdfs:range bf:Broker .
5.1 Observation reification for provenance
Rather than asserting bare facts, Black Fox records who said what, when, and how sure they were. The core module defines bf:ResourceObservation and bf:RelationshipObservation; the provenance module aligns collectors and snapshots with PROV-O (bf:Collector rdfs:subClassOf prov:SoftwareAgent, bf:ConfigurationSnapshot rdfs:subClassOf prov:Entity, bf:ChangeEvent rdfs:subClassOf prov:Activity) and adds temporal validity (bf:validFrom/bf:validTo) and configuration hashing. Each relationship observation carries a bf:confidence in [0,1] and a bf:evidenceSource, which is what makes principled multi-source fusion possible.
5.2 Validation with SHACL
Shapes constrain the graph so malformed ingestion is caught rather than silently stored. For example, a topic must have exactly one external identifier and belong to exactly one cluster, and a relationship observation's confidence must be a decimal in [0,1]:
bf:TopicShape a sh:NodeShape ;
sh:targetClass bf:Topic ;
sh:property [ sh:path bf:externalId ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ] ;
sh:property [ sh:path bf:belongsToCluster ; sh:minCount 1 ; sh:maxCount 1 ; sh:class bf:KafkaCluster ] .
bf:RelationshipObservationShape a sh:NodeShape ;
sh:targetClass bf:RelationshipObservation ;
sh:property [ sh:path bf:confidence ; sh:datatype xsd:decimal ;
sh:minInclusive 0 ; sh:maxInclusive 1 ] .
6. Ingestion & provenance pipeline
Collectors submit observations over a language-agnostic HTTP/JSON contract. A reference Python collector SDK (an abstract CollectorPlugin with Resource, Relationship and Observation value types) and a Kafka Admin collector are provided; additional language clients are straightforward because the contract is plain JSON. A single observation names a resource, optional typed attributes, relationships to other resources (each with confidence and evidence), and metric samples:
{
"tenantId": "demo", "environmentId": "prod",
"collectorType": "kafka-admin", "collectorInstance": "collector-eu-1",
"resource": { "type": "Topic", "externalId": "orders.v1", "label": "orders.v1" },
"attributes": { "partitionCount": 12, "replicationFactor": 3 },
"relationships": [
{ "type": "belongs_to_cluster",
"target": { "type": "KafkaCluster", "externalId": "production-eu" },
"confidence": 1.0, "evidenceSource": "Kafka Admin metadata" }
],
"metrics": [ { "name": "kafka.topic.bytes.in_per_second", "value": 1886000, "unit": "bytes/s" } ]
}
Ingestion mints deterministic IRIs from the tenant, environment, resource type and external identifier, so independent collectors that describe the same entity converge on the same node without coordination. Attributes become typed literals (boolean, integer, decimal, or JSON for structured values); metrics are routed to the metric store keyed by the entity IRI; and both a bf:ResourceObservation and, per relationship, a bf:RelationshipObservation are written, timestamped with prov:generatedAtTime. The relationship data is inserted into the current named graph as, in effect:
<.../resource/demo/prod/topic-.../orders.v1-...> bf:belongsToCluster <.../kafkacluster-.../production-eu-...> .
<obs/relationship/0> a bf:RelationshipObservation ;
bf:subject <.../orders.v1-...> ; bf:predicate bf:belongsToCluster ;
bf:object <.../production-eu-...> ;
bf:confidence "1.0"^^xsd:decimal ; bf:evidenceSource "Kafka Admin metadata" ;
bf:observedAt "2026-08-01T12:00:00Z"^^xsd:dateTime .
7. Querying: deterministic router & guarded SPARQL
7.1 An auditable, LLM-optional router
Natural-language convenience should not require surrendering determinism or auditability. Black Fox ships a small router that normalises the question, extracts a topic mention (back-tick, quote or dotted-name heuristics) and maps a bounded intent set—topology, consumer lag, anomalies and topic flow / blast radius—onto concrete graph and telemetry operations, returning a structured {intent, answer, data} triple. The same question always yields the same routed operation, so results are reproducible and reviewable; an LLM, if used at all, sits after this deterministic core, never in place of it.
7.2 Guarded SPARQL
Authorised clients may issue SPARQL directly, but the facade admits only read queries: it strips comments, requires the query form to be SELECT or ASK, rejects update and management keywords (INSERT, DELETE, LOAD, CLEAR, CREATE, DROP, COPY, MOVE, ADD) and blocks SERVICE to prevent federation-based exfiltration, subject to a maximum length. The transitive blast-radius query that answers "what breaks if orders.v1 fails?" is a single property path:
PREFIX bf: <https://blackfox.io/ontology/core#>
SELECT DISTINCT ?affected ?type ?label WHERE {
GRAPH <https://blackfox.io/graph/demo/prod/current> {
<https://blackfox.io/resource/demo/prod/topic-orders-v1>
(^bf:producesTo|^bf:consumesFrom|bf:dependsOn|^bf:dependsOn|bf:leads|bf:hostedOn)+ ?affected .
?affected a ?type . OPTIONAL { ?affected rdfs:label ?label }
}
} ORDER BY ?type ?label
8. Experimental evaluation
All experiments run in-process against the embedded RDFLib + SQLite backend—the zero-infrastructure mode—so they are reproducible on any laptop with the accompanying notebook (paper/experiments.ipynb). Persistence to disk is disabled during timing so we measure graph operations rather than serialisation I/O. Absolute numbers reflect a single unoptimised embedded store; the trends are the contribution.
8.1 E1 — Ingestion throughput and triple amplification
Ingesting 400 topic observations (each with one relationship and one metric) grows the current named graph linearly at ≈20.0 triples per observation (90 → 8,093 triples), at a sustained in-memory rate of ≈31 observations/second (32.7 ms/observation) in single-threaded embedded mode. The bounded, predictable amplification (Figure 2) confirms that the reification model does not blow up graph size; production throughput is higher with Fuseki and batched writes.
8.2 E2 — Transitive blast-radius latency vs graph size
We build a dependency chain of topics (each depends_on the next, each with a producer and a consumer) and run the transitive blast-radius property path from the head topic as the graph grows. The impacted set scales with the estate (30 → 480 resources) while median latency stays interactive, rising from 13.9 ms at 705 triples to 36.7 ms at ≈10,000 triples (Figure 3, Table 1). A single deterministic property path thus answers estate-wide impact questions in tens of milliseconds on a laptop.
| Chain length | Graph triples | Blast-radius nodes | Median latency (ms) |
|---|---|---|---|
| 10 | 705 | 30 | 13.94 |
| 20 | 1,325 | 60 | 14.07 |
| 40 | 2,565 | 120 | 15.82 |
| 80 | 5,045 | 240 | 23.74 |
| 160 | 10,005 | 480 | 36.69 |
8.3 E3 — Deterministic-router overhead
Because the router is a bounded set of string tests over the question, its decision cost is independent of graph size. Comparing each router call to the operation it dispatches to (Table 2, Figure 4), the routing overhead is 0.017 ms for the cheap anomalies intent and within measurement noise (≈±5 ms) for graph-bound intents whose latency is dominated by the underlying operation. In other words, the deterministic natural-language layer is effectively free—and, unlike an LLM translator, it is constant-cost, reproducible and auditable.
| Intent | Underlying op | Router (end-to-end) | Routing overhead |
|---|---|---|---|
| topology | 63.9 | 61.1 | within noise |
| topic flow | 59.1 | 63.9 | +4.8 |
| anomalies | 0.153 | 0.170 | +0.017 |
9. Deployment & reproducibility
The service and static UI are packaged in one container that serves both from a single port, and run unchanged on a laptop, a Hugging Face Docker Space, or AWS App Runner / ECS; a Docker Compose profile brings up Apache Jena Fuseki and Apache Cassandra for the full stack. The browser client is dependency-free and falls back to bundled sample data when no backend is reachable, so the topology view is never blank. The evaluation in §8 is fully reproducible: jupyter nbconvert --to notebook --execute paper/experiments.ipynb regenerates every figure and the machine-readable results.json cited above. Unit, API, ingestion and SPARQL test suites accompany the implementation.
10. Discussion & limitations
Lightweight semantics as a design stance. Black Fox deliberately keeps the fast path out of RDF and reasons over a compact, provenance-annotated graph. This keeps queries interactive (§8) at the cost of not modelling every telemetry point as a triple—a trade the author regards as essential for operational adoption.
Determinism over generativity. By routing bounded intents deterministically and guarding SPARQL, the system favours reproducibility and auditability over open-ended generation. This is a limitation (the router answers a fixed intent set) and a feature (answers are explainable and safe to automate).
Limitations. Absolute performance reflects an unoptimised embedded store; the router's intent set is small; SHACL validation is defined but not yet enforced on every write path; and confidence fusion policy is represented but not yet a first-class resolver. These are the subject of ongoing work.
11. Conclusion & future work
Black Fox shows that a standards-based, provenance-first knowledge graph is a practical operational layer for Apache Kafka: it answers relational questions—ownership, flow, blast radius—in tens of milliseconds on a laptop, keeps telemetry where it belongs, and stays deterministic and auditable. Future work follows the project roadmap: OpenTelemetry messaging-convention and OpenLineage/OpenMetadata interoperability, Kubernetes workload reconciliation, temporal expiry with source-confidence fusion, retention-exhaustion forecasting and change-to-incident correlation, and a signed, isolated plugin runtime with an evidence-backed query planner.
References
- R. Cyganiak, D. Wood, M. Lanthaler. RDF 1.1 Concepts and Abstract Syntax. W3C Recommendation, 2014.
- S. Harris, A. Seaborne. SPARQL 1.1 Query Language. W3C Recommendation, 2013.
- H. Knublauch, D. Kontokostas. Shapes Constraint Language (SHACL). W3C Recommendation, 2017.
- T. Lebo, S. Sahoo, D. McGuinness. PROV-O: The PROV Ontology. W3C Recommendation, 2013.
- W3C OWL Working Group. OWL 2 Web Ontology Language. W3C Recommendation, 2012.
- J. Kreps, N. Narkhede, J. Rao. Kafka: a Distributed Messaging System for Log Processing. Proc. NetDB, 2011.
- OpenTelemetry Authors. OpenTelemetry Specification & Semantic Conventions. Cloud Native Computing Foundation, 2019–.
- OpenLineage Authors. OpenLineage Specification. LF AI & Data Foundation, 2021–.
- N. Noy, Y. Gao, A. Jain, A. Narayanan, A. Patterson, J. Taylor. Industry-scale Knowledge Graphs: Lessons and Challenges. Communications of the ACM 62(8), 2019.
- E. Jordan, M. Serrano, A. Zappa. Edge Intelligence: a light in the fog, a review paper. 2021.
- E. Jordan, M. Serrano, A. Gyrard, D. Wollman, et al. Semantics for Enhancing Communications- and Edge-Intelligence-enabled Smart Sensors: A Practical Use Case in Federated Automotive Diagnostics. 2024.
- E. Jordan. Traffik Analysis Hub Ontology (TAHO). INFINITECH H2020, 2022.
© 2026 Eoin Jordan. Black Fox is dual-licensed under AGPL-3.0 and a commercial license. To cite this work, see CITATION.cff in the repository. Reproduce the experiments with the accompanying notebook paper/experiments.ipynb.