Constructive geometric models of EL++ ontologies
Learned geometric ontology embeddings in mOWL—such as
ELEmbeddings,
ELBE, and
BoxSquaredELModule—optimise
differentiable loss functions and satisfy an ontology only approximately.
Recent theoretical results characterise when exact geometric region models of
\(\mathcal{EL}^{++}\) ontologies exist and give explicit constructions:
Axis-parallel boxes (and Euclidean balls) cannot model the six-axiom propositional theory
\[T_3 = \{A \equiv X_1 \sqcap X_2,\; B \equiv X_2 \sqcap X_3,\; C \equiv X_1 \sqcap X_3,\; A \sqcap B \sqsubseteq \bot,\; B \sqcap C \sqsubseteq \bot,\; A \sqcap C \sqsubseteq \bot\}\]in any non-degenerate interpretation in any dimension \(d \ge 1\), because axis-parallel boxes in \(\mathbb{R}^d\) have Helly number 2 (Eckhoff, 1988; Leemhuis & Kutz, NeSy 2025).
Convex polyhedra model every consistent normalised \(\mathcal{EL}^{++}\) ontology with a finite canonical model exactly in ambient dimension \(k = |\Delta^{\mathcal{I}}| - 1\) by mapping each concept name to a face of the standard simplex and each role to the convex hull of concatenated vertex pairs (Gutiérrez-Basulto & Schockaert, KR 2018, Prop. 3; Lacerda, Ozaki & Guimarães, TGDK 2024, §5). The dimension \(|\Delta^{\mathcal{I}}| - 1\) includes auxiliary names and \(\top\) and is an upper bound; a dimension linear in the number of concept names is unavoidable in the worst case for convex models that realise the relevant conjunctions (Gutiérrez-Basulto & Schockaert, KR 2018, Prop. 4).
Unions of closed intervals on the real line model every consistent normalised \(\mathcal{EL}^{++}\) ontology exactly in one dimension, with roles interpreted as finite unions of 2-D axis-aligned rectangles (Lacerda, Ozaki & Guimarães, TGDK 2024, Def. 12; the \(n = 1\) case of the multibox construction of Federico, Leemhuis & Kutz, JOWO 2026, Thm. 3).
The mowl.geometric package and its learnable counterparts follow a
five-part progression:
Canonical model (TBox, RBox, and ABox):
normalise()andCanonicalModelsaturate normalised \(\mathcal{EL}^{++}\) TBoxes, RBoxes, and ABoxes (encoding each named individual \(a\) as a fresh nominal concept name \(N_a\) vianominal_name(), atomic class assertions \(C(a)\) as \(N_a \sqsubseteq C\), and role assertions \(r(a, b)\) as \(N_a \sqsubseteq \exists r.N_b\), while raisingInconsistentOntologyif any individual is unsatisfiable).Exact constructive models and diagnostics:
ConvexPolyhedralModel,IntervalUnionModel,BoxModelBuilder,ModelChecker,helly_check(), andcertificate_triangles().Exact-model box initialisation and anchoring:
ExactBoxInitseeds and anchorsBoxSquaredEL,ELBE,MultiBoxEL,MultiELBE, andPrismEL.Learnable geometric and canonical-mixture models:
init_boxesandanchor_weighthooks onELBEandBoxSquaredEL, multi-component box modelsMultiBoxELandMultiELBE, prism embeddingsPrismEL, and the faithful-by-construction canonical-element mixture modelCanonicalMixture(backed byMembershipStructure).Training objectives for multi-box and prism models: soft component aggregation and log-space volume-overlap diversity regularisation in
mowl.nn.el.softagg, canonical-element point supervision inmowl.datasets.el.pointsandmowl.nn.el.pointloss, available viaobjective="point" | "mixed" | "hybrid"onMultiBoxELandMultiELBE, and structural region algebra, compiled conjunction definition tables, and structural losses inmowl.nn.el.structural, available viaobjective="structural"onMultiBoxELandPrismEL.
Guarantees by model and procedure
Every constructed model (ConvexPolyhedralModel,
IntervalUnionModel, and
BoxModel) is verified by
ModelChecker before it is returned; if a
constructed model ever fails verification, construction raises
InternalConsistencyError.
Class / function |
Supported fragment |
Mathematical guarantee |
Dimension |
|---|---|---|---|
Normalised \(\mathcal{EL}^{++}\) TBox/RBox ( |
Sound and complete on concept-name subsumptions and unsatisfiability wrt the normalised axiom set (Kazakov et al., JAR 2014), and sound and complete for atomic instance checking ( |
\(n = |\Delta^{\mathcal{I}}|\) canonical elements (satisfiable concept and nominal names in \(N_C \cup \{N_a\} \cup \{\top\}\)) |
|
Full normalised \(\mathcal{EL}^{++}\) (or propositional-only when |
Exact model (\(\eta \models \mathcal{O}\)), non-degenerate (\(\eta(A) \neq \emptyset\) for all satisfiable \(A\)), and strongly faithful on concept names (\(\eta(A) \subseteq \eta(B) \iff \mathcal{O} \models A \sqsubseteq B\)) (Gutiérrez-Basulto & Schockaert, KR 2018, Prop. 3). |
\(k = n - 1\), an upper bound that includes auxiliary names and \(\top\); a dimension linear in the number of concept names is unavoidable in the worst case for convex models that realise the relevant conjunctions (Gutiérrez-Basulto & Schockaert, KR 2018, Prop. 4) |
|
Full normalised \(\mathcal{EL}^{++}\) |
Exact model (\(\eta \models \mathcal{O}\)), non-degenerate, and strongly faithful on concept names (Lacerda et al., TGDK 2024, Def. 12; Federico et al., JOWO 2026, Thm. 3). |
\(1\) (classes in \(\mathbb{R}\), roles in \(\mathbb{R}^2\)) |
|
Propositional \(\mathcal{EL}_\bot\) (exact for strong reading when |
Every |
Dimension-independent (excludes box models in any \(\mathbb{R}^d\)) |
|
Any normalised \(\mathcal{EL}^{++}\) canonical model (graph of direct |
Sound non-degenerate singleton certificates \((X_1, X_2, X_3)\) with \(X_1 < X_2 < X_3\) lexicographically and all three |
Dimension-independent (excludes non-degenerate box models in any \(\mathbb{R}^d\)) |
|
Propositional \(\mathcal{EL}_\bot\) only ( |
Runs |
Searches \(d \in \{1, 2, 4, \dots, d_{\max}\}\) (default \(d_{\max} = 8\)) |
|
|
Exact decision procedure for axiom satisfaction, non-degeneracy, and strong faithfulness on concept names (combinatorial for intervals/boxes/simplex faces; HiGHS linear programming for general polyhedra and polyhedral role axioms). Polyhedral role axioms are checked only for simplex-vertex regions (Face rows and PairHull halves one-hot or zero); other regions raise |
Matches interpretation ambient dimension |
|
Normalised \(\mathcal{EL}^{++}\) ( |
In |
Target \((k, d)\) matching |
|
\(\mathcal{EL}^{++}\) concept normal forms ( |
Every class is a union of \(k = \text{n\_components}\) axis-parallel boxes with shared class bump and Box²EL role semantics (Federico, Leemhuis & Kutz, JOWO 2026). At \(k = 1\) with |
\(k\) boxes in \(\mathbb{R}^d\) per class (\(k \ge 2\) escapes the Helly number 2 obstruction on \(T_3\)) |
|
\(\mathcal{EL}^{++}\) concept normal forms ( |
Every class is a union of \(k = \text{n\_components}\) axis-parallel boxes with ELBE inclusion, gated pairwise intersection, translation roles, and box individuals (Federico, Leemhuis & Kutz, JOWO 2026). At \(k = 1\) with |
\(k\) boxes in \(\mathbb{R}^d\) per class |
|
\(\mathcal{EL}^{++}\) concept normal forms and ABox assertions ( |
Every class is a prism \(P_C = T_C \times B_C \subset \mathbb{R}^2 \times \mathbb{R}^{d-2}\) (an apex-up equilateral triangle in support coordinates times an axis-parallel box) with closed-form intersection in |
\(2d - 1\) scalar parameters per class in \(\mathbb{R}^d\) (\(d \ge 3\)) |
|
Normalised \(\mathcal{EL}^{++}\) knowledge bases with individuals (ABox completion) |
Represents each individual \(a\) as a masked softmax distribution \(p_a\) over its admissible canonical support \(S_a \subseteq S\) from |
Low-rank factorisation \(r = \text{rank}\) over \(|S|\) canonical elements |
|
Soft component aggregation ( |
|
Replaces hard \(\min\) over target components by \(\text{softmin}_\tau(v) = -\tau(\log\sum_j e^{-v_j/\tau} - \log K)\) (converging to \(\min\) as \(\tau \to 0^+\) and equal to the single slice at \(K = 1\)), soft-argmin emptiness weights \(w_{ij} = \text{softmax}(-\text{empt}_{ij}/\tau)\) with detached gate \(g_{ij} = \max(\text{non\_empty}_{ij}^{\text{det}}, w_{ij}^{\text{det}})\) in |
Temperature \(\tau\) annealed geometrically from |
Canonical-element point supervision ( |
|
Supervises class regions via soft coordinate-minimum box membership \(m(x) = \min_{\text{coord}} \sigma((|o| - |x - c|)/\beta)\) and noisy-OR union membership \(m_C(x) = 1 - \prod_i (1 - m_{C_i}(x))\) over canonical elements of satisfiable named classes and individuals (aliasing individual elements to |
\(|\text{elements}| \times d\) point table |
Structural objective ( |
|
Materialises regions with signed half-widths ( |
\(K = \text{max\_components}\) slots in \(\mathbb{R}^d\) ( |
Limitations and caveats
ABox nominal encoding in :class:`~mowl.geometric.completion.CanonicalModel`
Fragment for sound and complete instance checking:
normalise()encodes each named individual \(a\) as a fresh nominal concept name \(N_a = \text{nominal\_name}(a)\) (prefixhttp://mowl.borg/nominal/followed by the percent-encoded IRI), translating atomicClassAssertion(C, a)intoNF1(N_a, C)andObjectPropertyAssertion(r, a, b)intoNF3(N_a, r, N_b). Instance checking (instance_of()) and assertion contradiction (assertion_contradicted()) are sound and complete for \(\mathcal{ELH}\) (with \(\bot\)) without nominals (ObjectOneOf), functionality (FunctionalObjectProperty), and range (ObjectPropertyRange) axioms.Separation of ``concept_names`` and ``names``:
concept_namesexcludes nominal names \(N_a\), whereasnameskeeps all satisfiable concept and nominal names so that constructive region builders assign every satisfiable individual a non-empty region.Inconsistent individuals and unsupported ABox axioms: If completion derives \(N_a \sqsubseteq \bot\) for any individual \(a\), constructing
CanonicalModelraisesInconsistentOntologynaming \(a\). Unsupported ABox axioms (complexClassAssertion,SameIndividual,DifferentIndividuals,ObjectPropertyAssertionwith an inverse property, assertions on anonymous individuals, and negative or data assertions) are never dropped silently and raiseUnsupportedAxiomErrorduringnormalise().
Polyhedral dimension equals canonical-model size minus one (:math:`k = |Delta^{mathcal{I}}| - 1`) In
ConvexPolyhedralModel, the ambient dimension is \(k = n - 1\), where \(n = |\text{cm.names}|\) includes all satisfiable original concept names, nominal names,owl:Thing, and any auxiliary concept names introduced byELNormalizer. This is an upper bound: a dimension linear in the number of concept names is unavoidable in the worst case for convex models that realise the relevant conjunctions (Gutiérrez-Basulto & Schockaert, KR 2018, Prop. 4), but \(|\Delta^{\mathcal{I}}| - 1\) itself, which counts auxiliary names and \(\top\), need not be minimal. LP checks over role polyhedra scale with \(n\). For large ontologies, preferIntervalUnionModel.Polyhedral regions are lower-dimensional simplex faces unless ``thicken=True`` By default (
thicken=False), each class region \(\eta(A)\) inConvexPolyhedralModelis the simplex face \(F(A^{\mathcal{I}}) = \text{conv}\{v_i : i \in A^{\mathcal{I}}\}\), which is non-empty for every satisfiable concept name but has zero Lebesgue volume (no interior in \(\mathbb{R}^{n-1}\)) whenever \(|A^{\mathcal{I}}| < n\). This is required for exact satisfaction of role axioms (NF3andNF4). For role-free (propositional) ontologies, passingthicken=Truereplaces each face by a full-dimensionalThickFacewith non-empty interior (\(\varepsilon = \tfrac{1}{2n}\)); passingthicken=Truewhen role axioms are present raisesUnsupportedAxiom.Box builder is propositional-only, may be inconclusive, and produces zero-width boxes
Propositional fragment only:
BoxModelBuildersupportsNF1andNF2(including \(\bot\) forms). Any role axiom (NF3,NF4,NF6, orNF7) raisesUnsupportedAxiom.Which certificates reject: in both
faithful="weak"andfaithful="strong"mode, the builder raisesNotBoxRepresentableonly on a non-degenerate certificate. A strong certificate alone does not rejectfaithful="strong": it excludes conjunction-faithful box models, not box models strongly faithful on names. For example, \(\{X_1 \sqcap X_2 \sqsubseteq Y,\; Y \sqcap X_3 \sqsubseteq \bot\}\) has the strong certificate \((X_1, X_2, X_3)\), yet the 1-D boxes \(X_1 = [0, 1], X_2 = [2, 3], X_3 = [4, 5], Y = [6, 7]\) are a non-degenerate model that is strongly faithful on names.Inconclusive MILP outcome: A passing Helly check does not guarantee that an axis-parallel box model exists (no such sufficiency theorem is known);
box_representable_* = Truemeans only that the ontology is obstruction-free. Only a Helly certificate (NotBoxRepresentable) is a proof of impossibility; when no certificate is found and the MILP fails for all \(d \le d_{\max}\) or reachestime_limitwithout an incumbent that passes the post-check,build()raisesBoxModelNotFound(inconclusive). The builder is intended for small ontologies; the MILP is exponential in the worst case.Zero-width (degenerate) boxes: Because the MILP objective minimises total box width \(\sum_{A,i} (U_{A,i} - L_{A,i})\), returned boxes frequently satisfy \(\text{lo} = \text{hi}\) (single points, which are non-empty under closed-box semantics). Users exporting boxes via
boxes_as_tensors()to seed gradient-based models that require positive box volume should add a small positive margin to the exported offsets (or upper corners) or modify the objective.
``HellyReport.complete`` and conservative ``box_representable_nondegenerate``
HellyReport.completeisTrueif and only if the minimal jointly unsatisfiable set enumeration was not cut off byk_maxormax_certificatesand the ontology contains no role axioms (has_roles == False). Whenever role axioms are present,completeisFalse(Leemhuis & Kutz, NAI 2026, Prop. 38), though any returned certificate remains a sound proof of non-box-representability.Non-degenerate certificates exclude every non-degenerate box model in any dimension. Strong certificates exclude only conjunction-faithful box models, in which every satisfiable conjunction of concept names is non-empty; this is stronger than strong faithfulness on names.
box_representable_nondegenerate/box_representable_strongequal toTruemeans “no Helly obstruction of this kind was found” (obstruction-free), not that a box model exists. Build one withBoxModelBuilderto find out.When
complete=True, the enumeration is exact for the strong reading (box_representable_strong/certificates_strong). For the non-degenerate reading, whether a certificate is non-degenerate depends on how an unsatisfiable concept set is split into \((C_1, C_2, C_3)\), and the union of names in a non-degenerate certificate need not itself be inclusion-minimal. Thereforebox_representable_nondegenerateis conservative: it isFalsewhencertificates_nondegenerateis non-empty,Trueonly whencomplete=Trueandcertificates_strongis empty, andNoneotherwise.Scaling:
helly_check()re-saturates the ontology per candidate set and is intended for small to medium ontologies; incremental joint satisfiability is future work.
Lossy bounding-box export
to_bounding_boxes()replaces each simplex face of aConvexPolyhedralModelby its elementwise coordinate minimum and maximum. Because axis-parallel bounding boxes of simplex faces intersect strictly more often than the faces themselves, the resulting boxes do not satisfy the ontology’s disjointness or conjunction axioms and must never be treated as a model.Projected box initialisation (:class:`~mowl.geometric.init.ExactBoxInit`) and ``certificate_triangles``
Satisfiable subclasses only; no disjointness under projected init: With
method="projected"andn_components=1,ExactBoxInitplaces each canonical domain element at a Gaussian point in \(\mathbb{R}^d\) and assigns each satisfiable concept name the padded bounding box of its extension. Because bounding boxes are monotone under set inclusion, \(\text{box}(C) \subseteq \text{box}(D)\) holds (up tofloat32rounding,1e-6) for every entailed atomic subsumption \(C \sqsubseteq D\) with a satisfiable subclass \(C\) (giving zerogci0loss at margin \(0\) immediately afterapply_to_module()). Axioms \(U \sqsubseteq A\) with an unsatisfiable subclass \(U\) are not covered (unsatisfiable concepts andBOTTOMare placed as point boxes at the origin, and no single point placement can satisfy subsumptions into mutually disjoint superclasses). Disjointness (\(A \sqcap B \sqsubseteq \bot\)) is not guaranteed undermethod="projected"because projected bounding boxes overlap.Incompleteness of
certificate_triangles():certificate_triangles()enumerates triangles in the graph of directNF2definitions (\(A \sqcap B \sqsubseteq N\) with \(\mathcal{O} \models N \equiv A \sqcap B\)). Every returned certificate is a sound non-degenerate singletonHellyCertificate, but the procedure is not complete: pairwise conjunctions defined through chains of equivalences or multi-step normalisations without a directNF2(A, B, N)axiom, as well as higher-arity certificates where \(|C_i| > 1\), are not found.
MultiBoxEL (:class:`~mowl.models.MultiBoxEL`, :class:`~mowl.nn.MultiBoxELModule`) and MultiELBE (:class:`~mowl.models.MultiELBE`, :class:`~mowl.nn.MultiELBEModule`)
Exact \(k = 1\) identity: When
n_components=1,component_aggregation="hard",component_reg=0.0, anddiversity_reg=0.0,MultiBoxELModuleagrees withBoxSquaredELModuleandMultiELBEModuleagrees withELBEModuleat equalmarginto within1e-6on every GCI loss (positive and negative, includinggci1batches containing empty pairwise intersections). Note thatMultiELBEdefaults tomargin=0.1(matchingELBEModule), whereas theELBEwrapper defaults tomargin=0, so comparing the model wrappers requires passing an equalmarginexplicitly.Gated pairwise intersections in
gci1and overlap semantics inMultiELBE.gci3: For \(C \sqcap D \sqsubseteq E\), let \((i^*, j^*) = \arg\min_{i,j} \text{empt}(C_i, D_j)\) be the designated component pair (selected without gradient). Under"hard"aggregation, the detached gate \(g_{ij} = 1\) if \(\text{lo}_{ij} \le \text{up}_{ij}\) in every coordinate or \((i, j) = (i^*, j^*)\), else \(0\), enforces inclusion into some component \(E_m\) only on intersecting pairs (plus the designated pair, which also receives \(\text{empt}(C_{i^*}, D_{j^*})\)). InMultiELBEModule,gci3_losspreserves ELBE’s coordinatewise overlap formula \(\|\text{relu}(|c - r - d| - o_c - o_d + \text{margin})\|_2\) rather than full box inclusion so that \(k = 1\) is identical to ELBE.Coordinatewise separation in
gci1_bot: In both backbones,gci1_bot_lossfor \(C \sqcap D \sqsubseteq \bot\) aggregates coordinatewise separation across all \(k^2\) pairs. At margin \(0\), zero loss implies that all \(k^2\) component pairs are disjoint (up to boundary contact), but not conversely: two boxes separated in one coordinate whose projections overlap in another coordinate are disjoint in \(\mathbb{R}^d\) yet incur positivegci1_bot_loss.Non-convexity: Taking minima over target components and gating over pairwise intersections yields a piecewise-smooth non-convex objective; gradient-based training is not guaranteed to converge to a global optimum from arbitrary random initialisations.
Soft component aggregation (:mod:`mowl.nn.el.softagg`) and canonical-element point supervision (:mod:`mowl.nn.el.pointloss`)
Finite-temperature collapse pressure under soft aggregation and ``tau_end=0.05`` floor: At finite \(\tau > 0\),
softmin()satisfies \(\min_j v_j \le \text{softmin}_\tau(v) \le \text{mean}_j v_j\) and is strictly positive at a hard model whenever non-nearest target components have positive inclusion scores, pulling all target components together unless counteracted bydiversity_reg > 0(diversity_penalty()). Infloat32, softmax weights \(\exp(-\Delta/\tau)\) underflow to exact0.0once the score gap \(\Delta\) exceeds \(\approx 100\tau\);tau_endtherefore defaults to0.05rather than0.01so non-nearest components retain non-zero gradient throughout annealing. Althoughmodule.tauis persisted as a registered buffer instate_dict(), the geometric annealing schedule inon_epoch_startrestarts fromtau_startat eachtrain()call.Strict positivity of BCE and region vs. point model-ness under point supervision: Because
soft_box_membership()takes the minimum over \(d\) coordinate sigmoids \(m(x) = \min_{\text{coord}} \sigma((|o| - |x - c|)/\beta)\) (which is dimension-free, avoiding the \(\sigma(|o|/\beta)^d\) decay of a coordinatewise product; individual targets in role edges use a virtual box of half-widthind_halfwidthdefaulting to \(5\beta\) aroundind_embed), at finite \(\beta > 0\) and finite box half-widths every coordinate sigmoid is strictly in \((0, 1)\), so \(0 < m(x) < 1\) strictly (and is clamped to \([\varepsilon, 1 - \varepsilon]\) inmembership_bce()) andmembership_bce()never reaches exact zero. Underobjective="point", all TBox GCI losses and ABoxobject_property_assertionare zeroed (while ABoxclass_assertionis still trained in the main loop via \(-\log m_C(a)\)) because finite point sets do not forbid boxes from overlapping in empty space;objective="mixed"additionally keeps the backbone’s \(\bot\)-axiom losses (gci0_bot,gci1_bot,gci3_bot) alongside the point losses, andobjective="hybrid"keeps all GCI and ABox losses alongside the point losses. Under"point","mixed", and"hybrid", ABox class assertions are scored by \(-\log m_C(a)\) and point satisfaction is measured viapoint_modelness().
Structural objective (learning Helly-breaking structure from random initialisation)
Standard inclusion and disjointness hinge losses have an incomplete zero set because they are trivially satisfied by empty boxes, making shrinking a universal descent direction with the degenerate all-empty interpretation as a global minimum and nothing demanding that a satisfiable class or conjunction be non-empty. Normalising a definition \(A \equiv X_1 \sqcap X_2\) into three separate hinges (\(A \sqsubseteq X_1\), \(A \sqsubseteq X_2\), \(X_1 \sqcap X_2 \sqsubseteq A\)) on an independently parametrised \(A\) leaves slack between \(A\) and \(X_1 \cap X_2\) where the \(T_3\) frustration (pushing \(A\), \(B\), \(C\) apart vs. pulling \(A\) onto \(X_1 \cap X_2\)) lives instead of forcing the parent boxes to split. Because which component of \(X_1\) realises which part of \(X_1\) is discrete, nearest-component aggregation gives gradient only to the component already closest and a \(\operatorname{relu}(\text{overlap})\) non-emptiness term gives no gradient to a separated component pair, so descent keeps the single-spanning-box assignment implied by random initialisation (where three pairwise-intersecting spanning boxes always share a point by Helly’s theorem).
The opt-in objective="structural" mode (implemented in
mowl.nn.el.structural, mowl.nn.el.multiboxel, and
mowl.nn.el.prism) addresses all three defects for
MultiBoxEL and PrismEL. The
guarantee concerns the zero set of the loss, not convergence of the optimiser;
as measured on the \(T_3\) fixture in the slow tests (empirical measurements,
not a convergence guarantee; the synthetic sweep results live in the
experiments repository), MultiBoxEL (\(k = 4\),
\(K = 16\), \(d = 2\), re-seeding every 50 epochs) reached an exact,
strictly non-empty Helly-breaking model (strict_loss == 0, minimum target
class size \(\ge 0.0173 > 0\), minimum target pair size
\(\ge 0.0179 > 0\), and \(X_1 \cap X_2 \cap X_3 = \emptyset\)) in 4 of
5 measured seeds and PrismEL (\(d = 3\)) in 5 of 5
measured seeds (strict_loss == 0, minimum target class and pair
prism_nonempty_measure \(\ge 0.0100 > 0\), and
\(X_1 \cap X_2 \cap X_3 = \emptyset\)):
Regions with signed half-widths and absent slots (:class:`~mowl.nn.el.structural.Regions`): Every class \(C\) is materialised as \(K = \text{max\_components}\) component slots
(cen, w, active), each a box \((c, w)\) with centre \(c \in \mathbb{R}^d\), signed half-width \(w \in \mathbb{R}^d\) (negative in coordinate \(m\) iff the slot is empty along coordinate \(m\)), and booleanactiveflag:Primitive class: slots
0 .. k - 1hold the raw embedding rows (\(w = |o| \ge 0\),active = True); slotsk .. K - 1are inactive (cen = 0,w = -1).Defined class \(A := X \sqcap Y\):
pair_slots()forms all pairs \((X_i, Y_j)\) of parent slots with \(\text{lower} = \max(c_X - w_X, c_Y - w_Y)\), \(\text{upper} = \min(c_X + w_X, c_Y + w_Y)\), \(c = (\text{lower} + \text{upper})/2\), and \(w = (\text{upper} - \text{lower})/2\) (negative in a coordinate \(\iff\) the pair is disjoint there); a pair slot is active iff both parent slots are active, with active pairs packed into leading slots in lexicographic \((i, j)\) order and remaining slots padded as inactive (cen = 0,w = -1).Derived differentiable quantities:
nonempty_measure(): \(\text{ne}(a) = \min_m 2 w_{a,m}\) — minimum signed width; slot \(a\) is non-empty iff \(\text{ne}(a) > 0\).signed_overlap(): \(\text{sov}_m(a, b) = \min(c_a + w_a, c_b + w_b)_m - \max(c_a - w_a, c_b - w_b)_m\) — signed overlap per coordinate, with \(\text{ne}(a \cap b) = \min_m \text{sov}_m(a, b)\).region_size()andpair_size(): \(\text{NE}(C) = \max_{i \text{ active}} \text{ne}(C_i)\) and \(\text{NE}(C \sqcap D) = \max_{(i,j) \text{ active}} \text{ne}(C_i \cap D_j)\). The maximum selects the nearest active pair even when all pairs are separated (negative values), routing gradient to pull separated components together.inclusion_tight(): \(\text{incl}_m(a, b) = \|\operatorname{relu}(|c_a - c_b| + w_a - w_b + m)\|_2\) — tight inclusion with margin \(m \ge 0\) (positive \(m\) tightens, ELBE convention), equal to \(0\) at \(m = 0\) iff \(a \subseteq b\) coordinatewise (for non-empty \(a\)).
Absent-slot export convention: A slot that is inactive (
active == False) or has \(w_m < 0\) for some coordinate \(m\) is absent.class_regions()andall_class_regions()returnw = -1in every coordinate andcen = 0for inactive slots; consumers exporting(centers, offsets)arrays mark any absent slot (\(\neg\text{active} \vee \min_m w_m < 0\)) withoffsets = -1andcenters = 0, so standard corner arithmetic (\(\text{lo} = c - o > \text{hi} = c + o\)) treats absent slots as empty automatically.
Definition table (:class:`~mowl.nn.el.structural.DefinitionTable`): Built once per
train()/train()call viafrom_normal_forms()from the training normal forms (gci0rows \((C, D)\),gci1rows \((C, D, E)\), and optionalgci2rows \((C, r, D)\) andgci3rows \((r, C, D)\)):Candidate (including role auxiliaries): \(A\) is a candidate defined class with definers \((X, Y)\) iff there is a
gci1row \((X, Y, A)\) with \(X \neq Y\), \(A \notin \{X, Y\}\), none of \(A, X, Y\) equal toowl:Thingorowl:Nothing, and each required inclusion \((A, D)\) for \(D \in \{X, Y\}\) is satisfied either directly by agci0row \((A, D)\) or through a role auxiliary by agci2row \((A, r, C)\) together with agci3row \((r, C, D)\) sharing the same \(r\) and \(C\) (i.e. \(A \sqsubseteq \exists r.C \sqsubseteq D\) is entailed, which is howELNormalizernormalises definitions of the form \(A \equiv X \sqcap \exists r.C\) into \(A \sqsubseteq X\), \(A \sqsubseteq \exists r.C\), \(\exists r.C \sqsubseteq \text{Aux}\), and \(X \sqcap \text{Aux} \sqsubseteq A\); definitions whose normalisation introduces nested auxiliaries on both sides—e.g. \(A \equiv \text{Pizza} \sqcap \exists\text{hasTopping}.(\text{PizzaTopping} \sqcap \exists\text{hasSpiciness}.\text{Hot})\), which yields \(A \sqsubseteq \exists r.\text{Aux}_1\) and \(\exists r.\text{Aux}_2 \sqsubseteq \text{Aux}_3\) with \(\text{Aux}_1 \neq \text{Aux}_2\)—are not detected, only a single role-auxiliary step \(A \sqsubseteq \exists r.C \sqsubseteq \text{Aux}\) is). If several \((X, Y)\) qualify for the same \(A\), the lexicographically smallest \((\min(X, Y), \max(X, Y))\) is selected.Bottom-up acceptance and cap: Candidates are processed in topological order of the candidate dependency graph (a candidate is ready once its definers are decided), with ties broken by increasing class index (Kahn’s algorithm with a min-heap in \(O((|G_0| + |G_1|) \log n)\) time). A ready candidate \(A \to (X, Y)\) is accepted iff \(\text{comps}(X) \cdot \text{comps}(Y) \le \text{max\_components}\) (and \(\text{level}(A) \le \text{max\_level}\) when given), where \(\text{comps}(P) = k\) for primitive classes and \(\text{comps}(X) \cdot \text{comps}(Y)\) for accepted defined classes, and \(\text{level}(A) = 1 + \max(\text{level}(X), \text{level}(Y))\) (\(\text{level} = 0\) for primitive classes). Because definers are final at acceptance time, nothing accepted earlier can be invalidated. When only cyclic (or cycle-blocked) candidates remain, the undecided candidate with the lowest class index is rejected (stays primitive) and processing resumes (deterministic, though possibly lossy because the lowest-index undecided candidate may sit downstream of a cycle rather than on it). A level-\(\ell\) class has at most \(k^{2^\ell}\) slots (when both definers are at level \(\ell - 1\)) and \(k^{\ell+1}\) slots for a chained definition \(A \equiv \text{Aux} \sqcap X\) (the shape emitted by
ELNormalizerfor \(n\)-ary conjunctions);max_components(default \(k^2\), one level) bounds this blow-up.Masked rows: For every accepted \(A \to (X, Y)\), the rows \((A, X)\) and \((A, Y)\) in
gci0(masked_gci0()) and \((X, Y, A)\) and \((Y, X, A)\) ingci1(masked_gci1()) hold by construction and evaluate to exact0.0loss in training and evaluation; when \((A, \text{Aux})\) is only entailed through the role auxiliary, nogci0row exists for it and therefore only \((A, X)\) and thegci1rows are masked, while thegci2andgci3rows are not masked and keep training \(\text{Aux}\)’s region. Settingstructural_definitions=Falsedisables the table (every class stays primitive and nothing is masked).
Structural losses (:class:`~mowl.models.MultiBoxEL`) and existence / size terms: All box normal-form losses are per axiom row, squared hinges with tightening margin \(m\) (
module.margin, default0.02onMultiBoxELand0.1onPrismEL), where \([\cdots]^{\text{det}}\) denotes a detached gate and means/minima are over active slots:Structural normal-form losses for MultiBoxELModuleNormal form
Structural loss (per row)
\(C \sqsubseteq D\) (
gci0,gci0_structural())\(\operatorname{mean}_{i:\,\text{active},\,\text{ne}(C_i)>0}^{\text{det}} \min_{j \text{ active}} \text{incl}_m(C_i, D_j)^2\);
0if no active non-empty \(C_i\) or if the row is masked\(C \sqsubseteq \bot\) (
gci0_bot,gci0_bot_structural())\(\operatorname{mean}_{i \text{ active}} \operatorname{relu}(\text{ne}(C_i))^2\) (no margin: primitive widths satisfy \(w = |o| \ge 0\), so a positive margin would impose a floor on the loss)
\(C \sqcap D \sqsubseteq E\) (
gci1,gci1_structural())\(\operatorname{mean}_{(i,j):\,\text{active},\,\text{ne}(C_i \cap D_j)>0}^{\text{det}} \min_{l \text{ active}} \text{incl}_m(I_{ij}, E_l)^2\) with \(I_{ij}\) the pair slot;
0if no pair is non-empty (vacuous; no emptiness penalty) or the row is masked\(C \sqcap D \sqsubseteq \bot\) (
gci1_bot,gci1_bot_structural())\(\operatorname{agg}_{(i,j) \text{ active}} \operatorname{relu}(\text{ne}(C_i \cap D_j) + m)^2\) with
agg=bot_agg\(\in \{\text{"mean"}, \text{"sum"}\}\) (default"mean";"sum"sums over active pairs instead of dividing by the active-pair count, with module slots gated to active non-empty components \(\text{ne} > 0\): identical zero set at \(m = 0\), deviating from gating onactivealone only at \(m > 0\)) — separation by \(m\) in at least one coordinate\(C \sqsubseteq \exists r.D\), \(\exists r.C \sqsubseteq D\), \(\exists r.C \sqsubseteq \bot\), and ABox assertions (
gci2,gci3,gci3_bot,class_assertion,object_property_assertion)Existing Box²EL multibox scores (hard aggregation, with
gci3andgci3_botsquared) evaluated on the materialised slots \((c, |w|)\) with inactive or empty slots (\(\neg\text{active} \vee \text{ne}(w) \le 0\)) masked out (source slots excluded from means, target slots excluded from minima); because Box²ELgammaloosens inclusions (\(\operatorname{relu}(\text{dist} + 2o - \gamma)\)), positive role and assertion scores passgamma = -m(tightening inclusion by \(m\)), whereas negative scores (gci2_score_neg()and negativeobject_property_assertion) keep Box²EL’s convention (gamma = +margin, which relaxes them by the margin), so the negative-sampling term is unchanged between the axiom and structural objectives; class bumps remain per-class embedding rowsAdditional per-epoch terms returned by
additional_training_loss()viastructural_extra_loss():Existence (weight
existence_weight, default1.0,existence_loss()):\[\operatorname{mean}_{C \in \text{Sat}} \operatorname{relu}(m - \text{NE}(C))^2 + \operatorname{mean}_{(C, D) \in \text{SatPairs}} \operatorname{relu}(m - \text{NE}(C \sqcap D))^2,\]where
ExistenceTargetscollectsSat(satisfiable classes excluding \(\top, \bot\)) andSatPairs(distinct unordered pairs \((C, D)\) occurring ingci1rows with \(C \sqcap D\) satisfiable). When acanonical_model(CanonicalModel) is passed, satisfiability for IRIs incanonical_model.concept_namescomes fromis_satisfiable()andjoint_satisfiable(), while IRIs unknown tocanonical_model.concept_namesfall back to the assertedgci0_bot/gci1_botrules for both single classes and pairs (note that auxiliary classes minted byELNormalizer,http://mowl.borg/aux/..., are unknown to aCanonicalModelbuilt withmowl.geometric’s own normaliser, so their entailed unsatisfiability cannot be detected viacanonical_modeland uses the asserted rules only); otherwise a class is assumed satisfiable unless agci0_botrow \((C, \bot)\) exists and agci1pair unless either class appears ingci0_botor \((C, D)\) appears ingci1_bot.Size (weight
size_reg, default1e-3): mean of \(2|o|\) over raw primitive slots and coordinates (excluding \(\top\) and accepted defined classes), keeping spare components small so they can be relocated and discouraging single spanning boxes.Witness points (weight
witness_weight, default0.0,witness_loss()): whenwitness_weight > 0, allocatesmodule.witness_embedwith one learnable witness point \(w_C \in \mathbb{R}^d\) per satisfiable class \(C \in \text{targets.witness.classes}\) (WitnessTargets) and adds\[\operatorname{mean}_{(C, D) \in \text{pos}} \operatorname{relu}(m - \text{inside}(w_C, D))^2 + \operatorname{mean}_{(C, D) \in \text{neg}} \operatorname{relu}(\text{inside}(w_C, D) + m)^2,\]where
inside_measure()evaluates \(\text{inside}(p, D) = \max_{s \text{ active}} \min_m (w_{D,s,m} - |p_m - c_{D,s,m}|)\) on the materialisedclass_regions()of \(D\) (returning-1e6if no slot is active),poscollects \((w_C, D)\) with \(C \sqsubseteq D\) (viaentails()whencanonical_modelis given, or \(\{C\} \cup \{D : (C, D) \in \text{gci0}\}\) otherwise), andnegcollects satisfiable \(D\) disjoint from \(C\) (vianot canonical_model.joint_satisfiable([C, D])whencanonical_modelis given, or assertedgci1_botpartners otherwise), excluding \(\top\) and \(\bot\) throughout. Witness coordinates can be inspected viawitness_points().Guarantee: With
structural_definitions=True, at margin \(m = 0\), zero sum of the structural box losses (gci0,gci0_bot,gci1,gci1_bot) and the existence term implies that the materialised regions form a geometric model of the box normal forms in which every satisfiable class and listed conjunction is non-empty (up to boundary contact \(w_m = 0\)); the converse holds when every active non-empty source slot (ingci0) or pair slot (ingci1) is covered by a single active target slot (see the Non-guarantees bullet below), while role normal forms inherit the Box²EL guarantees.Non-guarantees: In
gci2,gci3, andclass_assertion, masking out empty target slots means that an all-empty target (a target class \(D\) with no active non-empty slot) makes the target minimum fall back to0.0and renders the role or assertion score (or the target half ofgci2) vacuously0unless the existence term forces \(D\) to be non-empty; similarly, in the negative scoregci2_score_neg(), an all-masked (empty) source \(C\) makes the source half return0.0rather than \(\delta^2\) (and0.0overall when both source and target are all-masked). Because \(\top\) (owl:Thing) is excluded fromExistenceTargets, axioms with \(\top\) on the left-hand side are vacuous if \(\top\) collapses to an empty region. Furthermore,region_size()andpair_size()route gradient only through the argmax active slot or pair, and each non-empty source slot \(C_i\) ingci0or pair slot \(C_i \cap D_j\) ingci1must be covered by a single active target slot rather than a union of several target slots.
Re-seeding (:meth:`~mowl.nn.MultiBoxELModule.reseed`): Controlled by
reseed_every(reseed_every=0is the default, which disables re-seeding),reseed_mode({"dead", "idle"}, default"dead"),reseed_size(float = 0.15), andreseed_batch(int = 1); re-seeding is a heuristic discrete move rather than part of the continuous objective. Whenreseed_every > 0underobjective="structural", at the start of everyreseed_every-th epoch (epoch > 0),on_epoch_start()invokesreseed()undertorch.no_grad()on the raw embedding rows of primitive classes:reseed_mode="dead"(default):A primitive component \(i\) of \(C\) is classified as dead if it is nested inside another active valid component \(j\) of \(C\) (\(\text{lo}_j \le \text{lo}_i\) and \(\text{hi}_i \le \text{hi}_j\) in every coordinate, exact ties resolved by lower index) or has \(\min_m |o_{i,m}| < 10^{-3}\).
Violated pair targets \((C, D)\) (\(\text{NE}(C \sqcap D) < m\)) are processed in a seeded random order (seed
points_seed + epoch), using each dead component at most once per epoch: take a dead component of \(C\) if available, else of \(D\); let \(P\) be the partner class and \(P_j\) its active slot with largest \(\text{ne}(P_j) > 0\), and set \(c_i := c_{P_j}\), \(o_i := 0.5 \cdot |w_{P_j}|\).Violated primitive class targets (\(\text{NE}(C) < m\)) have the offset of their largest-measure component clamped to \(\max(|o|, m)\).
The number of moves is stored in
module.last_reseed_count; optimiser moments of moved rows are not reset.
reseed_mode="idle"(requireswitness_weight > 0, raisingValueErrorotherwise, and usesreseed_size: float = 0.15andreseed_batch: int = 1):Dead defined classes: accepted defined \(A\) with \(\text{NE}(A) = \max_{s \text{ active}} \text{ne}(A_s) < m\).
Usage counts \(u[X, c]\) over primitive \(X\) and component \(c\): number of accepted defined classes \(A'\) with \(\text{NE}(A') \ge m\) whose best slot (\(\arg\max \text{ne}\)) uses component \(c\) of \(X\), where the slot-to-component map (
slot_components()) follows the recursion ofclass_regions()/pair_slots()(a slot of \(A \to (X, Y)\) is a pair of a slot of \(X\) and a slot of \(Y\), recursing to primitives).Process dead defined classes in a seeded random order (
rng.permutation), at mostreseed_batchper call. For \(A\) with witness \(p\): for each primitive leaf \(X\) of \(A\)’s definition tree (deduplicated): if some active component \(c\) of \(X\) has \(\text{inside}(p, X_c) \ge m\), skip \(X\); else \(c^* = \arg\min_c u[X, c]\) (lowest index on ties), \(\text{center}[X, c^*] := p + 0.01 \cdot \mathcal{N}(0, I)\) (seeded throughrng), \(\text{offset}[X, c^*] := \text{reseed\_size}\) in every coordinate, \(u[X, c^*] \mathrel{+}= 1\). Count one move per re-seeded component.Keep step 3 of the
"dead"mode (clamp the largest component of a primitive class target with \(\text{NE} < m\) to \(\max(|o|, m)\)).module.last_reseed_countas before; optimiser moments are not reset.
Prisms (:class:`~mowl.models.PrismEL`, :class:`~mowl.nn.PrismModule`): Under
PrismEL(..., margin=0.1, objective="structural", max_depth=8, structural_definitions=True, existence_weight=1.0, size_reg=1e-3, canonical_model=None), each class is materialised as a single prismPrismRegions(h, cen, w)with support vector \(h \in \mathbb{R}^3\), box centre \(\text{cen} \in \mathbb{R}^{d-2}\), and signed box half-width \(w \in \mathbb{R}^{d-2}\). Non-emptiness is measured byprism_nonempty_measure(): \(\text{ne}(P) = \min(\sum_{k=1}^3 h_k,\; \min_m 2 w_m)\) (strictly positive iff non-empty; \(\sum_{k=1}^3 h_k = 3|\rho| \ge 0\) for primitive prisms). Definitions are evaluated recursively withprism_regions_intersection()(\(h = \min(h_X, h_Y)\) and signed box half-widths fromprism_intersection()); because intersecting two prisms yields a single prism, there is no slot blow-up (\(k = 1\)) and acceptance only requires acyclicity and \(\text{level} \le \text{max\_depth}\).Structural normal-form losses for PrismModuleNormal form
Structural prism loss (per row)
\(C \sqsubseteq D\) (
gci0,gci0_structural())\([\text{ne}(C) > 0]^{\text{det}} \bigl(\|\operatorname{relu}(h_C - h_D + m)\|_2^2 + \|\operatorname{relu}(|\text{cen}_C - \text{cen}_D| + w_C - w_D + m)\|_2^2\bigr)\) on signed widths \(w_C, w_D\) (equivalent to \(\text{prism\_inclusion\_score}(C, D, m)^2\) for non-negative widths; masked rows
0)\(C \sqsubseteq \bot\) (
gci0_bot,gci0_bot_structural())\(\operatorname{relu}(\text{ne}(C))^2\)
\(C \sqcap D \sqsubseteq E\) (
gci1,gci1_structural())\([\text{ne}(I) > 0]^{\text{det}} \bigl(\|\operatorname{relu}(h_I - h_E + m)\|_2^2 + \|\operatorname{relu}(|\text{cen}_I - \text{cen}_E| + w_I - w_E + m)\|_2^2\bigr)\) with \(I = C \cap D\) on signed widths \(w_I, w_E\) (equivalent to \(\text{prism\_inclusion\_score}(C \cap D, E, m)^2\) for non-negative widths), masked rows
0, and no emptiness penalties on \(C \cap D\) (the existence term owns them)\(C \sqcap D \sqsubseteq \bot\) (
gci1_bot,gci1_bot_structural())\(\operatorname{relu}(\text{ne}(C \cap D) + m)^2\)
gci2,gci3,gci3_bot, and assertionsExisting prism scores (
gci2_score_prisms(),gci2_score_neg_prisms(),gci3_score_prisms(),gci3_bot_score_prisms(),class_assertion_score_prisms(),object_property_assertion_loss()) on materialised prisms with|w|(unsquared norms/hinges)The existence term uses \(\text{NE}(C) = \text{ne}(C)\) and \(\text{NE}(C \sqcap D) = \text{ne}(C \cap D)\), and the size term averages \(|\rho|\) and \(2|o|\) over primitive classes (excluding \(\top\)). There is no re-seeding (single component). Under
objective="structural",PrismEL.compute_lossreturnspos_scores.mean()directly (without an outer squaring): only the box structural GCI losses (gci0,gci0_bot,gci1,gci1_bot) are squared hinges, whereas the prism role and assertion scores (gci2,gci3,gci3_bot,class_assertion,object_property_assertion) are unsquared norms/hinges that enter linearly (while still addingMSE(neg_scores.mean(), 1)whenneg_scoresis present).Prism non-guarantees: Because the prism role and assertion scores take \(|w|\) on materialised defined classes, a defined class that is empty only in its box part (\(w_m < 0\) in some coordinate while \(\sum_k h_k > 0\)) becomes a phantom non-empty box of half-width \(|w_m| > 0\) in
gci2,gci3, andclass_assertion. In addition,gci3_bot_score_prisms()(\(\operatorname{relu}(\sum_k h_{C,k} + m)\)) shrinks \(C\) itself, which conflicts with the existence term whenever \(C\) is satisfiable.
Public interface:
MultiBoxEL(dataset, ..., margin=0.02, objective="structural", max_components=None, structural_definitions=True, existence_weight=1.0, size_reg=1e-3, reseed_every=0, canonical_model=None, bot_agg="mean", witness_weight=0.0, reseed_mode="dead", reseed_size=0.15, reseed_batch=1)(wheremax_components=Nonedefaults to \(k^2\),bot_aggis"mean"or"sum",reseed_modeis"dead"or"idle", andcomponent_aggregationmust be"hard").PrismEL(dataset, ..., margin=0.1, objective="structural", max_depth=8, structural_definitions=True, existence_weight=1.0, size_reg=1e-3, canonical_model=None).Default
objective="axiom"leaves every existing code path unchanged. Negative sampling stays enabled underobjective="structural"just as in theobjective="axiom"path.Module region and table inspection:
MultiBoxELModule.class_regions(idx)\(\to\)Regions(cen (B, K, d), w (B, K, d), active (B, K))andMultiBoxELModule.all_class_regions()(detached on CPU);PrismModule.class_regions(idx)\(\to\)PrismRegions(h (B, 3), cen (B, d - 2), w (B, d - 2))andPrismModule.all_class_regions()(detached on CPU);module.definition_table(DefinitionTable),module.existence_targets(ExistenceTargets),module.top_idx, andmodule.margin(tightening margin under both models whenobjective="structural", passed asgamma = -marginto positive Box²EL role/assertion scores andgamma = +marginto negative Box²EL role/assertion scores: default0.02onMultiBoxELand0.1onPrismEL). Both models builddefinition_tableandexistence_targetsviabuild_structural_tables()at the start oftrain(), cache them on the model, and preserve them acrossinit_module(),load_best_model(), andfrom_pretrained().
Recommended settings for learning from random initialisation (witness-point recipe): On deep conjunction chains such as the Helly-obstruction family \(T_k\) (\(A_i \equiv \sqcap_{j \neq i} X_j\) with \(A_i \sqcap A_j \sqsubseteq \bot\)), the round-4 defaults (
bot_agg="mean", witness_weight=0.0, reseed_every=0, reseed_mode="dead", size_reg=1e-3) can fall into a component-assignment Helly trap: every live defined class selects the same component of each shared primitive \(X_j\) (reducing each \(A_i\) to a single box while spare components stay idle), and averaginggci1_botover \(4^{k-1}\) slot pairs dilutes the single overlapping pair against \(\text{existence\_loss}\). Combiningbot_agg="sum"(un-diluted disjointness penalties),witness_weight=1.0(one learnable witness point \(w_C\) per satisfiable class pushed inside its entailed superclasses and outside disjoint classes), andreseed_every=50..100, reseed_mode="idle", size_reg=0.0(relocating the least-used primitive leaf components of dead defined classes to their witness points with half-widthreseed_size=0.15) breaks the component-sharing symmetry and reliably finds exact multi-component box models from random initialisation. See the gallery tutorial Witness-Point Structural Training on the Helly Counterexample T_k for a self-contained demonstration and 2-D visualisations on \(T_3\) and \(T_5\).
References
V. Gutiérrez-Basulto and S. Schockaert, From Knowledge Graph Embedding to Ontology Embedding? An Analysis of the Compatibility between Vector Space Representations and Rules, in Proceedings of KR 2018 (arXiv:1805.10461), Propositions 3 and 4.
V. Lacerda, A. Ozaki, and R. Guimarães, Strong Faithfulness for ELH Ontology Embeddings, Transactions on Graph Data and Knowledge (TGDK) 2(3):2, 2024, Definitions 2, 8, 12 and Theorems 13, 16, 18, 25.
M. Leemhuis and O. Kutz, Understanding the Expressive Capabilities of Knowledge Base Embeddings under Box Semantics, in Proceedings of NeSy 2025 (PMLR 284:303–321), Definitions 1, 3, 6 and Propositions 4, 5, 8.
M. Leemhuis and O. Kutz, Trustworthy Knowledge Base Embeddings: A Foundational Study of Box Semantics, Neurosymbolic Artificial Intelligence (NAI), 2026, Proposition 38 (incompleteness of ABox-closure Helly tests in the presence of roles).
G. Federico, M. Leemhuis, and O. Kutz, Introducing Multiboxes: Increasing the Trustworthiness of Ontology Embeddings, in Proceedings of JOWO 2026 (OSETAI workshop), Theorem 3 (1-D case).
G. Federico, M. Leemhuis, and O. Kutz, Introducing Prism Embeddings, in Proceedings of DL 2026, §3–4.
C. Bourgaux, R. Guimarães, R. Koudijs, V. Lacerda, and A. Ozaki, Knowledge Base Embeddings: Semantics and Theoretical Properties, in Proceedings of KR 2024, Definitions 5–6 and Remark 2.
Y. Kazakov, M. Krötzsch, and F. Simančík, The Incredible ELK: From Polynomial Procedures to Efficient Reasoning with EL Ontologies, Journal of Automated Reasoning 53(1):1–61, 2014.
F. Baader, S. Brandt, and C. Lutz, Pushing the EL Envelope, in Proceedings of IJCAI 2005.
J. Eckhoff, Intersection properties of boxes. Part I: An upper-bound theorem, Israel Journal of Mathematics 62(3):283–301, 1988.
Development setup
To work on mowl.geometric from a source checkout (Python 3.8–3.11; Java
and Gradle for the gateway jars):
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip wheel
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -e .
pip install "class-resolver<0.5.0" # needed by pykeen 1.10.1
pip install pytest
./build_jars.sh # builds mowl/lib/*.jar
python -m pytest -m "not slow" -p no:faulthandler tests/geometric -q
Slow tests (e.g. the randomised differential test against ELK) run without
-m "not slow".
- Worked examples
- Canonical model (TBox and ABox: nominal encoding and instance checking)
- The \(T_3\) Helly-obstruction ontology
- Constructing and exporting a box model on a Helly-satisfiable ontology
- Initialising box embeddings from the exact model
- MultiBoxEL on \(T_3\)
- MultiELBE on the Family ontology
- PrismEL on the Family ontology
- CanonicalMixture on a tiny ABox knowledge base
- Soft component aggregation and diversity regularisation
- Canonical-element point supervision
- Structural objective on \(T_3\)
- mowl.geometric API reference
- Normal forms and normalisation (TBox, RBox, and ABox)
- Completion and canonical model (TBox, RBox, and ABox)
- Geometric region types
- Geometric model checker
- Convex polyhedral model
- Interval-union model
- Helly-satisfiability check
- Axis-parallel box model builder
- Embedding exports
- Exact-model box initialisation and anchor
- Shared multi-box utilities
- MultiBoxEL neural module and losses
- MultiBoxEL model
- MultiELBE neural module and losses
- MultiELBE model
- Prism neural module and losses
- PrismEL model
- Canonical membership structure
- CanonicalMixture neural module
- CanonicalMixture model
- Soft component aggregation and diversity regularisation
- Canonical-element point supervision and losses
- Structural region algebra, definition tables, and losses
- Exceptions