Extract knowledge assertions from tabular data into NCATS Translator-compliant KGX NDJSON — declaratively, with entity resolution built in and optional quality control.
Tablassert turns biomedical spreadsheets (Excel, CSV, TSV) into knowledge graphs ready for NCATS Translator. Declare how your columns map to subject–predicate–object statements in YAML; Tablassert resolves free text to standard CURIEs, attaches provenance and statistical annotations, and emits KGX-compliant nodes and edges.
Full Documentation — installation guides, tutorial, configuration reference, and API docs.
pip install tablassertGiven a CSV of gene–disease associations with p-values and sample sizes, declare the mapping in a
table config (table.yaml):
template:
source:
kind: text
local: ./gene-disease.csv
url: https://example.com/data.csv
row_slice: [1, auto]
delimiter: ","
statement:
subject: { method: column, encoding: A, prioritize: [Gene] }
predicate: associated_with
object: { method: column, encoding: B, prioritize: [Disease] }
provenance: { repo: PMID, publication: "12345678" }
annotations:
- { annotation: p_value, method: column, encoding: C }
- { annotation: supporting_study_size, method: column, encoding: D }Wrap it in a graph config (graph.yaml) pointing at your fullmap entity-resolution database:
name: MY_KG
version: 1.0.0
description: Gene–disease associations extracted from tabular sources.
tables:
- ./table.yaml
fullmap: /path/to/fullmapBuild the knowledge graph:
tablassert build-kg graph.yamlOutput is one JSON object per line — nodes with Biolink categories, edges with annotations:
{"id":"HGNC:11998","name":"TP53","category":["biolink:Gene"],"taxon":"NCBITaxon:9606"}
{"id":"MONDO:0008903","name":"lung cancer","category":["biolink:Disease"]}{"subject":"HGNC:11998","predicate":"biolink:associated_with","object":"MONDO:0008903","p_value":"1.0000e-03","supporting_study_size":"450"}See the Tutorial for the full walkthrough.
- Declarative YAML configuration — define data transformations without writing code
- Built-in entity resolution — map free text to genes, diseases, and chemicals with standard CURIEs, taxonomic filtering, and provenance, backed by an embedded redb database
- Optional quality control — a three-stage audit (exact → fuzzy → BioBERT embeddings) flags low-confidence mappings
- KGX compliance — emits NCATS Translator-compatible node/edge NDJSON with Biolink categories and predicates
- Autonomous agent —
tablassert agentderives, builds, and refines configs for whole papers - Performance & reproducibility — lazy Polars pipelines and a deterministic UV-based development environment
pip install tablassertOr with uv: uv tool install tablassert. The base install builds knowledge graphs from
CSV/TSV/Excel sources; optional extras add runtime and pipeline capabilities:
| Extra | Adds | Install |
|---|---|---|
rt |
CPU-compatible Polars runtime | pip install "tablassert[rt]" |
qc |
three-stage QC audit (exact → fuzzy → BioBERT embeddings) | pip install "tablassert[qc]" |
agent |
autonomous agent (smolagents, litellm, PDF context) | pip install "tablassert[agent]" |
optimize |
GEPA prompt optimization for agent --optimize (dspy) |
pip install "tablassert[optimize]" |
QC is opt-in at build time (build-kg --qc). See the
Installation guide for the full matrix and the
CLI Reference for every flag.
from pathlib import Path
from tablassert.lib import resolve_many
results = resolve_many(
col="gene",
entities=["TP53", "BRCA1"],
fullmap=Path("/path/to/fullmap"),
taxon="9606",
)
# [{"original_gene": "TP53", "gene": "HGNC:11998", "gene_name": "TP53", ...}, ...]Point resolve_many() at a fullmap database to resolve any iterable of entity strings to CURIEs —
no LazyFrame setup or NLP preprocessing required. See the
Batch Resolution API for the full reference.
- Installation — install methods, extras, and development setup
- Tutorial — step-by-step example with synthetic data
- CLI Reference — complete command-line flag reference
- Use Case Gallery — real-world configuration patterns
- Configuration — graph and table configuration reference
- Agent — the autonomous agent pipeline
- API Reference — core functions documentation
uv sync --group dev --extra qc
uv run maturin develop --manifest-path rust/Cargo.toml
make checkSee CONTRIBUTING.md for the full development loop, quality gates, and pull request guidelines.
If you use Tablassert, please cite it as described in CITATION.cff. The approach is described in:
Skye Lane Goetz, Alex K. Glen, and Gwênlyn Glusman. “MicrobiomeKG: bridging microbiome research and host health through knowledge graphs.” Frontiers in Systems Biology 5 (2025). doi:10.3389/fsysb.2025.1544432
- Skye Lane Goetz — Institute for Systems Biology
- Gwênlyn Glusman — Institute for Systems Biology
- Jared C. Roach — Institute for Systems Biology