> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encord.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ontology

## Ontology Objects

```python theme={"dark"}
class Ontology()
```

Access ontology related data and manipulate the ontology. Instantiate this class via
[get\_ontology()](/sdk-documentation/sdk-references/user_client#get_ontology)

#### ontology\_hash

```python theme={"dark"}
@property
def ontology_hash() -> str
```

Get the ontology hash (i.e. the Ontology ID).

#### title

```python theme={"dark"}
@property
def title() -> str
```

Get the title of the ontology.

#### description

```python theme={"dark"}
@property
def description() -> str
```

Get the description of the ontology.

#### created\_at

```python theme={"dark"}
@property
def created_at() -> datetime.datetime
```

Get the time the ontology was created at.

#### last\_edited\_at

```python theme={"dark"}
@property
def last_edited_at() -> datetime.datetime
```

Get the time the ontology was last edited at.

#### structure

```python theme={"dark"}
@property
def structure() -> OntologyStructure
```

Get the structure of the ontology.

#### refetch\_data

```python theme={"dark"}
def refetch_data() -> None
```

The Ontology class will only fetch its properties once. Use this function if you suspect the state of those
properties to be dirty.

#### save

```python theme={"dark"}
def save() -> None
```

Sync local state to the server, if updates are made to structure, title or description fields

#### list\_groups

```python theme={"dark"}
def list_groups() -> Iterable[OntologyGroup]
```

List all groups that have access to a particular ontology.

#### add\_group

```python theme={"dark"}
def add_group(group_hash: Union[List[UUID], UUID],
              user_role: OntologyUserRole)
```

Add group to an ontology.

**Arguments**:

* `group_hash` - List of group hashes to be added.
* `user_role` - User role that the group will be given.

**Returns**:

None

#### remove\_group

```python theme={"dark"}
def remove_group(group_hash: Union[List[UUID], UUID])
```

Remove group from ontology.

**Arguments**:

* `group_hash` - List of group hashes to be removed.

**Returns**:

None
