Architecture¶
Design objective¶
Black Fox separates semantic state from operational telemetry:
collectors (Kafka Admin today)
|
v
observations over HTTP
|
+----------+----------+
| |
v v
RDF materialisation metric writer
| |
RDFLib or Fuseki SQLite or Cassandra
| |
+----------+----------+
|
v
FastAPI query facade
|
REST / SPARQL / static web application
RDF represents identity and relationships. The metric store holds dense, append-oriented data that is read by known entity and time access paths. The API composes both and does not push arbitrary SPARQL joins into the metric store.
Canonical observation flow¶
- A collector discovers a fact from an authoritative or inferred source.
- It submits a normalised observation.
- The ingestion service creates stable resource IRIs.
- Resource and relationship assertions are written to the current RDF named graph.
- Provenance nodes record the collector, the time, the confidence and the evidence source.
- Metric samples are written to the metric store.
- The query facade reads graph topology and bounded telemetry separately.
Collectors do not own the canonical graph. This leaves room for reconciliation logic that compares sources, expires relationships and applies authority rules. None of that logic exists yet.
Named graphs¶
The service writes two named graphs:
The embedded mode loads the ontology modules into the ontology graph and the sample resources into the current graph. Two more names are reserved for later work and are not written yet:
https://blackfox.io/graph/{tenant}/{environment}/source/{collector}
https://blackfox.io/graph/{tenant}/{environment}/snapshot/{timestamp}
Query safety¶
The public SPARQL endpoint accepts only SELECT and ASK. It rejects update
keywords, SERVICE, FROM and FROM NAMED. This is a keyword guard. It is
not a SPARQL cost-control system. Production work should add:
- authenticated tenant graph selection;
- parser-based algebra inspection;
- timeouts and result caps;
- property-path depth controls;
- query accounting;
- direct Fuseki network isolation.
Temporal model¶
The service records observations and timestamps but does not expire canonical assertions. A temporal materialiser would need to maintain:
- the current named graph;
- source evidence graphs;
- valid-from and valid-to values for reified relationship observations;
- change events generated from snapshot diffs;
- configuration history and raw observation retention in Cassandra.
Extension points¶
RdfRepository: RDFLib and Fuseki adapters.MetricRepository: SQLite and Cassandra adapters.- Observation API: the language-neutral collector boundary.
- Plugin SDK: Python dataclasses for the observation contract. There is no plugin loader or isolated runtime yet.