Build ontologies in Python
Construct object classes, classifications, attributes, options, and nested conditional logic.
from unitlab import (
OntologyStructure, RadioAttribute, Shape,
)
structure = OntologyStructure()
cat = structure.add_object("Cat", Shape.BOUNDING_BOX, color="#F59E0B")
colour = cat.add_attribute(RadioAttribute, "Colour", required=True)
black = colour.add_option("Black")
black.add_nested_attribute(RadioAttribute, "Pattern").add_option("Solid")
print(structure.to_dict())
ontology = client.ontologies.create("Cat labels", structure=structure)Operating contract
Concern
Required behavior
Failure and recovery boundary
Condition
Response