Ontologies basics

Ontologies are top-level entities that can be attached to projects that provide a template structure for labels.



For a detailed description about ontologies in the Encord platform go here.



A project can only have a single ontology attached to it, but one ontology can be attached to multiple projects.

Each ontology is identified using a unique "<dataset_hash>" - a unique ID that can be found within a dataset in the Encord platform, as highlighted below.

To access the ontology use the get_ontology() method, that allows you to work with its structure property.

from encord import EncordUserClient

user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(

ontology = user_client.get_ontology("<ontology_hash>")

# The <ontology_hash>

The structure comes as the OntologyStructure class.



Ontologies cannot be deleted using the SDK or the API. Use the Encord platform to delete an ontology.