ontouml_py.model.package

Module Contents

Classes

Package

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

class ontouml_py.model.package.Package(project, **data)

Bases: ontouml_py.model.modelelement.ModelElement, ontouml_py.model.packageable.Packageable, ontouml_py.model.package_methods.PackageMethodsMixin

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]) –

_contents: dict[str, set[ontouml_py.model.packageable.Packageable]]
model_config
get_contents()
Return type:

dict

get_content_by_id(content_type, content_id)
Parameters:
Return type:

Optional[ontouml_py.model.packageable.Packageable]

remove_content(old_content)
Parameters:

old_content (ontouml_py.model.packageable.Packageable) –

Return type:

None

_removal_error_message(old_content, old_content_type)
Parameters:
Return type:

str