Skip to content

Route Review RDF Through BrainKB Ingest and Disable Direct Oxigraph Push - #83

Merged
tekrajchhetri merged 1 commit into
improve-ingestion-query-servicefrom
add-reviews-feature
Aug 14, 2026
Merged

Route Review RDF Through BrainKB Ingest and Disable Direct Oxigraph Push#83
tekrajchhetri merged 1 commit into
improve-ingestion-query-servicefrom
add-reviews-feature

Conversation

@tekrajchhetri

Copy link
Copy Markdown
Collaborator

Reviews were being pushed directly to Oxigraph over GSP, bypassing BrainKB’s normal ingest pipeline. This meant no ingest job, provenance, search indexing, or space ownership.

This PR makes the BrainKB ingest path the single source of truth:

  • Review TTL now goes through query_service, creating the proper job, delta, provenance, and user attribution.
  • Disables the direct Oxigraph path, which could create a duplicate shadow graph due to the trailing-slash difference in graph IRIs.
  • backfill_oxigraph_push.py now fails clearly when direct push is disabled instead of reporting a successful no-op.
  • Updates env-var documentation and module docstrings to point to the current ingest path.

This keeps each review in one governed, discoverable graph and avoids accidentally re-enabling the legacy path.

…_service instead

The push in oxigraph_push.py writes review RDF straight into Oxigraph over GSP.
It is the fastest way to get triples into the store and the worst way to get
them into BrainKB: no ingest job, no PROV-O provenance, no search-index row,
and the named graph belongs to no space, so nothing but an Admin SPARQL query
can see it. Reviews now reach BrainKB the way all other RDF does — the TTL
export goes through query_service, which records a job, a delta and a real user
as the agent.

Leaving both paths on gives every review two graphs rather than one. Review ids
are unique, so reviews never collide with each other; the problem is that the
two writers disagree about the IRI by a single character. _named_graph_for
returns prefix + review_id with no trailing slash, while the ingest path
registers and writes .../<review_id>/ — query_service normalises the registry
lookup (check_named_graph_exists appends a slash) but writes the IRI verbatim
(create_job(graph=named_graph_iri)). So the store ends up holding a governed
graph and an unregistered shadow copy, with search and provenance describing
only one of them. That is worse than either outcome alone.

backfill_oxigraph_push.py now refuses to run rather than reporting success
against a no-op: with the flag off, _make_config returns None for every review
and the script would have logged a clean backfill while nothing left the
process. Worst possible outcome for a one-shot repair tool.

The env-var table and module docstrings say which path is current, so the next
person reading either file finds the ingest route instead of re-enabling this
one.
@tekrajchhetri
tekrajchhetri merged commit 3ae9a82 into improve-ingestion-query-service Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant