Skip to content

Commit 1788c6f

Browse files
committed
brainkb skill: temporal/provenance querying — two clocks
Distinguish transaction/ingestion time (PROV-O: when/who added X, via delta history + delta graphs) from domain/valid time (when the real-world event occurred, a property in the data). Tell sessions to pick the right clock and not substitute one for the other.
1 parent 86dfbf9 commit 1788c6f

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

skills/brainkb_skills/SKILL.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,33 @@ password unprompted:**
251251
- Exactly what a job added: `brainkb_delta(job_id)`.
252252
- Compare two ingests: `brainkb_delta_compare(job_id_a, job_id_b)`.
253253

254+
#### Temporal & provenance querying — mind the TWO clocks
255+
There are two different "when"s. Pick the right one for the question, and say
256+
which you're answering:
257+
258+
1. **Transaction / ingestion time — "when was X *added/asserted*, and by whom?"**
259+
This is what the PROV-O layer records. Every ingest is a `prov:Activity` with
260+
`prov:startedAtTime`/`endedAtTime`, a `prov:Agent` (`prov:wasAssociatedWith`),
261+
and an `IngestionDelta` (`prov:generatedAtTime` + a `deltaGraph` holding the
262+
**exact** triples that job added). To answer "when/who added X":
263+
- `brainkb_delta_history(graph_iri)` → every change to that graph with its
264+
**timestamp** + job, newest first;
265+
- find the delta whose `deltaGraph` contains X, then `brainkb_delta(job_id)`
266+
for the exact triples and `brainkb_provenance_job(job_id)` for the agent/time.
267+
Use this for audit/"who put this here"/"what changed since <date>" questions.
268+
269+
2. **Domain / valid time — "when did X *actually happen* in the real world?"**
270+
PROV timestamps do NOT tell you this. A donor's birth date, when an experiment
271+
ran, a sample's collection date — those are **properties in the domain data**,
272+
not provenance. Answer them by querying that property in the graph (e.g.
273+
`brainkb_search`, or `brainkb_sparql` on the domain predicate), NOT via delta
274+
history.
275+
276+
Don't conflate them: "when was this record added" (clock 1) ≠ "when did the event
277+
occur" (clock 2). If the user's "when X…" is ambiguous, ask which they mean, or
278+
state which clock your answer used. Ingestion provenance can't substitute for a
279+
missing domain timestamp, and vice versa.
280+
254281
### 7. Share publicly / manage a workspace
255282
- Publish: `brainkb_set_space_visibility(slug, "public")` (owner/manager). Warn that
256283
a public space is readable by **anyone, including unauthenticated clients**.

0 commit comments

Comments
 (0)