Skip to main content

generate_feature_node_hash

def generate_feature_node_hash() -> str
Utility function to generate an 8-character hex string.

Ontology Objects

class Ontology()
DEPRECATED: prefer using :class:encord.ontology.Ontology

from_dict

@classmethod
def from_dict(cls, ontology_dict: Dict)
Convert python dictionary too an :class:.Ontology object. Arguments:
  • ontology_dict - The dictionary to convert.

add_object

def add_object(name: str, shape: ObjectShape) -> None
Add an :class:.OntologyObject to the ontology. Arguments:
  • name - A descriptive name of the object.
  • shape - The shape of the object.

add_classification

def add_classification(name: str,
                       classification_type: ClassificationType,
                       required: bool,
                       options: Optional[Iterable[str]] = None) -> None
Add a classification to the ontology. Arguments:
  • name - A descriptive name of the classification.
  • classification_type - The type of the classification.
  • required - Indicate whether annotating this classification is required.
  • options - Nested classification options.

to_dict

def to_dict() -> Dict
Convert the ontology object to a python dictionary.