Skip to content

Ontology Builder

Build ontology graphs from structured OBO files (deterministic) or from any document using LLM extraction.

Subcommands

Command Mode What it does
ontology status Show available OBO files and export status
ontology export Structured Parse OBO files → JSONL
ontology build Structured Parse OBO files → Neo4j
ontology extract LLM Extract ontology from any document

Supported Ontologies (OBO)

Ontology ID Node Label Size
MONDO mondo Disease ~49 MB
Disease Ontology disease_ontology Disease ~7 MB
EFO efo Disease ~84 MB
Gene Ontology gene_ontology GeneOntologyTerm ~31 MB

Quick Start

# 1. Download ontology files
bioingest download gene_ontology disease_ontology mondo efo

# 2. Check what's available
bioingest ontology status

# 3. Build the graph
bioingest ontology build --uri bolt://localhost:7687 --user neo4j --password secret

What Gets Created

Nodes

  • (:Disease:Entity {id, name, definition, synonyms, xrefs, source})
  • (:GeneOntologyTerm:Entity {id, name, definition, ...})
  • (:OntologyVersion {version_id, timestamp, node_count, sources})

Relationships

  • (:Disease)-[:IS_A]->(:Disease) — hierarchy
  • (:Disease)-[:XREF]->(:Disease) — cross-references (MONDO ↔ DOID ↔ EFO)
  • (:GeneOntologyTerm)-[:PART_OF]->(:GeneOntologyTerm) — structure

Cross-Referencing

When multiple ontologies are parsed together, cross-references are automatically resolved:

graph LR
    M[MONDO:0000002<br/>cardiovascular disease] -->|XREF| D[DOID:1287<br/>cardiovascular system disease]
    M -->|XREF| E[EFO:0000319<br/>cardiovascular disease]
    D -->|XREF| M

See OBO Parsing and LLM Extraction for details.