EDAM Ontology Python Package

1.25.3 · active · verified Fri Apr 17

The edam-ontology library provides versioned, Python-packaged data for the EDAM ontology (http://edamontology.org/). It offers convenient access to the ontology as an `owlready2` World object, enabling programmatic querying and navigation. The current version is 1.25.3, with releases typically tied to new EDAM ontology versions and Python compatibility updates.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import the EDAM ontology and its version, and then perform a basic query to count entities and access a specific class using the `owlready2` API.

from edam_ontology import EDAM, EDAM_ONTOLOGY_VERSION

print(f"EDAM Ontology version: {EDAM_ONTOLOGY_VERSION}")

# EDAM is an OWLReady2 World object that can be queried.
# For example, count all individuals (entities) in the ontology:
num_entities = len(EDAM.individuals())
print(f"Number of EDAM entities: {num_entities}")

# Accessing a specific class (e.g., 'data'):
data_class = EDAM.data
if data_class:
    print(f"Found EDAM class: {data_class.label.first()}")
else:
    print("EDAM.data class not found.")

view raw JSON →