WorksComputer Science
NIR: Approximate Neural Instance Retrieval for ALCIQ
Abstract
Instance retrieval is the main bottleneck of concept-learning systems based on refinement operators. We present NIR, a family of neural instance retrievers for ALCIQ that output graded membership scores from knowledge graph embeddings. We compare tokenization-based encoders (GRU, LSTM, Transformer) with a Compositional encoder that mirrors DL operators via primitive sub-networks. On eight benchmarks, all variants approximate Pellet closely on complete knowledge bases, while the Transformer model is most robust under incompleteness. The source code of our approach is at https://github.com/dice-group/owlapy.
Introduction
Class expression learning (CEL) Lehmann et al. [21]; Kouagou [18], also known as concept learning, allows for explainable node classification on RDF knowledge graphs (KGs). Given a set of positive and a set of negative examples, CEL approaches learn a concept in a description logic (DL) that describes (ideally all) positive examples while excluding as many negative examples as possible Demir and Ngomo [7]; Kouagou [18]. For instance, is a concept in the DL which describes the skills of machines in Industry 4.0 Demir et al. [8]. Individuals (e.g., machines) are classified as positive if they have at least four wheels, support WiFi, and can move at least one object. Importantly, these skills are directly encoded into the syntactic representation of the class expression and are both human-readable (e.g., , ) and machine-readable (see Table 1 for semantics of description logics). Consequently, concepts are white-box models Kouagou [18] and hence well suited for the implementation of explainable AI pipelines.
| Construct | Syntax | Semantics |
| Top concept | ||
| Bottom concept | ||
| Atomic concept | ||
| Negation | ||
| Conjunction | ||
| Disjunction | ||
| Universal role restriction | ||
| Existential role restriction | ||
| Min. cardinality restriction | ||
| Max. cardinality restriction | ||
| Exact cardinality restriction |
Table 1. Syntax and Semantics of . is an interpretation.
Most existing approaches for CEL are search-based and rely on symbolic reasoners (e.g., Pellet Sirin et al. [26] and HermiT Glimm et al. [11]Karalis et al. [15]; Sarker and Hitzler [23]. This is because a reasoner is invoked repeatedly to retrieve instances of class expressions during CEL—typically, thousands of invocations are required to solve a learning problem. Another inherent limitation of symbolic reasoners is their inability to deal with incompleteness in data {citet}Teyou et al. [27]}—they lack native support for approximate reasoning when assertions are missing.
During CEL, each candidate concept must therefore be evaluated by deciding, for many individuals, whether they are instances of that concept. To make this concrete, consider the Animals benchmark from DL-Learner, one of the eight knowledge bases used in our evaluation. Its ABox contains 20 atomic assertions such as and ; names like animals#eel01 refer to individual eel01 in the benchmark namespace. The TBox defines taxonomic and property constraints, e.g.,
A CEL system may ask whether eagle01 is an instance of a complex candidate concept such as . A symbolic retriever answers from what is entailed by the available axioms under standard DL semantics. When ABox assertions are randomly removed to simulate incompleteness (§ 5), exact retrieval can miss individuals whose supporting evidence is absent, whereas knowledge graph embeddings can encode regularities across individuals and relations that remain informative under missing assertions.
Several approaches aim to reduce the overall cost of CEL, including pruning Lehmann et al. [21], neural class expression synthesizers (NCES) Kouagou et al. [19], ECII Sarker and Hitzler [23], and semantics-aware caching Teyou et al. [28]. NCES use neural networks to directly synthesize solutions to learning problems without a search process, but require pretraining data that is itself constructed with symbolic reasoners. ECII invokes a reasoner only once to materialize an input knowledge base, then constructs candidate solutions from role fillers and Boolean operators, yet with limited expressiveness. None of these approaches replace the repeated instance retrieval step with a fast, embedding-based retriever that remains effective on incomplete knowledge bases.
In this work, we investigate neural networks and knowledge graph embeddings for approximate, scalable instance retrieval. We introduce NIR, a family of retrievers for that estimate given a concept and an individual . Rather than committing to a single architecture, we compare tokenization-based models (GRU, LSTM, Transformer), which read the syntax of as a token sequence, with a Compositional model that encodes DL operators through dedicated sub-networks. Our evaluation on eight datasets shows that all variants achieve high agreement with Pellet on complete knowledge bases, but they differ in speed, robustness to incompleteness, and extensibility.
The rest of the paper is organized as follows. § 2 presents the necessary background for understanding the paper. In § 3, we describe related works and highlight their strengths and weaknesses. In § 4, we present our approach for robust instance retrieval, and experimental results in § 5. § 6 concludes the paper.
Background
Description Logics and Reasoning
Description logics are a family of languages for formal representation of knowledge Baader [1]; Kouagou [18]. They have applications in artificial intelligence, the semantic web, bio-informatics, and automated reasoning Kouagou [18]. In this work, we target the description logic which extends the well-known and widely adopted tributive Language with Complements () by adding qualified number restrictions and inverse roles. Let be a named concept, a named role, and a natural number with . Concepts in can be built as follows:
, , are concepts,
If is an abstract role, then is also a role (inverse role),
If , are concepts and a role, then the following are concepts: , , , , , , , and
The syntax and semantics of are presented in Table 1. In the table, and are individuals, is an interpretation, where is the interpretation function and the domain. Reasoning in expressive DLs is computationally expensive Kazakov
(2008). Additionally, real-world DL knowledge bases (e.g., DBpedia, Wikidata) are large and often incomplete, prompting the need for more robust and scalable reasoning engines for practical applications. Existing DL reasoners such as HermiT Glimm et al. [11] and Pellet Sirin et al. [26] implement hard-coded heuristics (e.g., the hyper-tableau algorithm) for reasoning. They cannot infer plausible assertions that are not directly entailable by the considered knowledge base, which can be a shortcoming on incomplete knowledge bases. The approach we propose herein supports approximate reasoning and can inherently handle incomplete DL knowledge bases by leveraging knowledge graph embeddings.
Knowledge Graph Embeddings
Knowledge graphs are graph-structured knowledge bases intended to gather and convey knowledge of the real world, with nodes and edges representing entities and relation types, respectively Hogan et al. [13]. To facilitate downstream applications, knowledge graphs are embedded into vector spaces such as Bordes et al. [2], Trouillon et al. [29], or even Clifford spaces Kamdem Teyou et al. [14]. This is often achieved by using a knowledge graph embedding (KGE) model to map entities and relation types to vectors such that most relationships within the original graph are retained. Most importantly, the KGE model allows for new links to be inferred using scoring functions, which is essential for knowledge completion Shen et al. [25]. KGEs also have applications in explainable AI. For instance, NCES Kouagou et al. [19] and Drill Demir and Ngomo [7] leverage knowledge graph embeddings to tackle CEL at scale. Our proposed approach employs KGEs the same way for robust and scalable instance retrieval, see § 4.
Related Work
Several recent studies have investigated generating ontology embeddings Chen et al. [4]. However, most of them do not support instance retrieval queries or are limited only to atomic concepts. Other works explored representing description logic concepts as geometrical shapes, e.g., boxes, roles as affine transformations, individuals as points, and then jointly training the resulting model Xiong et al. [32]. Yet, these works support only the lightweight DL , focus on learning concept inclusions, and are not extensively evaluated on instance retrieval.
For expressive DLs such as , approaches focusing primarily on ontology satisfiability have been proposed Özçep et al. [22]. The core aim of these approaches is to show that an ontology is satisfiable if and only if it admits a satisfying geometrical structure. For instance, Özçep et al. [22] proposed to use al-cones, i.e., sets of the form with , to represent concepts in , but it is unclear how instances of these concepts can be retrieved. Other works such as Chen et al. [3] map OWL ontologies to RDF knowledge graphs and employ random walks and Word2Vec Church [6] to learn class subsumptions, without specifying how instance retrieval can be performed.
To overcome the runtime limitations of instance retrieval engines, Teyou et al. [28] proposed a semantics-aware caching algorithm. Their approach employs a subsumption-aware cache that maps concepts to instance sets using crisp set operations. ECII Sarker and Hitzler [23] proposed to use an instance retrieval engine only once to fully materialize a given knowledge base before class expression learning. Afterwards, candidate class expressions for each learning problem are constructed by strategically applying role restrictions and conjunction/disjunction operators following membership information of input examples and their relationships to other individuals in the materialized knowledge base. The embedding-based reasoner (EBR) Teyou et al. [27] uses knowledge graph embedding models and description logic semantics to translate the instance retrieval problem into complex query answering over an input knowledge base. While this approach supports approximate reasoning as ours, it is computationally intensive on large datasets and often fails on long class expressions as suggested by our experimental results.
Proposed Methods
We study two encoder designs for NIR. Tokenization-based models treat a concept as a token sequence and are our default choice in experiments when knowledge bases may be incomplete. The Compositional model instead composes primitive networks according to the logical structure of ; it tracks Pellet closely on complete knowledge bases and can be extended with new sub-networks for additional constructors, but relies on Pellet to encode atomic concepts.
Tokenization-based Approaches
Tokenization-based models use the same configurable embedding dimension as the Compositional retriever; in our experiments, , with hidden size 128, max sequence length 128, vocabulary size 512, and dropout 0.1. A concept is tokenized (byte-pair encoding Sennrich et al. [24]) and mapped to token embeddings .
RNN-based Approach.
Three GRU or LSTM layers Cho et al. [5]; Hochreiter and Schmidhuber [12] are followed by two linear layers. Given hidden states and individual embedding ,
where Lin denotes linear layers with GELU activation, and the probability that individual is an instance of the given concept .
Transformer-based Approach.
A 3-layer Transformer encoder Vaswani et al. [30] with 4 heads applies positional encoding to token embeddings, uses average pooling to obtain , and concatenates with before the same two linear layers as above.
Compositional Neural Instance Retriever
The semantics of can be reduced to a small set of primitives. The binary connective NAND Frank [10], defined by , is functionally complete for the Boolean constructors: negation is , union is , and intersection follows via De Morgan as . Together with role inversion and cardinality restrictions, we obtain a Compositional retriever that mirrors the syntax of through primitive sub-networks. New constructors can be supported by adding further sub-networks without retraining the entire model.
We assume a KGE model that maps each individual and role to vectors , where is the embedding dimension of the chosen KGE model and can be set to any value supported by that model (we use in our experiments). Table 2 summarizes the notation used in this section. The encoder composes three primitive maps , , and (GELU feed-forward, hidden size 128); each is implemented as a neural module —for example, —where is the scoring head that returns a logit for . Atomic concepts are mapped as , where is Pellet Sirin et al. [26], is PMA Lee et al. [20], , and returns all individuals. Let denote the outermost primitive in the parse tree of . We then define as an estimate of .
| Symbol | Meaning |
| embedding of concept (composition of , , ) | |
| a, R | KGE vectors for individual and role |
| , | instance set from Pellet; PMA pooling over all a’s from |
| primitive maps used in | |
| , , | neural modules (map and scoring head) |
| scoring head of primitive (logit for ) | |
| outermost primitive in the parse tree of (one of ) |
Table 2. Notation for the Compositional retriever (our experiments use , hidden size 128, dropout 0.1, threshold ).
Complex concepts are mapped recursively by ; denotes the KGE vector of role . Table 3 lists the non-Boolean cases; , , and follow from via the reductions at the start of this section. Each row reduces an constructor to the primitive maps , , and . Universal restrictions use , implemented as . Existential and at-least- restrictions are cardinality-based: , and for we have ; the case is since every individual is either -linked to at least one individual of type or to exactly 0 individuals of type . Accordingly, and apply to two copies of the same output—the same pattern as , because each applies a negated -restriction. Role inversion uses ; is handled directly by . PMA is pretrained on atomic concepts using positive instances and sampled non-members ; we use to separate them. Complex concept embeddings are then obtained by composing the rules in Tables Table 2 and Table 3.
| Constructor | |
| , | |
Table 3. Recursive definition of .
Scoring Technique.
Each neural module applies to obtain a -dimensional concept embedding. At inference, only is used: NIR, where is the sigmoid activation function.
The main network directly integrates the symmetry and monotonicity properties of and , respectively. Specifically, the monotonicity of (i.e., the concept is always subsumed by ) is ensured by adding to output logits before the final probability score is computed for a given individual. The symmetry of is obtained by summing the hidden representations of its arguments.
Below, only the maps are used, since we do not score an individual yet.
Example 1
The embedding of Example 1 (a club with at least two superstar footballers) is computed by as follows.
a. : .
b. : .
c. .
d. .
The vector is scored as , where for this concept. Because delegates atomic concepts to Pellet, the Compositional model tends to reproduce symbolic retrieval on complete knowledge bases but inherits Pellet’s sensitivity to missing assertions.
Experiments
Experimental Setup
We conducted instance retrieval experiments on 8 datasets to evaluate the performance of our approach: Semantic Bible Kouagou et al. [19], Animals, Carcinogenesis, Lymphography, Mutagenesis, Nctrer, Suramin Westphal et al. [31], and Family Demir and Ngomo [7]. These datasets span a diverse range of domains, such as familial relationships, chemical compound interactions, disease diagnosis, and zoological taxonomies.
Three sets of experiments are considered. The first set concerns instance retrieval on complete knowledge bases (i.e., original datasets), where all our neural instance retrievers use DeCaL embeddings; symbolic baselines and ground-truth labels are obtained with Pellet Sirin et al. [26]. The second set of experiments uses subsets of the original knowledge bases where ABox assertions are randomly deleted. Every deleted assertion either relates an individual to a concept (i.e. of the form ) or represents a relationship between two individuals. A hyperparameter specifies the fraction of ABox assertions retained; the fraction removed is . As such, the constructed subsets of knowledge bases lack critical information for determining the true sets of instances of given class expressions, and we use them to assess the effectiveness of our proposed approach. The third experiment retrains GRU and Transformer with TransE Bordes et al. [2] embeddings—a simpler, lower-expressiveness alternative—on complete knowledge bases (§ 5.5).
In Table 4, we present the dataset statistics. Example 2 illustrates the structure of the Animals benchmark; the other datasets follow the same DL-Learner format (TBox axioms plus an ABox of typed individuals and role assertions).
| Animals | Carcinogenesis | Family | Lymphography | Mutagenesis | Nctrer | Semantic Bible | Suramin | |
| 39 | 142 | 18 | 49 | 86 | 37 | 48 | 46 | |
| 2 | 4 | 4 | 0 | 5 | 9 | 29 | 3 | |
| 20 | 22372 | 202 | 148 | 14145 | 10209 | 724 | 2979 | |
| Train | 2983 | 20877 | 3484 | 3368 | 10556 | 4231 | 16000 | 2946 |
| Test | 746 | 5220 | 872 | 842 | 2640 | 1058 | 4000 | 737 |
Table 4. Evaluation datasets. , , and are the numbers of named concepts, named roles, and individuals, respectively.
Example 2 (Animals benchmark) The Animals knowledge base comprises a TBox with 39 named concepts, two object roles (, ), and one datatype role (), together with an ABox of 20 individuals. Each individual is typed with a single atomic concept in the ABox (e.g., ); further properties are specified in the TBox via concept definitions. Table 5 lists all individuals. At test time, NIR receives a complex concept and an individual , and returns a score . Retrieval quality is measured by
| Individual | Type | Individual | Type |
animals#bat01 | Bat | animals#lizard01 | Lizard |
animals#boy01 | Boy | animals#ostrich01 | Ostrich |
animals#cat01 | Cat | animals#penguin01 | Penguin |
animals#croco01 | Crocodile | animals#platypus01 | Platypus |
animals#dog01 | Dog | animals#shark01 | Shark |
animals#dolphin01 | Dolphin | animals#snake01 | Snake |
animals#dragon01 | Dragon | animals#trex01 | T-Rex |
animals#eagle01 | Eagle | animals#trout01 | Trout |
animals#eel01 | Eel | animals#turtle01 | Turtle |
animals#girl01 | Girl | animals#herring01 | Herring |
Table 5. Individuals in the Animals benchmark. The prefix animals# denotes the DL-Learner namespace.
comparing the set of individuals predicted above a threshold against the ground-truth instance set computed by Pellet Sirin et al. [26] on the complete knowledge base.
Training and test data are generated using a deterministic algorithm. The algorithm iterates through atomic concepts and role names, computes negated concepts and inverse roles, and constructs all description logic expressions in with a length1 of at most 15 (experimental choice) to prevent an excessive number of expressions. Also, note that we discard class expressions with empty instance sets, which leaves us with expressions of length at most 9 (see Figure 1). The training sets are then further split into two subsets: 90% for training and 10% for validation. We used DeCAL Kamdem Teyou et al. [14] to compute embeddings for individuals and roles. Full training hyperparameters are listed in Appendix § 7 (Table 7).

Figure 1. Average Jaccard scores by class expression length for different model architectures. Markers (disc, square, triangle, pentagon) indicate the actual performance for each architecture.
| Setting | Value |
| Optimizer | Adam, learning rate |
| LR schedule | Cosine annealing |
| Epochs | 400 (no early stopping) |
| Batch size | 256 |
| Train/validation split | 90% / 10% |
| Embedding dimension | 256 |
| Hidden size | 128 |
| Dropout | 0.1 |
| Classification threshold | 0.5 |
| Max sequence length | 128 |
| Vocabulary size | 512 |
| RNN layers (GRU/LSTM) | 3 |
| Transformer layers / heads | 3 / 4 |
| Hardware | NVIDIA H100-40GB, Ubuntu 22.04 |
Table 7. Shared training hyperparameters for all NIR variants.
Evaluation Metrics and Hardware
To evaluate the effectiveness of our approach in retrieving instances across different datasets, we employ two standard metrics: the Jaccard similarity (Jac) and the F1 score. These metrics compare the set of retrieved instances, denoted by , against the ground truth set . They offer a measure of how closely the predicted instance sets match ground truths, which are obtained with Pellet Sirin et al. [26]. These two metrics are defined as follows:
In addition to retrieval accuracy, we also assess the computational efficiency of our approach, namely the retrieval runtime. All experiments were run on a Ubuntu 22.04 server equipped with a single NVIDIA H100-40C with 40GB VRAM and 16 Intel Xeon Platinum 8462Y+ CPUs @ 2.8 GHz. Our neural instance retrievers are lightweight, consuming only 1.2 to 3 GB of GPU VRAM during training with a batch size of 256.
Main Results and Discussion
Table 6 reports retrieval accuracy and runtime on complete knowledge bases (bold and underlined entries mark the best and second-best scores per row). No single architecture dominates every dataset: the Transformer attains the highest Jaccard on Carcinogenesis, Family, and Lymphography, the Compositional model leads on Animals, Nctrer, Semantic Bible, and Suramin, and GRU is best on Mutagenesis. Across architectures, Jaccard w.r.t. Pellet Sirin et al. [26] ranges from 69.1% (LSTM on Suramin) to 99.4% (Compositional on Animals), indicating that neural retrievers can approximate exact symbolic retrieval on complete knowledge bases.
Table 6: Retrieval results across all datasets. For each dataset, we report Jaccard, -score, and relative (%). The asterisk (*) indicates that the runtime difference between the respective model and Pellet is statistically significant (Wilcoxon signed-rank test, ). is ; values outside are shown as <-1000 or >1000. Hence, positive indicates that an approach is faster than Pellet. Empty entries for EBR indicate that it did not complete within 96 hours.
| Dataset | Metric | Compositional Transformer | GRU | LSTM | EBR | |
| Animals | Jaccard | 0.994 | <u>0.989</u> | 0.981 | 0.841 | 0.198 |
| Animals | -score | 0.995 | <u>0.992</u> | 0.986 | 0.854 | 0.309 |
| Animals | (%) | -100* | <u>-75*</u> | -50* | -150* | <-1000* |
| Carcinogenesis | Jaccard | 0.871 | 0.937 | <u>0.894</u> | 0.802 | – |
| Carcinogenesis | -score | 0.917 | 0.952 | <u>0.933</u> | 0.871 | – |
| Carcinogenesis | (%) | -78.2* | -5.5* | 33.8* | <u>-5.3*</u> | – |
| Family | Jaccard | <u>0.909</u> | 0.939 | 0.785 | 0.698 | 0.401 |
| Family | -score | <u>0.942</u> | 0.959 | 0.856 | 0.787 | 0.525 |
| Family | (%) | -36.8* | <u>5.3*</u> | 29.4* | 0* | <-1000* |
| Lymphography | Jaccard | 0.921 | 0.986 | 0.793 | 0.691 | <u>0.983</u> |
| Lymphography | -score | 0.951 | 0.991 | 0.860 | 0.781 | 0.987 |
| Lymphography | (%) | <u>-114.3*</u> | -200* | -100* | -233.3* | -666.7* |
| Mutagenesis | Jaccard | 0.888 | 0.897 | 0.919 | 0.825 | – |
| Mutagenesis | -score | <u>0.921</u> | 0.917 | 0.941 | 0.875 | – |
| Mutagenesis | (%) | 40.9* | <u>66.4*</u> | 73.5* | 62.3* | – |
| Nctrer | Jaccard | 0.972 | <u>0.912</u> | 0.905 | 0.845 | 0.003 |
| Nctrer | -score | 0.980 | 0.925 | <u>0.927</u> | 0.872 | 0.005 |
| Nctrer | (%) | 44.3* | <u>80.8*</u> | 87.6* | 80* | <-1000* |
| Semantic Bible | Jaccard | 0.978 | <u>0.924</u> | 0.904 | 0.888 | 0.043 |
| Semantic Bible | -score | 0.982 | <u>0.934</u> | 0.923 | 0.910 | 0.060 |
| Semantic Bible | (%) | -44.7* | 59.6* | 74.5* | <u>61.7*</u> | -936.2* |
| Suramin | Jaccard | 0.947 | <u>0.875</u> | 0.770 | 0.691 | 0.409 |
| Suramin | -score | 0.962 | <u>0.890</u> | 0.829 | 0.761 | 0.483 |
| Suramin | (%) | 42.9 | 63.2* | 77.7* | <u>65.2*</u> | <-1000* |
Table 6. Retrieval results across all datasets.
Figure 1 shows performance by concept length. Tokenization-based models are more sensitive to length and surface syntax, whereas the Compositional model remains stable on long expressions because each operator is handled by a fixed sub-network. This stability comes at a cost: by encoding atomic concepts through Pellet, the Compositional model behaves like a differentiable surrogate of symbolic retrieval and is less robust when assertions are removed (§ 5.4).
In comparison to the baseline EBR, we can observe that our neural instance retrievers are clearly better on most datasets except for the Lymphography dataset, where EBR achieves a slightly higher Jaccard similarity than the Compositional, GRU and LSTM architectures. Additionally, the performance of EBR doesn’t generalize well across datasets, as it achieves a Jaccard similarity of 98.3% on the Lymphography dataset, but only 0.3% on the Nctrer dataset. The poor performance of EBR is likely due to its high dependency on the quality of the representations learned by the embedding models to perform reasoning tasks, which can be challenging when dealing with complex concepts and large datasets. On the other hand, our neural retrievers can generalize better across different datasets, leading to more consistent performance. In Table 6, we can also see that EBR is computationally intensive on large datasets, as it fails to complete within 96 hours on the Mutagenesis and Carcinogenesis datasets, while our neural retrievers completed in less than 3 minutes on these datasets.
Overall, tokenization-based encoders offer the best balance of accuracy and robustness for CEL pipelines: the Transformer is the most accurate on Carcinogenesis, Family, and Lymphography, and GRU offers the fastest inference. The Compositional model is competitive on complete knowledge bases and is preferable when new DL constructors must be added via modular sub-networks rather than retraining a sequence model. Beyond these aggregate metrics, every NIR variant returns a graded membership score rather than a binary yes/no decision. We illustrate this behavior on the Animals test set with the Transformer, our strongest tokenization-based retriever on several benchmarks (see Inference.ipynb2):
NIR(Penguin hasCovering.Feathers, animals#eagle01) = 0.999,
NIR(Eel Bird, animals#eel01) = .
These scores match our expectations: an eagle is not a penguin and is covered with feathers, and an eel is an instance of the class Eel, which is disjoint with . Tokenization-based encoders can nonetheless be sensitive to surface syntax. The two cases below show that removing parentheses from an otherwise equivalent expression changes Transformer predictions substantially:
Regarding runtimes, our neural instance retrievers are highly competitive, especially on large datasets. Relative speedups (see in Table 6) show that NIR is often substantially faster than Pellet on Carcinogenesis, Family, Mutagenesis, Nctrer, Semantic Bible, and Suramin, while Pellet remains faster on the smallest benchmarks (Animals and Lymphography). This is due to the fact that neural networks are generally fast at inference time since their prediction mechanisms are mostly based on efficient matrix operations, which can further be accelerated on GPUs. Wilcoxon signed-rank tests confirm these differences are statistically significant () in most cases, except for the Compositional model on Suramin. Among our models, GRU attains the largest relative speedups on most medium-to-large datasets, followed by the Transformer, LSTM, and Compositional architectures. EBR is comparatively much slower than our neural retrievers and Pellet (Table 6).
Most importantly, our approach allows to predict the likelihood that a given individual is an instance of a concept, which is not supported by existing instance retrieval engines. This can be particularly useful when dealing with incomplete knowledge bases. In this case, a user may set a threshold on output probability scores to decide which new assertions to accept and add to an original knowledge base. For example, the assertion , where , can be added to a reference knowledge base if our approach predicts a score higher than the given threshold, i.e., when our approach predicts a score higher than a set threshold. Our approach hence lies between the closed and open-world assumptions Drummond and Shearer [9], where the truth value of assertions is parameterized by the learned model weights and . For incomplete knowledge bases, we recommend a tokenization-based NIR—in our experiments, the Transformer—over the Compositional variant.
Results on Incomplete Knowledge Bases
As mentioned in the experimental setup section, we evaluate NIR on incomplete knowledge bases where random ABox assertions are removed. Figure 2 reports average Jaccard similarity for all eight datasets at retention levels ; the point uses the complete-knowledge-base scores from Table 6. Tokenization-based encoders—especially the Transformer—remain competitive with or outperform Pellet under incompleteness on several benchmarks (e.g., Semantic Bible, Nctrer, and Suramin), while Pellet and the Compositional model degrade as more assertions are removed. On Family, Lymphography, and Carcinogenesis, all approaches decline more sharply, which is consistent with smaller or sparser ABoxes (Table 4). Across datasets, the Compositional curves track Pellet closely, confirming that this encoder is the nearest neural surrogate of symbolic retrieval and therefore less robust when assertions are missing. Tokenization-based NIR should therefore be preferred when knowledge bases may be incomplete.

Figure 2. Average Jaccard for instance retrievers at different incompleteness levels across all eight datasets. is the fraction of ABox assertions retained (); the horizontal axis shows , the fraction removed. At , scores are taken from the complete knowledge bases (Table 6). Ground-truth instance sets are computed with Pellet on the original complete knowledge bases.
Results with TransE Embeddings
To assess whether NIR depends on a specific embedding method, we retrained the GRU and Transformer retrievers with TransE embeddings Bordes et al. [2] on complete knowledge bases, keeping all other hyperparameters identical to the main DeCaL experiment (Table 6). Figure 3 compares average Jaccard for both embedding methods.

Figure 3. Average Jaccard on complete knowledge bases for GRU and Transformer with TransE and DeCal embeddings.
On most datasets, both architectures remain competitive when paired with the simpler TransE embeddings (Figure 3). The main exception is Carcinogenesis, where GRU drops from 89.4% (DeCal) to 48.3% (TransE), suggesting that large, sparse knowledge bases may benefit from more expressive embeddings. The Transformer is less sensitive to the embedding choice and attains higher Jaccard with TransE than with DeCal on four datasets: Nctrer (95.4% vs. 91.2%), Semantic Bible (96.1% vs. 92.4%), Suramin (94.6% vs. 87.5%), and Animals (99.0% vs. 98.9%). Overall, medium-sized benchmarks are relatively insensitive to the embedding choice, whereas scale and expressiveness matter more for the largest datasets.
Conclusion
In this paper, we introduced NIR, a family of neural instance retrievers for , and compared tokenization-based encoders with a Compositional design on eight benchmarks. All variants approximate Pellet closely on complete knowledge bases and are substantially faster at inference. Our main empirical finding is architectural: tokenization-based models—especially the Transformer—generalize better on large and incomplete knowledge bases, whereas the Compositional model tracks symbolic retrieval on complete knowledge bases and supports modular extension to new DL constructors. For CEL pipelines, we recommend a tokenization-based NIR by default, reserving the Compositional design for settings that require operator-level extensibility. Probabilistic outputs further allow graded assertion acceptance and trade-offs between closed- and open-world reasoning via a user-defined threshold .
Experimental Details
Table 7 summarizes the shared training configuration (, hidden 128, dropout 0.1, ; vocabulary 512, max length 128; Transformer: 3 layers / 4 heads).
References
- [1]Franz Baader. The description logic handbook: Theory, implementation, and applications. Cambridge university press, 2003.DOI
- [2]Antoine Bordes, Nicolas Usunier, Alberto García-Durán, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In NIPS, pages 2787–2795, 2013.
- [3]Jiaoyan Chen, Pan Hu, Ernesto Jimenez-Ruiz, Ole Magnus Holter, Denvar Antonyrajah, and Ian Horrocks. Owl2vec*: Embedding of owl ontologies. Machine Learning, 110(7): 1813–1845, 2021.arxiv.org/abs/2009.14654
- [4]Jiaoyan Chen, Olga Mashkova, Fernando Zhapa-Camacho, Robert Hoehndorf, Yuan He, and Ian Horrocks. Ontology embedding: a survey of methods, applications and resources. IEEE Transactions on Knowledge and Data Engineering, 2025.DOI
- [5]Kyunghyun Cho, Bart van Merrienboer, Çağlar Gülçehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. In EMNLP, pages 1724–1734. ACL, 2014.arxiv.org/abs/1406.1078
- [6]Kenneth Ward Church. Word2vec. Natural Language Engineering, 23(1):155–162, 2017.DOI
- [7]Caglar Demir and Axel-Cyrille Ngonga Ngomo. Neuro-symbolic class expression learning. In IJCAI, pages 3624–3632, 2023.DOI
- [8]Caglar Demir, Anna Himmelhuber, Yushan Liu, Alexander Bigler, Diego Moussallem, and Axel-Cyrille Ngonga Ngomo. Rapid explainability for skill description learning. In ISWC (Posters/Demos/Industry), 2022.
- [9]Nick Drummond and Rob Shearer. The open world assumption. In eSI workshop: the closed world of databases meets the open world of the semantic web, volume 15, page 1, 2006.
- [10]Ronald I Frank. A review of logic for computer professionals. 2004.
- [11]Birte Glimm, Ian Horrocks, Boris Motik, Giorgos Stoilos, and Zhe Wang. Hermit: an owl 2 reasoner. Journal of automated reasoning, 53:245–269, 2014.DOI
- [12]Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Comput., 9(8): 1735–1780, 1997.
- [13]Aidan Hogan et al. Knowledge graphs. ACM Comput. Surv., 54(4):71:1–71:37, 2022. doi: 10.1145/3447772.DOI
- [14]Louis Mozart Kamdem Teyou, Caglar Demir, and Axel-Cyrille Ngonga Ngomo. Embedding knowledge graphs in degenerate clifford algebras. In ECAI 2024, pages 1293–1300. IOS Press, 2024.arxiv.org/abs/2402.04870
- [15]Nikolaos Karalis, Alexander Bigler, Caglar Demir, Liss Heidrich, and Axel-Cyrille Ngonga Ngomo. Evaluating negation with multi-way joins accelerates class expression learning. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 199–216. Springer, 2024.DOI
- [17]N’Dah Jean Kouagou, Stefan Heindorf, Caglar Demir, and Axel-Cyrille Ngonga Ngomo. Learning concept lengths accelerates concept learning in ALC. In ESWC, volume 13261 of Lecture Notes in Computer Science, pages 236–252. Springer, 2022.arxiv.org/abs/2107.04911
- [18]N’Dah Jean Kouagou. Fast neuro-symbolic approaches for class expression learning. 2025.DOI
- [19]N’Dah Jean Kouagou, Stefan Heindorf, Caglar Demir, and Axel-Cyrille Ngonga Ngomo. Neural class expression synthesis. In European Semantic Web Conference, pages 209–226. Springer, 2023.DOI
- [20]Juho Lee, Yoonho Lee, Jungtaek Kim, Adam R Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer. In International Conference on Machine Learning, volume 4, 2019.
- [21]Jens Lehmann, Sören Auer, Lorenz Bühmann, and Sebastian Tramp. Class expression learning for ontology engineering. J. Web Semant., 9(1):71–81, 2011.DOI
- [22]Özgür Lütfü Özçep, Mena Leemhuis, and Diedrich Wolter. Cone semantics for logics with negation. In IJCAI, pages 1820–1826, 2020.DOI
- [23]Md Kamruzzaman Sarker and Pascal Hitzler. Efficient concept induction for description logics. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 3036–3043, 2019.arxiv.org/abs/1812.03243
- [24]Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. arXiv preprint arXiv:1508.07909, 2015.arxiv.org/abs/1508.07909
- [25]Tong Shen, Fu Zhang, and Jingwei Cheng. A comprehensive overview of knowledge graph completion. Knowledge-Based Systems, 255:109597, 2022.DOI
- [26]Evren Sirin, Bijan Parsia, Bernardo Cuenca Grau, Aditya Kalyanpur, and Yarden Katz. Pellet: A practical owl-dl reasoner. Journal of Web Semantics, 5(2):51–53, 2007.
- [27]Louis Mozart Kamdem Teyou, Luke Friedrichs, N’Dah Jean Kouagou, Caglar Demir, Yasir Mahmood, Stefan Heindorf, and Axel-Cyrille Ngonga Ngomo. Neural reasoning for robust instance retrieval in SHOIQ. In K-CAP, pages 61–68. ACM, 2025.DOI
- [28]Louis Mozart Kamdem Teyou, Caglar Demir, and Axel-Cyrille Ngonga Ngomo. Semantics-aware caching for concept learning, 2026. URL https://arxiv.org/abs/2603.06506.
- [29]Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. Complex embeddings for simple link prediction. In International conference on machine learning, pages 2071–2080. PMLR, 2016.arxiv.org/abs/1606.06357
- [30]Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.arxiv.org/abs/1706.03762
- [31]Patrick Westphal, Lorenz Bü hmann, Simon Bin, Hajira Jabeen, and Jens Lehmann. Sml-bench–a benchmarking framework for structured machine learning. Semantic Web, 10(2):231–245, 2019.DOI
- [32]Bo Xiong, Nico Potyka, Trung-Kien Tran, Mojtaba Nayyeri, and Steffen Staab. Faithful embeddings for el++ knowledge bases. In International Semantic Web Conference, pages 22–38. Springer, 2022.