Finds KG-Registry resources similar to a given one by combining structured metadata signals (domains, taxa, category, scale) with description and author heuristics. Reads live Parquet files via DuckDB.
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.
Find resources similar to a given resource, blending KG-Registry's structured metadata with text and citation heuristics, 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')" # raw_data JSON has products, usages, publications
D = f"read_parquet('{BASE}/resource_domains.parquet')" # resource_id, domain
T = f"read_parquet('{BASE}/resource_taxa.parquet')" # resource_id, taxon
def record(rid):
row = con.execute(f"SELECT raw_data FROM {R} WHERE id = ?", [rid]).fetchone()
return json.loads(row[0]) if row else None
Combine several — no single one is sufficient. Structured signals are cheap and narrow the field; the heuristics rank what is left.
Structured (from metadata):
domains (strongest cheap signal) — resource_domains.parquet.taxon (same organisms) — resource_taxa.parquet.category (usually you want like-for-like).node_count/edge_count on graph products, found in raw_data.products[*].source ids are closely related (the provenance from trace-upstream-sources).Heuristic (judgment-based):
description fields and judge topical overlap, not just shared words.raw_data.publications[*].authors. Shared names often mean the same group, a related or successor resource.kg-microbe.category (default: yes).Build the seed fingerprint.
seed = 'kg-microbe'
rec = record(seed)
s_domains = {r[0] for r in con.execute(f"SELECT domain FROM {D} WHERE resource_id=?", [seed]).fetchall()}
s_taxa = {r[0] for r in con.execute(f"SELECT taxon FROM {T} WHERE resource_id=?", [seed]).fetchall()}
s_category = rec['category']
s_sources = {a['source'] for p in rec.get('products', [])
for slot in ('original_source','secondary_source')
for a in (p.get(slot) or []) if a['source'] != seed}
s_authors = {au for pub in rec.get('publications', []) for au in pub.get('authors', [])}
s_desc = rec.get('description', '')
Generate candidates with the cheap structured filters.
cands = {r[0] for r in con.execute(
f"SELECT DISTINCT resource_id FROM {D} WHERE domain IN ({','.join('?'*len(s_domains))})",
list(s_domains)).fetchall()}
cands |= {r[0] for r in con.execute(
f"SELECT DISTINCT resource_id FROM {T} WHERE taxon IN ({','.join('?'*len(s_taxa))})",
list(s_taxa)).fetchall()} if s_taxa else set()
cands.discard(seed)
s_domains is empty, fall back to a keyword candidate set via search-resources.Score each candidate on the structured signals.
for cid in cands:
crec = record(cid)
c_domains = {r[0] for r in con.execute(f"SELECT domain FROM {D} WHERE resource_id=?", [cid]).fetchall()}
c_taxa = {r[0] for r in con.execute(f"SELECT taxon FROM {T} WHERE resource_id=?", [cid]).fetchall()}
c_sources = {a['source'] for p in crec.get('products', [])
for slot in ('original_source','secondary_source')
for a in (p.get(slot) or []) if a['source'] != cid}
shared_domains = s_domains & c_domains
shared_taxa = s_taxa & c_taxa
shared_sources = s_sources & c_sources
same_category = crec['category'] == s_category
# graph scale: pull node_count/edge_count from crec['products'][*] and compare order of magnitude
Apply the heuristics to the surviving shortlist.
s_desc and each candidate's description and rate topical closeness (clearly-the-same / overlapping / tangential). Use meaning, not keyword overlap alone.c_authors = {au for pub in crec.get('publications', []) for au in pub.get('authors', [])}; any name in s_authors & c_authors is a strong relatedness signal — surface it explicitly.Rank and explain.
Report.
id — name (category) — one-line "why similar" naming the concrete signals (e.g. "shares domains genomics+proteomics, both built from uniprot, overlapping authors").| Task | How |
|---|---|
| Seed/candidate domains | SELECT domain FROM {D} WHERE resource_id=? |
| Seed/candidate taxa | SELECT taxon FROM {T} WHERE resource_id=? |
| Candidates by shared domain | SELECT DISTINCT resource_id FROM {D} WHERE domain IN (...) |
| Sources / authors / scale | walk record(id)['products' / 'publications'] |
| Compare descriptions | read both description fields and judge meaning |
search-resources finds candidates by topic when structured filters are too narrow.trace-upstream-sources supplies the shared-source comparison used here.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
kg-registry, similarity-search, knowledge-graphs, duckdb, parquet
/kg-registry-discovery:find-similar-resourcesfrom kg-registry-discovery
npx claudepluginhub knowledge-graph-hub/kg-registry --plugin kg-registry-discovery4 skills in this plugin
/find-downstream-usagesUse when asked everywhere a given resource is used or consumed downstream — which knowledge graphs, aggregators, or products draw on it, and any recorded real-world uses — based on what KG-Registry records. Reads the live hosted KG-Registry Parquet files over HTTP (no local clone needed), combining reverse provenance (other resources naming this one as a source) with the resource's own usages field./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-sourcesUse when asked what upstream data sources a given resource (usually a knowledge graph) is built from — its inputs, dependencies, or provenance — based on what KG-Registry records. Reads the live hosted KG-Registry Parquet files over HTTP (no local clone needed), walks each product's original_source and secondary_source, resolves the referenced ids, and optionally recurses to build the full upstream tree.Other plugins' skills for the same job