pyirk._core.mod_management

Module-lifecycle / entity-unlinking helpers extracted from :mod:pyirk.core.

The symbols defined here are import-time safe: none of them needs any module-global of core while this module is being imported (their parameter and return annotations use only builtins / stdlib types). Symbols that use core module-globals (ds, the core classes Statement / Relation etc.) at call time access them module-qualified via the _core module object, whose attributes are only read once the functions are actually called. This keeps the import monodirectional: core imports this module (early), this module only binds the (partially loaded) core module object.

Note: replace_and_unlink_entity intentionally stays in :mod:pyirk.core because its parameter annotations reference the core class Entity (which is evaluated at import time and is not yet defined when this module is imported). It calls _unlink_entity via the facade re-export.

Module Contents

Functions

unload_mod

Delete all references to entities coming from a module with mod_id

_unlink_entity

Remove the occurrence of this the respective entity from all relevant data structures

Data

__all__

API

pyirk._core.mod_management.__all__

[‘unload_mod’, ‘_unlink_entity’]

pyirk._core.mod_management.unload_mod(mod_uri: str, strict=True) None

Delete all references to entities coming from a module with mod_id

:param mod_uri: str; uri of the module, see its URI attribute :param strict: boolean; raise Exception if module seems be not loaded

:return: list of released keys

Remove the occurrence of this the respective entity from all relevant data structures

:param uri: entity uri :return: None