Route Review RDF Through BrainKB Ingest and Disable Direct Oxigraph Push - #83
Merged
tekrajchhetri merged 1 commit intoAug 14, 2026
Merged
Conversation
…_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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
query_service, creating the proper job, delta, provenance, and user attribution.backfill_oxigraph_push.pynow fails clearly when direct push is disabled instead of reporting a successful no-op.This keeps each review in one governed, discoverable graph and avoids accidentally re-enabling the legacy path.