ontouml_py.model.class_ontouml

Module Contents

Classes

Class

Abstract base class representing a generic element within an OntoUML model.

class ontouml_py.model.class_ontouml.Class(project, **data)

Bases: ontouml_py.model.classifier.Classifier

Abstract base class representing a generic element within an OntoUML model.

This class provides foundational attributes and methods for all OntoUML elements, including unique identification and timestamps for creation and modification. It enforces constraints on certain attributes and includes validation logic to maintain their integrity.

Variables:
  • id (str) – A unique identifier for the element, automatically generated upon instantiation.

  • created (datetime) – Timestamp when the element was created, defaults to the current time.

  • modified (Optional[datetime]) – Timestamp when the element was last modified, can be None if not modified.

  • model_config (Dict[str, Any]) – Configuration settings for the Pydantic model.

Parameters:
  • project (Project) –

  • data (dict[str, Any]) –

property literals
_literals: set[ontouml_py.model.literal.Literal]
is_powertype: bool
order: str | int
restricted_to: set[ontouml_py.model.enumerations.ontologicalnature.OntologicalNature]
stereotype: ontouml_py.model.enumerations.classstereotype.ClassStereotype | str | None
model_config
create_literal()

Add a literal to the class.

Return type:

ontouml_py.model.literal.Literal

delete_literal(old_literal)

Remove a literal from the class if it exists.

Parameters:

old_literal (Literal) – The literal to be removed.

Return type:

None