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.
Copy
from encord import EncordUserClientuser_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key( "<your_private_key>")ontology = user_client.get_ontology("<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.