PROV-O made demonstrable: SPARQL example script + jsonld export format - #13
Merged
Conversation
- spec/provo_sparql_demo.py: adjudicates the two span-grounded starters live, adds the committed review-0001 correction case, expands through the repo's own contexts offline, and answers three auditor questions in standard SPARQL (document lineage, human-fact reliance with the supersession chain, rule-pack-version-as-plan). rdflib deliberately stays out of the dependency tree — invoked via uv run --with, standing in for whatever RDF tooling an organization already runs. The header documents the grounding caveat found while building it: attestation- grounded facts (the whole synthetic corpus) correctly return no document-lineage rows. - /api/report grows format=jsonld: the adjudicated receipt wrapped by duly_kernel.provo.as_jsonld, served as application/ld+json. Endpoint only, deliberately no UI button: a demo viewer wants the receipt; a lineage stack wants an HTTP path, not a button. - spec/prov-o.md gains a 'Seeing it work' section covering both paths. 398 tests passing (2 new); 351 golden receipts replay; spec validation incl. contexts green; demo script executed and outputs verified. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Follow-up to #11 answering "is it demoable?" — with the deliberate scope decision discussed in review: script plus query param, no UI button. A demo viewer wants the receipt; a lineage stack wants an HTTP path. The export panel stays three buttons.
What's here
spec/provo_sparql_demo.py— runuv run --with rdflib python spec/provo_sparql_demo.pyfrom the repo root and watch three auditor questions get answered in standard SPARQL over live-adjudicated receipts plus the committed human-correction case:review-0001, its reviewer, and the superseded machine fact's id as a graph edgeprov:Planrdflibdeliberately stays out of the dependency tree (--withat invocation) — it stands in for "whatever RDF tooling your organization already runs," which is the whole pitch. Context resolution is offline againstspec/contexts/; network fetches are refused.The script header documents a caveat discovered while building it: the synthetic golden corpus is attestation-grounded (those cases have no documents), so document-lineage queries correctly return nothing over it — span-grounded facts (the starters, any real deployment) are where Q1 lights up. Query silence there is correct behavior, and now it's written down so nobody repeats the twenty confused minutes it cost.
GET /api/report?format=jsonld— the existing export endpoint (md/pdf) grows a third format: the adjudicated receipt wrapped byas_jsonld, served asapplication/ld+jsonwith a download disposition. Two new tests cover the happy path (context/id/hash coherence with the stored receipt riding inside unchanged) and format rejection.spec/prov-o.md— a "Seeing it work" section pointing at both paths and stating the no-button rationale.Verification
398 tests passing (2 new); 351 golden receipts replay byte-for-byte; spec validation including contexts green; the demo script executed with outputs verified before its claims were written down.
🤖 Generated with Claude Code