Ontology Operations

Delete Ontology

The delete_ontology function allows you to delete an ontology from the Perseus server.

Synchronous

delete_ontology

def delete_ontology(ontology_id: str) -> None:

Deletes an ontology by its ID.

Arguments

NameTypeDescription
ontology_idstrThe unique ID of the ontology to delete.

Returns

This function does not return any value. It raises an exception on failure.

Example

import perseus_client

try:
    perseus_client.delete_ontology("your_ontology_id_to_delete")
    print("Ontology deleted successfully.")
except Exception as e:
    print(f"An error occurred: {e}")

Asynchronous

delete_ontology_async

async def delete_ontology_async(ontology_id: str) -> None:

Asynchronously deletes an ontology by its ID.

Arguments

NameTypeDescription
ontology_idstrThe unique ID of the ontology to delete.

Returns

This function does not return any value. It raises an exception on failure.

Example

import asyncio
import perseus_client

async def main():
    try:
        await perseus_client.delete_ontology_async("your_ontology_id_to_delete")
        print("Ontology deleted successfully.")
    except Exception as e:
        print(f"An error occurred: {e}")
    finally:
        await perseus_client.close_async()

if __name__ == "__main__":
    asyncio.run(main())