OntologyStructure Objects
get_child_by_hash
feature_node_hash- The feature_node_hash of the child node to search for in the ontology.type_- The expected type of the item. If the found child does not match the type, an error will be thrown.
OntologyError- If the item with the specified feature_node_hash is not found or if the type does not match.
get_child_by_title
title- The exact title of the child node to search for in the ontology.type_- The expected type of the child node. Only a node that matches this type will be returned.
OntologyError- If no child node with the specified title and type is found, or if multiple matches are found.
get_children_by_title
title- The exact title of the child node to search for in the ontology.type_- The expected type of the item. Only nodes that match this type will be returned.
List[OntologyElementT]- A list of child nodes with the matching title and type.
from_dict
d- A JSON blob of an “ontology structure” (e.g. from Encord web app)
OntologyStructure- The created OntologyStructure object.
KeyError- If the dict is missing a required field.
to_dict
add_object
name- The user-visible name of the object.shape- The kind of object (bounding box, polygon, etc). See :py:class:encord.objects.common.Shapeenum for possible values.uid- Integer identifier of the object. Normally auto-generated; omit this unless the aim is to create an exact clone of existing structure.color- The color of the object in the label editor. Normally auto-assigned, should be in ‘1A2B3F’ syntax.feature_node_hash- Global identifier of the object. Normally auto-generated; omit this unless the aim is to create an exact clone of existing structure.
Object- The created object class that can be further customized with attributes.
ValueError- If a duplicate uid or feature_node_hash is provided.
add_classification
uid- Integer identifier of the object. Normally auto-generated; omit this unless the aim is to create an exact clone of existing structure.feature_node_hash- Global identifier of the object. Normally auto-generated; omit this unless the aim is to create an exact clone of existing structure.
Classification- The created classification node. Note that classification attribute should be further specified by calling itsadd_attribute()method.
ValueError- If a duplicate uid or feature_node_hash is provided.
add_skeleton_template
skeleton_template- The SkeletonTemplate object to be added.feature_node_hash- Global identifier of the skeleton template. Normally auto-generated; omit this unless the aim is to create an exact clone of existing structure.
ValueError- If a skeleton template with the same name already exists in the ontology.

