Queries KG-Registry Parquet files to find downstream usages of a resource, combining reverse provenance and recorded usages.
Ships in kg-registry-discovery. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Determine everywhere a given resource is used, from what KG-Registry records, using the live hosted data.
httpfs extension and internet access. Portable option:
uv run --with duckdb --no-project python - <<'PY'
... query ...
PY
(Or pip install duckdb + python, or the duckdb CLI with INSTALL httpfs; LOAD httpfs;.)Setup block:
import duckdb, json
con = duckdb.connect()
con.execute("INSTALL httpfs; LOAD httpfs;")
BASE = "https://kghub.org/kg-registry/registry/parquet"
R = f"read_parquet('{BASE}/resources.parquet')" # has raw_data JSON per resource
P = f"read_parquet('{BASE}/resource_products.parquet')" # resource_id, product_id, ...
KG-Registry records downstream use in two distinct places inside raw_data. Check both.
original_source or secondary_source. This is the authoritative "X is built from " signal.usages field — curator-recorded real-world uses, each with label, description, type (actual / experimental / theoretical / other), optional users, and optional publications.uniprot. (Find it with search-resources if only a topic/name is known.)Gather the target's own product ids (consumers may reference any of them).
target = 'uniprot'
pids = [r[0] for r in con.execute(f"SELECT product_id FROM {P} WHERE resource_id = ?", [target]).fetchall()]
needles = [target] + pids
Reverse-provenance sweep: find every resource whose JSON names the target as a source.
# the quotes make this an EXACT id match — "source": "uniprot" never matches "uniprotkb"
import re
rows = con.execute(f"SELECT id, name, category, activity_status, raw_data FROM {R}").fetchall()
consumers = []
for rid, name, cat, status, raw in rows:
if rid == target: # skip the target's own page
continue
rec = json.loads(raw)
for prod in rec.get('products', []):
for slot in ('original_source', 'secondary_source'):
for a in (prod.get(slot) or []):
if a.get('source') in needles:
consumers.append({'id': rid, 'name': name, 'category': cat,
'status': status, 'via_product': prod['id'],
'slot': slot, 'relation': a.get('relation_type')})
SELECT id FROM {R} WHERE raw_data LIKE '%"source": "uniprot"%' — the surrounding quotes anchor the id exactly. Confirm hits by parsing, since JSON whitespace can vary.Read the target's own recorded usages.
rec = json.loads(con.execute(f"SELECT raw_data FROM {R} WHERE id = ?", [target]).fetchone()[0])
usages = rec.get('usages', []) # each has label, description, type, users?, publications?
type: actual is a real deployment; experimental/theoretical are weaker claims — preserve the distinction.Report.
id — name (category, status) — relation — which product consumes it. Strongest signal.usages field): each with its type and users/publications.| Task | How |
|---|---|
| Target's product ids | SELECT product_id FROM {P} WHERE resource_id = ? |
| Reverse-provenance prefilter | SELECT id FROM {R} WHERE raw_data LIKE '%"source": "<id>"%' (quotes anchor the id) |
| Authoritative reverse check | parse each raw_data, match products[*].original_source/secondary_source[*].source |
| Recorded usages | json.loads(raw_data)['usages'] on the target |
| Enrich a consumer | the name, category, activity_status columns of resources.parquet |
usages field, or vice versa.relation_type and usage type, which tell the user whether a use is a hard dependency, a soft influence, or an experimental claim.uniprot also catches uniprotkb. Anchor on "source": "uniprot".trace-upstream-sources answers the reverse question (a resource's inputs).search-resources locates the target id from a topic or name.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/find-similar-resourcesUse when asked to find KG-Registry resources similar to a given one — alternatives, related graphs, or near-duplicates. Reads the live hosted KG-Registry Parquet files over HTTP (no local clone needed), combining structured signals (shared domains, taxa, category, node/edge scale, shared upstream sources) with softer heuristics (description similarity and overlapping publication authors) into a ranked shortlist./search-resourcesUse when asked to find KG-Registry resources about a topic, subject area, or domain (e.g. "everything about RNA interactions", "what proteomics knowledge graphs are there", "find resources mentioning Reactome"). Queries the live hosted KG-Registry Parquet files over HTTP — no local clone needed — mapping a free-text topic to the registry's domain vocabulary plus keyword search./trace-upstream-sources/kg-registry-discovery:find-downstream-usagesfrom kg-registry-discovery
npx claudepluginhub knowledge-graph-hub/kg-registry --plugin kg-registry-discoveryOther plugins' skills for the same job