MicrobeKG / README.md
ZachGu's picture
Add MicrobeKG audited-20260928 Parquet tables and dataset card
424edda verified
|
Raw History Blame Contribute Delete
7.17 kB
---
pretty_name: MicrobeKG
language:
- en
license: other
license_name: microbekg-source-specific-terms
license_link: LICENSE
size_categories:
- 1M<n<10M
tags:
- knowledge-graph
- microbiome
- biology
- graph-machine-learning
- link-prediction
configs:
- config_name: edges
default: true
data_files:
- split: full
path: data/edges/*.parquet
- config_name: nodes
data_files:
- split: full
path: data/nodes/*.parquet
---
# MicrobeKG
MicrobeKG connects microorganisms, metabolites, substrates, diseases, host genes,
and interventions in a heterogeneous knowledge graph. Records retain source and
evidence fields for graph querying, resource analysis, and hypothesis generation.
This package contains the **audited-20260928** graph: **3,647,004 assertion rows**,
**67,485 typed nodes**, **25 relation labels**, and **31 typed relation patterns**.
It is a lossless Parquet export prepared on 2026-09-29.
**Data terms:** the graph incorporates third-party sources with different terms.
The `other` label refers to [source-specific terms](LICENSE), not a blanket open
license. See [SOURCE_TERMS.md](SOURCE_TERMS.md) for source attribution, current
contribution counts, review dates, and unresolved redistribution permissions.
The software repository's MIT license does not license these third-party data.
## Contents and loading
| Configuration | Split | Rows | Files |
|---|---|---:|---|
| `edges` | `full` | 3,647,004 | 8 Parquet shards |
| `nodes` | `full` | 67,485 | 1 Parquet file |
`full` means the complete table. It is not a training or evaluation partition.
Shards preserve the original row order and contain at most 500,000 rows. The files
use Zstandard compression and row groups of at most 65,536 rows.
```python
from datasets import load_dataset
repo_id = "YOUR_HF_USERNAME/MicrobeKG" # replace with the actual dataset repository
edges = load_dataset(repo_id, "edges", split="full")
nodes = load_dataset(repo_id, "nodes", split="full")
# Read progressively without materializing the entire table.
edge_stream = load_dataset(repo_id, "edges", split="full", streaming=True)
print(next(iter(edge_stream)))
```
For a private repository, first run `hf auth login` with an account that has access.
For reproducible work, pass `revision="<dataset-commit-sha>"` to `load_dataset`.
To use downloaded Parquet directly:
```python
import pyarrow.dataset as ds
edges = ds.dataset("data/edges", format="parquet")
subset = edges.to_table(
columns=["head_id", "relation", "tail_id", "source", "evidence"],
filter=(ds.field("head_type") == "microbe")
& (ds.field("tail_type") == "disease"),
)
```
## Schema
All columns are UTF-8 strings. Empty cells remain empty strings, and identifiers
retain their original prefixes and formatting. See [schema.json](schema.json).
| Table | Column | Meaning |
|---|---|---|
| edges | `head_id`, `head_type` | Identifier and type of the subject node |
| edges | `relation` | Directed relation label |
| edges | `tail_id`, `tail_type` | Identifier and type of the object node |
| edges | `confidence` | Source-specific score or label, retained verbatim; not a calibrated probability |
| edges | `species_source` | Source organism/context label, retained verbatim |
| edges | `source` | Source labels; multiple labels can be separated by `\|` |
| edges | `evidence` | Source evidence, identifiers, and provenance, retained verbatim |
| edges | `evidence_type` | Evidence-class labels, potentially combined with `\|` |
| nodes | `node_id` | Original canonical identifier |
| nodes | `node_type` | One of the six entity types below |
| nodes | `node_name` | Recorded display label; may be an identifier-derived label |
| nodes | `source_databases` | Source labels associated with the node |
**Node identity is `(node_type, node_id)`.** The same chemical identifier can occur
as both a substrate and a metabolite. Join edges to nodes using both the identifier
and type, rather than `node_id` alone. Evidence text may contain delimiters with
different meanings; it should not be interpreted as a single list of source labels.
| Node type | Count |
|---|---:|
| metabolite | 25,366 |
| host_gene | 19,907 |
| microbe | 15,821 |
| disease | 5,212 |
| substrate | 1,057 |
| intervention | 122 |
The microbe count includes taxonomic ranks and genome bins; it is not a species
count. The build audit flags identifier-derived display labels for 19,907 host
genes, 252 metabolites, and 14 substrates. These cells are populated, not missing;
the original labels and typed graph connections are retained without name imputation.
## Sources and preparation
The graph integrates 18 upstream source labels, including curated association
databases, metabolic resources, taxonomy/ontology resources, and literature-derived
records. `cross_source_conflict` is an additional derived label. Source-labelled
counts overlap when a row cites multiple sources and should not be summed as
distinct graph assertions. `Lit44` is a historical source identifier; this snapshot
contains retained assertions from 18 studies under that label.
The audited snapshot harmonizes typed identifiers and relation labels and preserves
evidence and disagreement records. This export does not change, filter, rescore,
or impute any graph field. Source TSV hashes, Parquet hashes, file sizes, and counts
are recorded in [manifest.json](manifest.json). Independently checked row equality,
typed endpoint integrity, and statistics are recorded in [validation.json](validation.json)
and [statistics.json](statistics.json).
## Scope and appropriate use
Use the graph for evidence-aware retrieval, graph exploration, and development of
research methods. Distinguish observed associations, computationally inferred
metabolic capabilities, curated biochemical records, and ontology relations.
Associations and graph paths alone do not establish causation or clinical efficacy.
Source coverage, research attention, organism resolution, and evidence density are
uneven; missing edges should not be assumed to be confirmed negative findings.
This package contains graph tables, not raw participant-level clinical records,
sequencing reads, upstream database dumps, model checkpoints, or benchmark splits.
Previously reported benchmark results use the frozen reference graph and splits;
they are not new measurements on this audited export. Define and document suitable
splits and leakage controls when evaluating methods on this snapshot.
## Attribution and related code
Code: [MicrobeKG-dataset_split_task](https://github.com/ZachGu-00/MicrobeKG-dataset_split_task).
The code repository documents the scope of its reference graph construction and
evaluation tools; this export is not a claim of complete upstream reconstruction.
When citing the resource, include **MicrobeKG, audited-20260928**, the actual
Hugging Face repository URL, and the immutable dataset commit used. Also acknowledge
the relevant original data providers listed in [SOURCE_TERMS.md](SOURCE_TERMS.md).
No DOI or publication identifier has been assigned by this packaging operation.
Questions about this package can be filed in the linked code repository's Issues.