1"""Typed refusal for owlrl names that owlrl-turbo does not provide (ADR 0014)."""
2
3# bounded: the closed set of owlrl 7.6.2 top-level names without a native implementation.
4UNPROVIDED = frozenset({"OWLRL_Extension", "OWLRL_Extension_Trimming", "convert_graph"})
5"""owlrl 7.6.2 public names that the alias refuses explicitly instead of omitting silently."""
6
7
8class TurboAliasAttributeError(AttributeError):
9 """An owlrl attribute that the owlrl-turbo compatibility package does not provide."""
10
11
12def missing_attribute(module: str, name: str) -> AttributeError:
13 """The error for ``getattr(owlrl, name)``: typed for owlrl names, plain otherwise."""
14 if name in UNPROVIDED:
15 return TurboAliasAttributeError(
16 f"owlrl.{name} is not provided by owlrl-turbo, which aliases 'owlrl' to "
17 f"'owlrl_turbo.compat'. Set OWLRL_TURBO_ALIAS=0 (or TURBO_ALIAS=0) to import "
18 "the real owlrl distribution instead."
19 )
20 return AttributeError(f"module {module!r} has no attribute {name!r}")