> ## 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.

# Objects.ontology element

## OntologyElement Objects

```python theme={"dark"}
@dataclass
class OntologyElement(ABC)
```

#### children

```python theme={"dark"}
@property
def children() -> Sequence[OntologyElement]
```

Returns an empty sequence of children nodes for this ontology element.
This method is meant to be overridden by subclasses that have actual child nodes.

#### title

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

Abstract property that should return the title of the ontology element.
Must be implemented by subclasses.

#### get\_child\_by\_hash

```python theme={"dark"}
def get_child_by_hash(
    feature_node_hash: str,
    type_: Optional[Type[OntologyNestedElementT]] = None
) -> OntologyNestedElementT
```

Retrieves the first child node of this ontology element with the matching feature node hash.
If multiple children have the same hash, the ontology is in an invalid state.
Throws an exception if no matching child is found or if the type does not match.

**Arguments**:

* `feature_node_hash` - The feature node hash of the child node to find.
* `type_` - Optional type to check the type of the child node.

**Returns**:

The child node with the specified feature node hash and type.

#### get\_children\_by\_title

```python theme={"dark"}
def get_children_by_title(
    title: str,
    type_: Optional[Type[OntologyNestedElementT]] = None
) -> List[OntologyNestedElementT]
```

Retrieves all child nodes of this ontology element that match the specified title and type.

**Arguments**:

* `title` - The exact title of the child nodes to find.
* `type_` - Optional type to filter the child nodes.

**Returns**:

A list of child nodes with the specified title and type.

#### get\_child\_by\_title

```python theme={"dark"}
def get_child_by_title(
    title: str,
    type_: Optional[Type[OntologyNestedElementT]] = None
) -> OntologyNestedElementT
```

Retrieves a single child node of this ontology element that matches the specified title and type.
Throws an exception if more than one or no child with the specified title and type is found.

**Arguments**:

* `title` - The exact title of the child node to find.
* `type_` - Optional type to check the type of the child node.

**Returns**:

The child node with the specified title and type.

**Raises**:

* `OntologyError` - If more than one or no matching child is found.

## OntologyNestedElement Objects

```python theme={"dark"}
@dataclass
class OntologyNestedElement(OntologyElement)
```

#### uid

Deprecated. Please use feature\_node\_hash instead.
