Document what Ubergraph's SPARQL results actually contain#899
Open
gaurav wants to merge 2 commits into
Open
Conversation
src/datahandlers/obo.py filters Ubergraph results three times over with
prefix in ["http", "ro"] or prefix.startswith("t") or "#" in prefix
but nothing explained what each clause was for, and the check turns out to
be wrong. Record the findings against the 2026-06-30 download:
- bare IRIs reach obo.py because ubergraph.py falls back to the raw IRI
when Text.opt_to_curie() raises;
- blank nodes are `t` + digits, already recognised precisely by the
existing UberGraph.is_blank_node();
- Text.opt_to_curie() manufactures invalid CURIEs (`core#part:of`) from
fragment IRIs, which is where the "#" clause comes from;
- "ro" is a policy exclusion (RO is predicates, not entities), not a
syntax check -- and it is the reason the syntax half went unexamined.
Measured leaks: 8,762 `https:` rows (the filter tests "http"), 772 `RO:`
rows (it tests lowercase "ro"), and one `OBO:REL#:part:of` (the "#" lands
in the local part). Harmless today only because NodeFactory looks labels
up by CURIE and no compendium carries those prefixes.
Tracked in #898.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
docs/sources/README.md said "one directory per data source, named by the source's CURIE prefix", which has no answer for Ubergraph: it is a merged triplestore serving identifiers from ~200 prefixes and owns none of them. Reserve the all-caps directory name for real CURIE prefixes, so that an all-caps name always means "you can look this prefix up", and spell other sources in their own capitalisation (Ubergraph/, not UBERGRAPH/). Co-Authored-By: Claude Opus 4.8 <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.
Documentation only — no code changes, no effect on any build.
src/datahandlers/obo.pyfilters Ubergraph results three times over withNothing explained what each clause was for. Working that out against the 2026-06-30 download turned up that the check is also wrong, so this PR records the findings rather than leaving them in a comment thread. The fix itself is deliberately deferred to #898, because getting the exclusion list wrong either admits bad identifiers or silently drops good ones from the next build.
What the investigation found
The four clauses look like four instances of one check. They are two different kinds of check wearing one coat:
http,t…,#), a property of the Ubergraph/SPARQL boundary.rois the Relation Ontology: predicates, not entities), which belongs inconfig.yamlnext toubergraph_ontologies— a list that already containsRO.Because a policy exclusion was smuggled into a syntax check, the syntax half went unexamined. Measured leaks in
babel_downloads/common/ubergraph/labels:https://purl.brain-bican.org/…, ORCIDs, Wikidata, SSSOM"http", not"https"RO:0002213"positively regulates" and ~770 others"ro";opt_to_curie()emitsROOBO:REL#:part:of#lands in the local part, not the prefixsynonyms.jsonlleaks 1,331https:rows the same way. These are harmless today only becauseNodeFactorylooks labels up by CURIE and no compendium carries anhttpsorROprefix — they cost memory, not correctness. That is luck:TCDBis the only real prefix starting withtand it survives only because it is uppercase.Two details worth having written down:
UberGraph.is_blank_node()already exists and is stricter thanstartswith("t"), but is only used to decide whether to warn, so the blank node still flows out as a raw string and forcesobo.pyto filter again. And the#garbage is manufactured byText.opt_to_curie(), which splits OBO PURLs on/then_without validating the result — not by Ubergraph or by RDF.Naming
docs/sources/README.mdsaid "one directory per data source, named by the source's CURIE prefix", which has no answer for Ubergraph: it is a merged triplestore serving identifiers from ~200 prefixes and owns none of them. The second commit reserves the all-caps directory name for real CURIE prefixes — so an all-caps name always means "you can look this prefix up" — and spells other sources in their own capitalisation.Companion to #898, which carries the proposed design, the test plan, and the open research questions (notably: those 6,895
https://purl.brain-bican.org/taxonomy/…rows are real, labelled BICAN cell-type identifiers, and whether to drop or properly CURIE-ify them should be a choice rather than a side effect of a string comparison).🤖 Generated with Claude Code