Abstract
Multilingual question answering (QA) over linked data can make structured knowledge accessible across languages. However, most state-of-the-art QA systems are limited to English and rely on machine learning methods that lack controllability and extensibility, making their governance and incremental improvement challenging, along with the effort needed to collect and provide training data. To address this, we follow a model-based approach to QA that builds on a declarative model of the lexicon–ontology interface, OntoLex-Lemon, which enables the specification of the meaning of lexical entries with respect to the vocabulary of a particular dataset. From such a lexicon, in our approach, a QA grammar is automatically generated that can be used to parse questions into SPARQL queries. We demonstrate the extensibility of the approach to different languages by adapting it to German, Italian, and Spanish. We evaluate the approach with respect to the QALD benchmarks and show that our approach outperforms the state-of-the-art on all these datasets in an incremental evaluation mode in which additional lexical entries for test data are added. For example, on QALD-9, our approach obtains
Keywords
Introduction
As the amount of available multilingual linked data keeps growing, intuitive and effective paradigms for accessing and querying this body of knowledge become increasingly important. Previous research has stressed the need to transform linked data into a “global database” in which information is accessible across languages, thus creating a level-playing field in which each language community has equal opportunities to contribute to and benefit from the growing linked data ecosystem (Gracia et al., 2012).
There are approximately
State-of-art approaches to QALD are machine learning-based and can be broadly grouped into three categories (Chakraborty et al., 2019): (i) classification-based approaches, where neural models are used to predict one of a fixed set of classes given a question; (ii) ranking-based approaches, where neural networks are used to compare different candidate logical forms with the question to select the best-ranked one; and (iii) translation-based approaches, where the network learns to translate natural language questions (NLQs) into their corresponding logical forms. Many neural network-based approaches have proven effective for the QALD task, ranging from simple neural embedding-based models (Bordes et al., 2014) and attention-based recurrent models (Cheng et al., 2019) to memory-augmented neural controller architectures (Liang et al., 2017; Neelakantan et al., 2017; Yang et al., 2017).
Recently, transfer learning-based QALD (Lukovnikov et al., 2019) have demonstrated that significant improvements can be achieved by fine-tuning a pre-trained language model trained on a large corpus. Yin et al. (2021) used three types of neural machine translation models, including RNN-based, CNN-based, and transformer-based models for translating natural language to SPARQL. Research by Wang et al. (2022) has demonstrated that GNNs naturally fit the graph-structured knowledge and show promising results on the QALD task. The QA-GNN model (Yasunaga et al., 2021), which jointly reasons over knowledge from pretrained language models and knowledge graphs using graph neural networks (GNNs), has been shown to yield strong question-answering (QA) performance compared to models that rely solely on knowledge graphs (KGs) or language models (LMs). While machine learning-based systems have seen increasing performance in recent years, they suffer from a number of limitations.
The first limitation is the lack of principled extensibility and controllability. If the QA system is to be extended to cover a particular type of question that has not been supported so far, current systems would require to add a number of additional training questions and to retrain the system with an uncertain outcome as there is no guarantee that the additional training questions are sufficient for the approach to learn the new question type. A more principled approach here would support adding a new syntactic construction to the system that will parse or generate all questions involving this new syntactic construction rather than only single instances of such questions. The same holds for an extension of a system with a new lexical element.
Adding new training questions involving the lexical element does not guarantee that the system is able to induce the semantics of that lexical element as a basis to parse all the questions involving this element. In this sense, current systems can not be extended to cover new types of questions in a principled way.
The second limitation is related to the difficulty of increasing the capability of these systems for a new language. The capability of the systems that follow an inductive paradigm can be increased for a new language either by adding training data for that language (which is costly to obtain) or by training systems in a cross-lingual fashion, for example, transferring a system relying on cross-lingual embeddings (Jebbara & Cimiano, 2019) or from one language to another via training data projection (Klinger & Cimiano, 2015) using machine translation systems. However, it has been demonstrated that such systems require at least some domain-specific data, in this case, in-language data, to perform well. For example, Klinger and Cimiano (2014) propose an approach based on projecting training data from one language to another based on machine translation techniques (Klinger & Cimiano, 2015). They show that, given that the translation can introduce errors, the performance of the system on the target language depends on the quality of the translation system and the induced word alignment.
Another approach to multilingual question answering is based on the cross-lingual language model (Conneau et al., 2020; Conneau & Lample, 2019) that partially overcomes the lack of a large amount of training data. The approach creates machine-learning models for languages by transferring knowledge from one natural language to another. For example, XLM-Roberta (Conneau et al., 2020) uses self-supervised training techniques to achieve state-of-the-art performance in cross-lingual understanding, in which a model is trained in one language and then used with other languages without additional training data. The approach is deployed on comprehension datasets (i.e., SQuAD benchmark, 1 ) consisting of questions posed by crowd workers on a collection of Wikipedia articles. To the best of our knowledge, the approach has not been applied to linked data (Berners-Lee, 2006; Bizer et al., 2023), so it remains unclear how far such an approach addresses the challenges of question answering over a knowledge graph (Shekarpour et al., 2016; Unger et al., 2014) and what its performance would be.
We explore a different paradigm to question answering that relies on a model-based approach (Benz et al., 2020). The approach relies on a model of the lexicon-ontology interface (Cimiano et al., 2016) in which the meaning of lexical entries is specified with respect to a given vocabulary or ontology. We build on the OntoLex-Lemon model 2 (Cimiano et al., 2016) in particular. Given a lexicon in a particular language and for a particular vocabulary/ontology, our approach automatically generates a grammar that allows parsing questions in the specific language into SPARQL queries over the corresponding vocabulary/ontology. This approach is model-based or declarative in the sense that it relies on a declarative specification of the meaning of lexical entries. The approach can be extended in a principled and efficient way as follows:
Adding new lexical items: The approach to extending the QA system is principled and consistent in the sense that adding a lexical item to the lexicon guarantees that all questions involving valid constructions in which the lexical item can be used will be parsed correctly. Adding a new syntactic construction: when making available a new syntactic construction to the grammar generation component, then this syntactic construction will be available for the grammars generated for different datasets, so the syntactic construction needs to be added once for a language and it will be available for all datasets. Porting the system to a new language: porting a system to a new language requires creating a lexicon and developing sentence templates for that particular language. This is an effort done once for all the datasets that the QA system will work on.
The way to extend the system is thus principled in the sense that porting the system to a new dataset merely requires providing a new lexicon in the languages the system is expected to support. This can be done by engineers who do not need to be aware of how the grammar is generated but only need to understand how to add appropriate lexical entries. The extension with new syntactic constructions and languages is done once by a language expert in the QA system and will be available for all instances of the QA system that would only need to re-run the grammar generation to incorporate the newly added syntactic constructions.
While we have presented preliminary versions of this work (Benz et al., 2020) before, we have so far not provided evidence of the robustness, controllability, scalability, adaptability, and portability of the system across languages in a systematic evaluation. As one important ingredient towards making information accessible across languages, we investigate how our model-based approach can be extended in terms of coverage in a principled way.
In the current paper, we describe our new approach in full detail and describe its architecture. We further demonstrated that the approach is fit for purpose and outperforms the existing state-of-the-art machine learning-based and rule-based approaches in an incremental evaluation for English on five editions of the QALD dataset, that is, QALD-9, QALD-7, QALD-6, QALD-5, and QALD-3. We provide a proof for the portability of our system to further languages by describing how we adapted it to German, Spanish, and Italian and also show that it provides state-of-the-art results on all series of QALD including the newest version QALD-9 for these three languages. We also demonstrate that our approach outperforms pre-trained state-of-the-art Large Language Models (LLMs), particularly ChatGPT (Faria et al., 2023; Ouyang et al., 2022), in an incremental evaluation, both in zero-shot and few-shot settings.
In this section, we describe our approach to multilingual grammar generation on the basis of a lexicon represented using the OntoLex-Lemon model. For each syntactic frame supported by our system, we describe generic templates (i.e., grammar rule templates [GRTs]) for the grammar rules generated and provide examples of how these templates are instantiated for specific lexical entries. Our examples use DBpedia (Lehmann et al., 2015) as a reference dataset. However, our approach is dataset-independent and can be adapted to any particular dataset and vocabulary by providing a corresponding lexicon.
OntoLex-Lemon
In this section, we explain the OntoLex-Lemon model (Cimiano et al., 2016), which is an updated version of the Lemon model (McCrae et al., 2011), and which is the core representation used by our model-based approach to grammar generation. The OntoLex-Lemon model is based around the core module, as depicted in Figure 1. The primary element of this is the lexical entry, which represents a single word and thus collects together all morphological variants of that word, which correspond to forms in the model, and all possible concepts in the given vocabulary/ontology it can refer to. The meaning of a word is thus given by reference to an ontological concept; this connection is modelled via a lexical sense that represents the mapping from a word to an ontological concept.

The core OntoLex-Lemon model (Cimiano et al., 2016).
Words have a clear syntactic behavior which to a great extent is determined by their syntactic category (verb, noun, adjective, etc.). The way that sentences are composed in a language crucially depends on the syntactic behaviour of the words that make up the sentence. The syntax and semantics module of the OntoLex-Lemon model describes the syntactic behaviour of words in terms of an inventory of syntactic (subcategorization) frames such as transitive verb-frame, intransitive verb-frame requiring a prepositional object, etc. In addition, it describes how the syntactic structure relates to a semantic structure described in terms of vocabulary elements of the given vocabulary/ontology. There are other existing sources that comprise of a repository of frames. A relevant example is the Framester hub (Gangemi et al., 2016) which acts as a hub between FrameNet (Baker et al., 1998), WordNet (Fellbaum, 1998), VerbNet (Kipper et al., 2008), BabelNet, 3 DBpedia, Yago, DOLCE-Zero, as well as other resources, while encoding frame-related and lexical knowledge in OWL to support expressive querying and reasoning. In contrast to such resources, the frames we consider in this article are mainly syntactically defined, getting semantics from a relation to a specific vocabulary or ontology.
The core of the lemon model is insufficient for grammar generation to parse natural language sentences into SPARQL queries. This is because it lacks syntactic information and arguments, such as the specific types of arguments needed for certain lexical entries (e.g., direct and indirect objects), their grammatical functions, or the type of a frame (e.g., intransitive, transitive). Lexinfo (Cimiano et al., 2011) is an extension of the lemon model, featuring over 600 distinct linguistic categories. This declarative model allows us to associate linguistic information with elements in an ontology with respect to the syntactic frame (as detailed in Section 2.2), which is crucial for constructing grammatically correct sentences for that element. For example, Figure 2 shows a syntactic frame of the so-called

The syntax/semantics mapping in LexInfo (Cimiano et al., 2011).
Consider the intransitive verb with prepositional adjunct ‘settle in’ construction: ‘
Figure 3 shows a high-level architecture of our model-based approach. The core component of the approach is the grammar generator, which takes a Lemon lexicon and a set of sentence templates (detailed in Section 3.1) as input, accesses an RDF dataset and automatically creates a lexicalized grammar. The grammar is lexicalized in the sense that every grammar rule has a lexical anchor as in Lexicalized Tree Adjoining Grammars (LTAG) (Joshi & Schabes, 1997; Schabes & Joshi, 1988). As in LTAG, our rules correspond to full projections of lexical anchors in that all (dependent) arguments are local to each rule.

High-level architecture of the model-based approach.
A necessary prerequisite for our grammar generation approach is the availability of a Lemon lexicon that describes by which lexical entries the elements (classes, properties) of a given dataset can be verbalized in a particular language. In particular, a lexicon is needed for each language to be supported by the QA system. The grammar generation for a lexical entry with a specific syntactic frame is controlled by GRTs (i.e., generic templates) that describe how specific lexicalized grammar rules can be generated for a given lexical entry. We support the following syntactic frames
4
:
In the following sections, we first describe the lexical entries (as detailed in Section 2.3) for each of these syntactic frames. Afterwards, we will explain the sentence templates (as detailed in Section 2.4), as they serve as a prerequisite for obtaining the GRTs. Finally, we describe in detail the GRTs (see Section 2.5) and give an instantiated example for a specific lexical entry.
To create a QA system for a given dataset with its associated vocabulary and a specific language, the language expert of that language needs to create lexical entries. In this section, we provide examples of lexical entries for English as language and DBpedia as vocabulary/ontology.
Nouns
Consider the Lemon lexical entry shown in Figure 4 for the relational noun ‘mayor’ (of). The entry states that the canonical written form of the entry is ‘mayor’. It specifies that the syntactic behaviour of the entry corresponds to the one of a

The lexical entry for the relational noun ‘mayor’ (of).
Consider the Lemon lexical entry shown in Figure 5 for the transitive verb (to) ‘direct.’ The lexical entry states that the canonical form has the written representation ‘direct’. The simple past form is ‘directed’. The semantics of the verb (to) ‘direct’ is expressed by the property dbo:director. The entry specifies that the subject of the property is realized by the direct object of the verb ‘direct’ while the object of the property is realized by the syntactic subject of the verb ‘direct’. The entry also captures that the domain of the property is dbo:Film and the range of the property is dbo:Person.

The lexical entry for the transitive verb (to) ‘direct’.
An example of an intransitive verb with a prepositional adjunct, ‘flow’ (through), is shown in Figure 6. According to the Lemon entry, the verb has a subject and a prepositional adjunct. The semantics of ‘X flows through Y’ is captured by the property dbo:city, where the subject of the property is realized by the syntactic subject of the ‘flow’ (through) verb, and the object of the property is realized by the prepositional adjunct of the verbal construction. The entry states that the domain of the property is dbo:River and the range of the property is dbo:City.

The lexical entry for the intransitive verb ‘flow’ (through).
Adjectives have different behaviour in terms of grammar rules generated compared to the entries discussed before. Consider the example entry for the adjective ‘Spanish’ shown in Figure 7. The entry states that the adjective can be used in an attributive frame (i.e., ‘Spanish movie’) as well as in a predicative frame (i.e., ‘the movie is Spanish’). The entry states that the semantics of the adjective ‘Spanish’ can be expressed through a restriction on property dbo:country for the value res:Spain.

The lexical entry for the adjective ‘Spanish’.
Gradable adjectives are represented using the class

The lexical entry for the gradable adjective ‘high’.
The sentence templates are manually created by language experts, as indicated in the high-level diagram as the second step. A sentence template defines the structure of a sentence for a specific language, including the order and type of its components, such as the subject, various types of verbs (i.e., main verbs, auxiliary verbs, imperative verbs, etc.), prepositions, objects, and modifiers.
We create sentence templates for each syntactic frame (detailed in Section 3.1.2), not for individual lexical entries. For example, for relative nouns (e.g.,
Here, the sentence template
Generating Grammars
In our previous work, we described how grammar generation (Benz et al., 2020) works for four syntactic frames according to LexInfo (Cimiano et al., 2011). In our current work, we comprehensively describe the grammar generation process that builds on and substitutes the previous work and describe the methodology of porting it to other languages and datasets.
This section explores the transformation process of sentence templates (as discussed in the previous section) into GRTs. In this article, we use ST as the abbreviation for the sentence template, GRT as the abbreviation for the grammar rule template, and GR for the grammar rule.
When a sentence template (ST) is transformed into a grammar rule template (GRT), three conceptually different types of replacements take place, each serving a distinct purpose. For example, the sentence template ST
Transformations related to the lexicon: During the process of transforming an ST into a GRT, the parts obtained from the lexical entry are replaced to generalize the resulting template and abstract away from the concrete lexical entry. For example, in the sentence template ST Transformations related to the knowledge base: The sentence template outlines the structure of a sentence. Some syntactic categories in the sentence template represent the syntactic subject or object. In our approach, these are obtained from RDF data (i.e., subject or object of the property). Therefore, when transforming an ST into a GRT, those parts are replaced by non-terminal symbols enclosed in Transformations related to language-specific parts: The language-specific components, such as determiners, pronouns, auxiliary verbs, conjunctions, and negation, neither fall under pre-terminals retrieved from the lexicon nor non-terminals retrieved from RDF data. For example, the syntactic category
The step-by-step process of transformation from a sentence template (ST) via pre-GRTs to a GRT is shown below:
In the following section, we describe the grammar at two levels of abstraction: (i) we describe generic templates (i.e., GRTs) that are independent of a particular lexical entry, and (ii) we provide example instantiations (i.e., grammar rules) of the GRTs for illustration. We also provide the SPARQL queries to retrieve the value of non-terminals of the grammar rules. The SPARQL queries of the individual grammar rules are provided in the Appendix.
NounPPFrame
From the sentence templates of the relative nouns (i.e., syntactic behavior called
As discussed in the previous section, symbols enclosed in
Symbols enclosed in
Here, the first group (i.e., GRT
The
Here,
Consider a particular lexical entry shown in Figure 4 for the relational noun ‘mayor’ (of).
The values of the non-terminals
After executing the SPARQL query, we obtain the following results:
The first, second, third, and fourth groups (GRT
The grammar rules generated from the second group (i.e., GRT
The grammar rules generated from the third group (i.e., GRT
We have presented the GRTs for the relative noun of Agent 7 type, such as ‘mayor’ (of), ‘president’ (of), etc. However, the GRTs and grammar rules for the relative noun of non-Agent 8 type, such as ‘capital’ (of), ‘ingredient’ (of), are not detailed here.
TransitiveFrame
From the sentence templates of a transitive verb (i.e., the syntactic behaviour called
The non-terminal <NP
Consider a particular lexical entry shown in Figure 5 for the transitive verb (to) ‘direct’.
The grammar rules generated by instantiating grammar rule templates of the first group (i.e., GRT
The grammar rules generated from GRT
IntransitivePPFrame
From the sentence templates of an intransitive verb (i.e., the syntactic behaviour called
The non-terminal <NP
Consider a particular lexical entry shown in Figure 6 for the intransitive verb ‘flow through’ with a prepositional adjunct.
The grammar rules generated by instantiating grammar rule templates of the first group (i.e., GRT
The GRTs for temporal expressions involving intransitive verbs, such as ‘dissolve’ (at), or when the subject is of
AdjectivePredicateFrame
After transforming the sentence templates of intersective adjectives (i.e., the syntactic behaviour referred to as
The values of the non-terminals
Consider a particular lexical entry shown in Figure 7 for the adjective ‘Spanish’.
The SPARQL query used to retrieve
Once the query is executed, a rule like this is generated:
The grammar rules generated by instantiating grammar rule templates of the first group (i.e., GRT
AdjectiveSuperlativeFrame
From the sentence templates of gradable adjectives (i.e., the syntactic behaviour called
Consider the lexical entry shown in Figure 8 for the gradable adjective ‘high’.
The values of the non-terminals <NP
The grammar rules generated by instantiating grammar rule templates of the first group (i.e., GRT
Parsing
In this section, we provide a complete example of parsing a given question (i.e., ‘Who is the mayor of Russia?’) into a SPARQL query using the grammar discussed in the previous section. After that, we explain how the approach parses a complex question (i.e., ‘Who is the mayor of the capital of Russia?’).
For parsing, the lexicalized grammar rules (as detailed in Section 2.5.1) are automatically converted into regular grammar
9
(Simov et al., 2002; Simov & Osenova, 2004) by replacing the non-terminals with regular expressions (i.e.,
There are several advantages to using a regular grammar. First, regular grammar is more straightforward compared to state-of-the-art grammar formalisms, such as context-free grammar (Jurafsky & Martin, 2025) or tree-adjoining grammar (Joshi & Schabes, 1997; Lichte & Kallmeyer, 2017). This simplicity can be advantageous in scenarios where a less complex grammar is sufficient for tasks such as question answering over linked data, as is the case in our approach. Second, regular languages can be parsed using finite automata, which are generally more computationally efficient than the more complex mechanisms employed in top-down parsing (Jurafsky & Martin, 2025) for context-free grammar or the substitution and adjunction operations (Vijay-Shanker, 1992) of tree-adjoining grammar.
Simple Question
The parser takes a sentence in natural language and produces an analysis of the sentence in the form of one or more SPARQL queries. In our example, the input and output of the parser are shown below:
The step-by-step method is as follows:
Find the grammar rule: Given a question in natural language, the parser iterates through all the grammar rules and retrieves the grammar rule when a match is found.
If a match is found, it returns the grammar rule that includes two SPARQL queries (as detailed in Section 2.5.1). Once a match is found, proceed to steps 2 and 3. For example, the grammar rule matching the question ‘Who is the mayor of Moscow?’ is shown below.
As explained in Section 2.5.1, the values of non-terminal in a grammar rule is extracted using SPARQL query. In regular grammar, non-terminals are replaced by regular expressions, so the values of the regex If there is no grammar rule that matches the given question, it cannot be parsed. Extract the entity of the question: After the question ‘Who is the mayor of Moscow?’ is matched with the grammar rule ‘Who is the mayor of Match the entity with terminals: To match the entity ‘Moscow’ (of the question) with the terminals (of the grammar rule), the parser uses the Jaccard similarity
10
measure with a threshold set to Each terminal of step 1a (e.g., ‘Provisional Government of Belgium’) is converted to a set of tokens. Afterwards, the Jaccard similarity is computed between each terminal and the entity of the question, in this case, ‘Moscow’. The similarity scores are ranked in descending order. If the similarity score is greater than the threshold (i.e.,
Complex Questions
The grammar rules discussed in the Section 2.5 allow parsing questions that can be represented by a SPARQL query that involves a triple pattern with the predicate rdf:type, a triple pattern with the predicate rdfs:label and one more triple pattern. The approach can thus not parse complex questions involving more triples such as the following one:
In order to allow our QA system to parse such questions correctly, we implemented a limited form of composition that allows certain rules to be nested within others. Specifically, our approach supports the nesting of noun phrases (e.g., ‘the capital of Russia’ or ‘Russian capital’) into the rules of other frames.
The parser takes a sentence ‘Who is the mayor of the capital of Russia?’ and produces an analysis of the sentence in the form of one or more SPARQL queries. In our approach, the input and output of the parser is shown below:
The step-by-step method is as follows: The question ’Who is the mayor of the capital of Russia?’ matches with the following grammar rule:
The SPARQL query of the grammar rule contains a variable (i.e., Extract the entity of the question: After the question ‘Who is the mayor of the capital of Russia?’ is matched with the grammar rule ‘Who is the mayor of Parse simple question: In this case, the parser treats ‘the capital of Russia?’ as a noun phrase and parses it similarly to the simple question discussed in the previous section. The grammar rule matched is shown below:
The parse result of ‘the capital of Russia?’ is
The answer retrieved for this noun phrase is res:Moscow. Therefore, the semantics of the expression ‘the capital of Russia’ can alternatively be expressed by res:Moscow. Replace the variable: The variable (i.e.,
This simple approach to dealing with complex questions implements a limited form of compositionality that treats the phrase ‘the capital of Russia’ as (non-compositionally) referring to the URI res:Moscow. While this way of parsing certain types of complex questions is effective as shown by our experimental results, it is limited to two-hop queries involving at most a linear chain of two properties in addition to rdf:type (or rdfs:label) statement.
Multilingual Grammar Generation
In this section, we detail our model-based approach that automatically generates lexicalized grammar rules from a Lemon lexicon. First, we explain the method for English. After that, we describe the methodology we followed to adapt the system to multiple languages—in our case, German, Spanish, and Italian. We elaborate on the process of implementing corresponding GRTs (as discussed in the previous section) for each of these languages. These GRTs are independent of a particular dataset. Subsequently, the grammar rules are generated through instantiations of the templates using lexical entries. Further, we explain the process of creating lexical entries for these four languages using DBpedia as proof of concept.
English Grammar Generation
As described in the high-level architecture (as detailed in Section 2.5), the first step is to create lexical entries manually.
Creating Lexical Entries
To create a lexical entry of a relative noun, such as the one shown in Figure 4, the English language expert needs to provide the following information: (i) the singular and plural form of the reference, that is, ‘mayor’ and ‘mayors’ for dbo:mayor; and (ii) the preposition, that is, ‘of’.
Creating Sentence Templates
The sentence templates are manually created by language experts, as indicated in the high-level diagram as the second step. In Section 2.4, we define sentence templates with examples. In this section, we detail the steps necessary to create sentence templates.
We create sentence templates for each syntactic frame (detailed in Section 2.2). For example, for a relative noun (i.e., the syntactic frame called
The following provides a detailed method for creating sentence templates for the Agent type. The language expert is provided with the following information:
a sample of relative noun of Agent type five example questions
The example a set with a dictionary
Note that there are two kinds of syntactic categories: (i) categories that take no parameters, such as
For the given example
The language expert also created four variations for sentence templates for the given example, such as:
Similarly, the language expert created sentence templates for the examples of
A total of
Similarly, for the
For the
For the
As shown in Table 1, a total of
An Overview of the Number of Manually Created Lexical Entries, Grammar Rule Templates, and Grammar Rules for Different Frame Types of LexInfo for the English Language.
An Overview of the Number of Manually Created Lexical Entries, Grammar Rule Templates, and Grammar Rules for Different Frame Types of
The table also shows the number of grammar rules that are generated automatically after instantiations of grammar rule templates with lexical entries.
Note that the lexicon presented here includes lexical entries that also cover the training data of QALD-9 benchmarks. The lexicon is evaluated with test data in two modes (as detailed in Section 5): (i) inductive evaluation, and (ii) incremental evaluation.
The time required for creating a lexical entry is approximately
Porting the QA system to other languages is straightforward in our approach, which follows two steps: (i) adding new lexical items by providing language-specific properties, and (ii) adding grammar rules for that language. In this section, we detail the lexicon creation for other languages (e.g., German, Italian, and Spanish), focusing on language-specific features and how we accommodate those in our model-based approach.
German Grammar Generation
Unlike in English, German nouns are gender-specific (e.g., either masculine, feminine, or neuter) and the endings of the nouns vary with the corresponding case (e.g., nominative, accusative, dative, and genitive). To add a lexical entry of type
The German verb has infinitive forms, conjugated forms depending on the subject, reflexive forms, and separable forms (i.e., verbs with separable prefixes). To add a lexical entry for a German intransitive verb, for example,‘aufhören’, which is captured by the property dbo:routeEnd, the following information needs to be provided: (i) the verb type (i.e., either conjugate or separable or reflexive), (ii) the infinite form, that is,‘aufhören’, (iii) the past form, that is,‘hörte auf’, and (iv) the perfect form, that is,‘hat aufgehört’.
We created a lexicon for the German language and the DBpedia dataset (Release 2016-10; core, links).
13
As shown in Table 2, there are a total of
An Overview Over the Number of Manually Created Lexical Entries, Grammar Rule Templates, and Grammar Rules for Different Frame Types of LexInfo for the German Language.
An Overview Over the Number of Manually Created Lexical Entries, Grammar Rule Templates, and Grammar Rules for Different Frame Types of
The table also shows the number of grammar rules that are generated automatically after instantiations of grammar rule templates with lexical entries.
Similar like English, the lexicon presented here includes lexical entries that also cover the training data of QALD-9 benchmarks.
The time required for creating a lexical entry is approximately
Note that to adapt to German, we only added language-specific properties to the lexicon and adapted the sentence templates with respect to the features of German, but the process of grammar generation remains the same.
Unlike German, the Italian noun does not depend on the cases but instead on the first letter of the noun they are preceding. To create a Lemon entry for a relative noun in Italian, the language expert needs to provide the gender information of the reference, domain, and range in both singular and plural forms. That is, the language expert needs to provide one of the four forms (i.e., ‘il’ or ‘la’ ‘l” or ‘l’) in the case of a singular noun.
The presence of auxiliary verbs, either ‘avere’ (‘have’) or ‘essere’ (‘be’), in compound tenses, needs to be explicitly specified. The generation of the specific interrogative pronoun is governed by the following rules as (i) ‘chi’ (‘who’) is invariable and refers only to people; (ii) ‘quale’ (‘which’) is used for the masculine and feminine singular, and ‘quali’ is used for masculine and feminine plural; (iii) ‘quanto’ and ‘quanti’ have feminine forms, etc. The use of different prepositions, either simple or articulated, is based on domain/range (e.g., ‘toponyms’ might require different prepositions). The presence of a determiner/articulated preposition based on domain/range semantics (e.g., ‘toponyms’ are preceded by a determiner when the noun refers to a country) also impacts the final choice in lexical elements. In adapting the grammar generation to Italian, we accommodate all these language-specific properties in the sentence template.
We created a lexicon for the Italian language and the DBpedia dataset (Release 2016-10; core, links).
14
As shown in Table 3, there are a total of
An Overview Over the Number of Manually Created Lexical Entries, Grammar Rule Templates, and Sentence Templates for Different Frame Types of LexInfo for the Italian Language.
An Overview Over the Number of Manually Created Lexical Entries, Grammar Rule Templates, and Sentence Templates for Different Frame Types of
The table also shows the number of grammar rules that are generated automatically after instantiations of grammar rule templates with lexical entries.
The time required for the creation of a lexical entry is approximately
The properties of Spanish nouns and verbs are not significantly different from those for Italian. Therefore, lexical entries are added in the same way as for Italian, providing a masculine and feminine form for each noun. However, the gradable adjective in Spanish differs from Italian. To add a lexical entry for an adjective such as ‘alto’ (i.e., ‘high’ in English), the language expert needs to provide the written form of superlative in the singular masculine form (i.e., ‘el más alto’), the plural masculine form (i.e., ‘los más altos’), the singular feminine form (i.e., ‘la más alta’), and the plural feminine form (i.e., ‘las más altas’).
We created a lexicon for the Spanish language and the DBpedia dataset (Release 2016-10; core, links).
15
As shown in Table 4, there are a total of
An Overview Over the Number of Manually Created Lexical Entries, Grammar Rule Templates, and Grammar Rules for Different Frame Types of LexInfo for the Spanish Language.
An Overview Over the Number of Manually Created Lexical Entries, Grammar Rule Templates, and Grammar Rules for Different Frame Types of
The table also shows the number of grammar rules that are generated automatically after instantiations of grammar rule templates with lexical entries.
The time required for creating a lexical entry is approximately
The total construction time for the lexicons in four languages was approximately
Our approach consists of three components: (i) a grammar generator (as shown on the left side of Figure 3), (ii) a parser, and (iii) a web application (as shown on the right side of Figure 3). The details of all systems and step-by-step instructions for running them from scratch are available here. 16
The core component is the grammar generator tool, which takes a Lemon lexicon and sentence templates as input and automatically creates lexicalized grammar rules. For example, the tool takes the sentence templates (STs) of a syntactic frame (e.g.,
The second component is the parser tool, which takes a question in natural language and grammar and provides one or more SPARQL queries. The parser is also a command line tool developed in Java 15, and its source code is available here. 18
The third component is the web application (as shown on the right side of Figure 3), which is implemented using the Spring7 framework. Given a question, the application is able to present an answer (or a set of answers) given by the SPARQL endpoint in a comprehensive manner. The previous version of the QA system was limited to English (Elahi et al., 2021) and limited to answering a million questions. We extended the system for German, Spanish, and Italian and also improved the system by implementing the parsing method, thus the capacity of the QA system is extended to cope with an unlimited number of questions as the questions do not need to be indexed. The web-based demonstration of the QA system is available online here, 19 and the source code can be obtained from here. 20
Evaluation
In this section, we present the evaluation of our approach using the well-known QALD shared task (Usbeck et al., 2023) as a benchmark. We evaluate the system on five editions of QALD (i.e., QALD-9, QALD-7, QALD-6, QALD-5, and QALD-3) and two modes: inductive and incremental. The inductive setting corresponds to the standard evaluation mode in which a model is induced from training data and its generalization ability is evaluated on unseen test data. In our case, the inductive aspects come from the fact that the lexicon entries are created to correspond to lexical elements used in questions in the training dataset.
In our work, we are interested however mainly in an incremental setting, showing that the performance of a QA system can be systematically improved by adding new lexical entries for uncovered questions. In the incremental evaluation mode, we thus add further lexical entries to cover the questions in the test split of the data.
In addition to evaluating our system with respect to QALD datasets, we also discuss how 3rd parties could successfully adapt the system to new datasets. Further, we show the consistency and controllability of our approach by analyzing the impact of removing or adding single lexical items on the performance of the QA system.
Benchmark
We evaluate our approach using the QALD challenge series (Usbeck et al., 2017) (i.e., QALD-9, QALD-7, QALD-6, QALD-5, and QALD-3), adopting standard evaluation metrics such as precision, recall, and F
Table 5 shows the results of the evaluation against QALD-9 (Usbeck et al., 2018) training data for English, German, Italian, and Spanish questions. Figure 9 shows an example of how the F
Results for QALD-9 Training Dataset.
Results for QALD-9 Training Dataset.
P refers to precision, R refers to recall, and F

Results of the incremental evaluation using QALD-9 training data. After each extension of the lexicon, we evaluate precision, recall, and F
The evaluation with test data is conducted in two modes: inductive and incremental.
The goal of the inductive evaluation mode is to evaluate our approach’s ability to generalize to unseen data or tasks. For the inductive evaluation, we used only the training data to create lexical entries. As explained in Section 3.1.2, we provide samples for each syntactic frame to the language expert, who then creates the sentence templates. These samples were taken from the QALD-9 training data, ensuring that the test data remains unseen by the language expert. Thus, in our inductive evaluation, we follow the same procedure typically used to evaluate machine learning approaches.
Table 6 shows the results for the QALD-9 test dataset for English, German, and Italian. As can be seen from the Table: (i) the micro F
Results of the Inductive and Incremental Evaluation Using the QALD-9 Test Dataset.
Results of the Inductive and Incremental Evaluation Using the QALD-9 Test Dataset.
P refers to precision, R refers to recall, and F
In an incremental evaluation, we start with the lexicon created for the inductive evaluation and then add lexical entries incrementally until the questions in the test data are covered. The benefits of the incremental evaluation are that (i) a working version of the QA system for a particular language is ready for use after adding just a few lexical entries, and (ii) each lexical entry added to the lexicon improves the system. The goal of incremental evaluation is to maintain and enhance system performance in a dynamic and efficient manner, ensuring that the system remains robust and effective as new information becomes available.
We argue that our approach is indeed generalizable, as we use only the sentence templates created by the language expert for inductive evaluation, in which the test data remains unseen by the language expert. In the incremental evaluation, we only extend the lexicon at each step for the test data, but we never extend the set of sentence templates, so the grammar remains the same. Nevertheless, the performance improves when we extend the lexicon. Thus, the sentence templates created for the training data allow the approach to generalize and perform well on test data.
An important aspect is that we assume that there is a lexicon so all our results hinge on the availability of such a lexicon. While one could argue that in the incremental evaluation we are relying on test data to create the lexicon (not the sentence templates), we view this as simulating that there is a fairly complete lexicon by incorporating lexical entries relevant for test data. In our view, this is not different from assuming the availability of some other lexical resource such as WordNet (Fellbaum, 1998), FrameNet (Baker et al., 1998), ConceptNet (Speer et al., 2017) etc. The only difference is that we are "simulating" the availability of such a resource. We believe that our approach outperforms ML-based approaches under the assumption that a well-populated lexicon exists. Because, once we add the missing entries to the lexicon, our approach outperforms existing ML-based approaches.
Table 6 shows the results for the QALD-9 test dataset for English, German, and Italian. The table also shows the lexical entries common in both the training and test datasets and additional lexical entries created to cover cases in the test data. For example, for English,
Figure 10 shows the results of the incremental evaluation that begins with the lexicon created for the inductive evaluation and shows the impact of each additional lexical entry added to the lexicon. Note that, no sentence templates are added, so the grammar remains the same. For English, the evaluation begins with the result of the inductive evaluation (i.e., F

Results of the incremental evaluation using QALD-9 test data for English (top) and German (bottom). The Figure shows precision, recall, and F
As can be seen from Table 6: (i) the micro F
In order to illustrate the workings of our system, we analyze its behaviour in more detail by discussing four types of cases. We sample all questions from the QALD-9 training set and classify them into four cases 21 to highlight interesting aspects of its behavior.
Case 1: An Example of a Lexical Entry for which
% F
-Measure is Obtained.
Case 1: An Example of a Lexical Entry for which
In this case, the parsing result is the same SPARQL query as specified in the QALD-9 dataset.
For matching the entity ‘GMT’ of the question ‘List all boardgames by GMT.’ with these terminals, we used the Jaccard similarity measure (as detailed in Section 2.7) and set a similarity threshold of
The SPARQL query contained in the QALD-9 dataset for the question consists of UNION operations involving multiple properties:
In contrast, the SPARQL query generated by our approach consists of one property. The parse result of the question is as follows:
To the best of our knowledge, there is only one knowledge graph based QA system described in the literature that can handle limited forms of boolean questions (i.e., temporal questions) (Ding et al., 2023) In contrast, the automatically generated grammar rules in our approach allows us to parse a wide range of boolean questions from RDF data.
In order to better understand the potential errors that our system produces, we manually analysed errors on the QALD-9 training data, yielding nine types of errors:
While in principle the question could be parsed by the grammar rule S -> Give me all people that were born in <NP
The question contains the French label (i.e., ‘Les Piliers de la terre?’) of the entity res:The_Pillars_of_the_Earth instead of the English label (i.e., ‘The Pillars of the Earth’).
In our approach, however, the semantics of all lexical entries for frames is specified in relation to one property. Thus, in order to successfully parse a question, the question needs to have at least one noun or verb (as detailed in Section 2.3) referring to a property. This issue could be solved by a simple grammar rule of the form ‘How many X are there’ where X refers to all possible classes in DBpedia. ‘What is the most frequent cause of death?’ and its SPARQL query:
Our grammar rules generated for the lexical entry ‘death cause’ (of) could instead parse questions involving at least one entity (that died), for example ‘What is the cause of death of Calel Perechodnik?’ as
Another example of a missing template involves temporal questions, such as the question ‘Give me all libraries established earlier than 1400.’.
But the SPARQL query of the question contained in QALD-9 is:
We used the Jaccard similarity measure (as detailed in Section 2.7) to match the entity (of the question) with the label of the DBpedia entity and set a similarity threshold of
Note that the entity ‘Bach’ of the question does not match with the entity ‘Johann Sebastian Bach.’ Instead, the highest ranked entity according to the Jaccard similarity score is res:Bach_(actor).
In this section, we discuss question-answering systems evaluated on the QALD benchmark and compare their performance (i.e., F
The goal of most QALD systems is to map NLQs to corresponding SPARQL queries. State-of-the-art question-answering systems use machine learning to learn a model to map natural language questions into SPARQL queries. These systems support in most cases only the English language.
Comparision With ML-Based Approach
There is a fundamental difference between how machine learning models are extended and how our model-based approach is extended. While machine learning-based approaches require extensive training data to learn to handle phenomena that are either absent or not sufficiently prominent in the training set, our approach operates independently of training data. Instead, the capabilities of our system can be increased by extending the lexicon, which is a completely different paradigm. This allows us to improve our system step by step (as detailed in Section 5.3).
The incremental improvement of our approach can be compared to experiments on the continuous improvement of machine learning approaches; however, such experiments are typically outside the scope of ML papers, and we lack evidence on how effectively ML methods can be incrementally improved by modifying the training data. There are approaches, such as Barz and Sonntag (2019), that support incremental improvement of QA systems without re-training. However, to the best of our knowledge, this approach has not been applied to linked data, so it remains unclear how machine learning-based QALD systems can be incrementally improved. Therefore, we explain existing ML-based QALD systems and their limitations, highlighting the advantages of our approach for incremental improvements.
In neural network-based QALD systems (Chakraborty et al., 2019; Lukovnikov et al., 2017; Mohammed et al., 2018; Yasunaga et al., 2021), the problem of transforming natural language into a SPARQL query is typically framed as a semantic parsing problem. For example, the transfer learning-based QALD approach (Lukovnikov et al., 2019) uses a fine-tuned BERT model (Vaswani et al., 2017) and decomposes question interpretation into two separate learning tasks: (1) entity span detection, which identifies the spans in the question that mention the entity, and (2) relation classification, which predicts the relation used in the question. In the question ‘Who is the mayor of New York City?’, the entity span would be ‘New York City’, and the relation span would be ‘mayor’. The limitation is that linked data uses a formal structure, with specific ontologies, technical terminologies, and relationships that are less common in natural language text. In the context of incremental improvement, our approach can be easily extended for questions like ‘When was Carlo Giuliani shot?’ by adding a lexical entry such as ‘shot in’ for the property dbo:deathDate (detail in Section 5.3). However, pre-trained models may not have encountered enough examples of these specific patterns during training, even though they are trained on large corpora of text. Moreover, while transfer learning-based approaches are typically employed only for simple questions, our approach supports nesting grammar rules (detail in Section 2.8) and a limited set of compositionality.
There are approaches that translate NLQs into SPARQL queries (Luz & Finger, 2018; Soru et al., 2017, 2018; Yin et al., 2021), which are vocabulary-dependent and require training on samples derived from manually created QA template pairs. Some approaches use a model for joint query interpretation and response ranking (Sawant & Chakrabarti, 2013); others learn semantic parsers (Berant et al., 2013; Kwiatkowski et al., 2013) given a knowledge base and a set of question/answer pairs. Other approaches, such as TeBaQA (Vollmers et al., 2021a), map NLQs to SPARQL queries by learning templates from the benchmark (e.g., the QALD-9 dataset (Usbeck et al., 2018)). It classifies NLQs into isomorphic basic graph patterns and then uses this classification to map a question to a template. However, the training dataset is small, consisting of only
Systems Evaluated on QALD-9
TeBaQA (Vollmers et al., 2021a), map NLQs to SPARQL queries by learning templates from the benchmark. As shown in Table 8, TeBaQA achieves an overall F
Results for Machine Learning and Rule-Based Systems for English in Different QALD Series.
Results for Machine Learning and Rule-Based Systems for English in Different QALD Series.
L refers to the number of lexical entries, P refers to precision, R refers to recall, and F
SLING (Mihindukulasooriya et al., 2020) and GenRL (Rossiello et al., 2021) are relationship linking frameworks developed for question-answering over linked data. The former approach employs semantic parsing using Abstract Meaning Representation (i.e., a rooted, directed, acyclic graph expressing a question) to extract entities and relations between them, utilizing linguistic cues and information from DBpedia. The latter approach utilizes pre-trained sequence-to-sequence models, using only the question text to generate a sequence of relations based on the question. It also employs knowledge integration and validation mechanisms to address the nuances of the knowledge bases. However, the work does not explain the process of constructing a SPARQL query from the sequence of relations. The relation linking-based approaches achieve the highest overall F
We also compare our approach with systems evaluated on older QALD benchmarks, such as QALD-7 (Usbeck et al., 2017) to QALD-3. CASIA (He et al., 2014) is a machine learning-based QA system that translates NLQs into SPARQL by the following pipeline: (i) first, it decomposes the question and detects the candidate phrases; (ii) second, it maps the phrases to semantic items; (iii) finally, it groups the mapped items into semantic triples using a Markov Logic Network (MLN). A similar approach is RTV (Giannone et al., 2013) that selects key ontological information from the question (i.e., predicate, arguments, and properties) using a Hidden Markov Model.
These approaches, together with others (i.e., AMUSE Hakimov et al., 2017, Scalewelis Guyonvarc’H & Ferré, 2013, Intui2 Cimiano et al., 2013, SWIP Pradel et al., 2012, ForecastTKGQuestions Ding et al., 2023, and DEANNA Yahya et al., 2012), were evaluated by inducing a model from training data and testing the model on test data. Table 8 shows the comparison of our approach with these machine learning-based and rule-based systems for English. The incremental evaluation shows that our approach outperforms all machine learning approaches.
Furthermore, Table 8 also shows the results of the evaluation of our system in comparison to rule-based systems such as Xser (Xu et al., 2014), SemGraphQA (Beaumont et al., 2015), and YodaQA (Ruseti et al., 2015) for English. Xser (Xu et al., 2014) takes as input a NLQ in English and retrieves an answer. In this system, the user query is linguistically analyzed to detect predicate-argument structures through a semantic parser. SemGraphQA (Beaumont et al., 2015) transforms NLQs into SPARQL queries. YodaQA (Ruseti et al., 2015) represents the input question as a bag of features and then generates a set of candidate answers by performing a search in the knowledge base for these features. All these rule-based QA systems are evaluated over the QALD-5 test dataset in incremental mode and we see that our system outperforms all systems.
Performance on Other Languages
A survey (Diefenbach et al., 2018) of the multilingual QALD shows that
The Table Presented in the Multilingual Question Answering System Survey (Perevalov et al., 2022b) Illustrates the Development of Multilingual Question-Answering Systems Over the Last 10 Years.
The Table Presented in the Multilingual Question Answering System Survey (Perevalov et al., 2022b) Illustrates the Development of Multilingual Question-Answering Systems Over the Last 10 Years.
QALL-ME (Ferrández et al., 2011) is a multilingual Question-answering (QA) system that operates on structured data and has been developed for cinema/movie events in the tourism domain. Multilinguality is achieved by an ontology modelling the domain, which also represents a limitation of the framework since an available ontology has to be previously specified. XKnowSearch! (Zhang et al., 2016a) and BreXearch (Zhang et al., 2017) are multilingual semantic search systems that extract knowledge from various media sources, including online news sites, social media, and live TV, and integrate it with additional background knowledge from DBpedia. The approach allows to ask questions not through NLQs but with keyword queries or by using entities or SPARQL queries. These systems are focused on keyword-based searches instead of mapping NLQs to SPARQL queries, and no evaluation is provided.
The UTQA (ebn veyseh, 2016) system uses a QA pipeline of several language-dependent components, such as keyword extraction and type identification, entity linking, and answer extraction. The DeepPavlov (Burtsev et al., 2018) KBQA system works based on a set of large language-dependent deep learning models that perform such tasks as query type prediction, entity detection, relation detection and path ranking. The Platypus system (Tanon et al., 2018) transforms a NLQ into a custom logical representation using a language-dependent grammatical analyzer and a set of predefined rules. From a broad perspective, all these systems are focused on solving the QA problem using language-independent tools, which attracts a wider NLP audience instead of the Question Answering over Linked Data (QALD) community. Therefore, these systems lack evaluations against benchmarks on QALD.
To our knowledge, AMUSE (Hakimov et al., 2017) is the first machine learning-based multilingual QA system developed for languages other than English. The questions are first parsed by a dependency parser and then the model learns mappings between the dependency parse tree for a given question text and RDF nodes in the SPARQL query. AMUSE relies on the one hand on lexicalizations of DBpedia properties as extracted by M-ATOLL (Walter et al., 2014) for multiple languages. In particular for Spanish and German. However, M-ATOLL uses two methods for lexicalization: a label-based approach to extract lexicalizations using ontology labels (i.e., rdfs:label) and a dependency-based approach to extract lexicalizations of ontology properties from an available text corpus (i.e., Wikipedia text). The former method suffers from a lexical gap between natural language terms and the content of KB elements, and the latter method produces every other lexical entry inappropriate. Moreover, the approach is not designed to be deployed in a fully unsupervised mode to a new language.
Table 10 shows the results of the inductive evaluation and the incremental evaluation of our approach. The table also shows the lexical entries common in both the training and test datasets and additional lexical entries created over training data to cover the test. For instance, in the case of German,
Results for Machine Learning and Rule-Based Approaches for German, Italian, and Spanish.
ind* refers to inductive, inc* refers to incremental, and L refers to the number of lexical entries, P refers to precision, R refers to recall, and F
WDAqua-core1 (Diefenbach et al., 2020a) is a rule-based approach that translates NLQs to SPARQL queries. The approach is implemented for different languages other than English namely German, French, Italian, and Spanish. As can be seen from Table 10, our approach outperforms the WDAqua-core1 system for all languages.
ChatGPT (Ouyang et al., 2022) is a pre-trained large language model that can answer questions, ask for clarification, create dialogues with the user, and deal with follow-up questions. It is trained using reinforcement learning with human feedback, by using a combination of a new dialogue dataset and the InstructGPT dataset. Previous research (Petroni et al., 2019) shows that language models can, to some extent, be considered as knowledge bases (KBs) to support downstream natural language processing (NLP) tasks. This has sparked a growing interest in exploring whether ChatGPT and other large language models (LLMs) can replace traditional Question Answering over Knowledge Graphs (Yih et al., 2016) approaches. Benefiting from extensive training on information derived from Wikipedia and showcasing impressive natural language understanding capabilities, ChatGPT has been demonstrated to be a powerful question-answering system (Faria et al., 2023; Tan et al., 2023).
Prompt
In this section, we compare how ChatGPT (i.e., a language model) performs compared to our approach of question answering over linked data. In particular, we evaluated our approach against ChatGPT using the well-known QALD-9 benchmarks on September 5, 2024. We used ChatGPT 4 (i.e., GPT-4) in a zero-shot and few-shot scenario. In zero-shot scenario, we prompted it with an instruction to generate a SPARQL query for a given question with respect to DBpedia without providing further examples. The prompt for English is shown below:
In a few-shot scenario, we prompted it with an instruction to generate a SPARQL query for a given question in relation to DBpedia, providing one example for each of the five syntactic frames (i.e.,
Table 11 shows the results for the QALD-9 test dataset for four languages. The table further illustrates the evaluation of our approach to the QALD-9 test dataset in both inductive and incremental modes. The table highlights a comparative performance between our approach and ChatGPT across various scenarios, specifically focusing on zero-shot and few-shot learning across different languages. As shown in the table, our approach outperforms ChatGPT in zero-shot scenarios across four languages, in both inductive and incremental modes.
Results for ChatGPT for QALD-9 Test Dataset.
Results for ChatGPT for QALD-9 Test Dataset.
ind* refers to inductive, inc* refers to incremental, and L refers to the number of lexical entries, P refers to precision, R refers to recall, and F
However, in the few-shot scenario, ChatGPT outperforms our approach in the inductive mode. ChatGPT is trained on an extensive corpus of diverse, high-quality data from various domains, enabling it to understand a wide range of topics and questions. It is unclear whether the QALD-9 dataset was part of the data used to train ChatGPT. Nevertheless, our approach outperforms ChatGPT in the few-shot scenario in the incremental evaluation mode.
In order to compare the results of ChatGPT with those produced by our system, we manually analyzed the errors and non-errors in the first
As can be seen, the SPARQL query in QALD-9 uses several UNION operations with four properties (i.e., dbo:location, dbo:city, dbo:isPartOf, and dbo:operator), whereas the SPARQL query generated by ChatGPT contains only one property (i.e., dbo:location), does not use any UNION, yet still provides the correct interpretation of the question.
As can be seen, the SPARQL query generated by ChatGPT contains the property dbo:spokenIn instead of dbo:language.
The SPARQL query of ChatGPT contains the property (i.e., dbo:euAccession), which does not exist in DBpedia.
In some cases, ChatGPT generates a structurally incorrect SPARQL query. Consider the QALD-9 question ‘Which countries have places with more than two caves?’ and its SPARQL query from the QALD-9 dataset and ChatGPT:
In this example, the SPARQL query generated by ChatGPT includes a nested SELECT statement, which is structurally incorrect.
In this example, the entity res:Butch_Otter represents a person and should be in the object position for the property dbo:governor. However, in the SPARQL query generated by ChatGPT, it appears in the subject position, which is incorrect.
There are also instances (i.e.,
As can be seen, the SPARQL query generated by ChatGPT contains the property dbo:deathCause instead of the property-object pair (i.e., dct:subject and dbc:Assassins_of_Julius_Caesar) used in QALD-9. None of these cases are present in our approach.
Portability to New Datasets and Languages
The model-based approach can be easily adapted to a new RDF dataset and languages. To test the portability, we organized a one-week Hackathon on question answering over RDF data 25 and let users port our system to different datasets and languages. We provided a detailed guideline for adding a new dataset and language. The participants with different backgrounds tested the portability of our system for four datasets:
ArCo dataset
26
(Carriero et al., 2019) aggregates knowledge of Italian Cultural Heritage through the use of several conceptual ontologies and data from the Italian National Catalogue of Cultural properties. The dataset consists of a network of
Wikidata
27
contains
AIFB dataset 28 contains information on scientific publications such as publication titles, abstracts, authors, professors, date of publication, place of publication, etc.
LexInfo 29 is an ontology that defines data categories for the Lemon model. 30
The QA system was ported to all these datasets by the participants of the Hackathon. One group of participants created lexical entries for both English and Italian on three frame types for the ArCo dataset. Another group of participants created lexical entries for three languages (i.e., Italian, English, and Bangla) for Wikidata. As per our knowledge, this is the first question-answering system over linked data for the Bangla language. The third group of participants created lexical entries for English and Spanish for the AIFB dataset and
Table 12 shows the results of porting these four new datasets to the QA system for
The Results of Porting Four New Datasets (i.e., ArCo Carriero et al., 2019, Wikidata, AIFB Dataset, and LexInfo) to the QA System for Five Languages (i.e., English, Italian, German, Spanish, and Bangla).
The Results of Porting Four New Datasets (i.e., ArCo Carriero et al., 2019, Wikidata, AIFB Dataset, and LexInfo) to the QA System for Five Languages (i.e., English, Italian, German, Spanish, and Bangla).
As shown in the table, the approach allows non-expert users to port the question-answering system to a new RDF dataset by adding lexical entries for that dataset in only a few hours and with little training.
Our QA system is consistent and controllable because if we add a lexical item to the lexicon, it guarantees that all questions involving a syntactic construction supported by the system in which the lexical item can be used will be parsed correctly. Figure 11 shows the number of questions that can be parsed for each lexical entry and the F

Consistency: Result of the incremental extension of the QA system for
Consider the lexical entry ‘born’ (in) in Figure 11, which is an intransitive verb (i.e.,
In Section 2.5, we provide details, along with an example, of how the grammar rule templates (GRT) are obtained from sentence templates. The five GRTs for the intransitive verb of type
The grammar rules (GRs) are then automatically generated by instantiating these GRTs using the lexical entry ‘born’ (in), as shown below.
When adding the lexical entry ‘born’ (in) to the lexicon (as shown in Figure 11), the number of parseable questions increased from
Another example of consistency and controllability is shown in Table 13, where we illustrate the effects of removing a top-ranked lexical entry, a syntactic frame, and a grammar rule from the lexicon and the grammar. We select the top-ranked element by counting the number of questions covered by an element in the QALD series training datasets (QALD-9, QALD-8, QALD-7, QALD-6, and QALD-5) and ranking them in descending order. Following that, we demonstrate the number of questions that cannot be parsed in our approach when removing these elements from the lexicon, along with the resulting decrease in F
The Impact of Removing a Top-ranked Lexical Entry, Grammar Rule (GR), Grammar Rule Template (GRT), and syntactic Frame from the English Lexicon (as Detailed in 3.1).
The evaluation is conducted on the QALD-9 test data set. Here, ind* refers to inductive mode, inc* refers to incremental mode of evaluation, Template* refers to grammar rule template (as detailed in Section 5.10.3), Rule* refers to grammar rule (as detailed in Section 5.10.2), % refers to the number questions that cannot be parse after removing these elements, and m refers to millions. P refers to Precision, R refers to Recall, and F
Consider the top-ranked lexical entry ‘high’ (i.e.,
In DBpedia, there are
Impact of Grammar Rule (GR) Removal
To demonstrate the impact of removing a grammar rule, we consider the top-ranked grammar rule in the QALD series. The top-ranked grammar rule is as follows:
As can be seen in Table 13, after removing this rule, approximately
Impact of Grammar Rule Template Removal
Furthermore, to demonstrate the consistency and controllability of our approach, we remove the top-ranked GRT in the QALD series. The template is shown below:
The grammar rule generated by instantiating the template with the lexical entry of relative (e.g., ‘death date’ (of)) is shown below:
Therefore, the template can be instantiated by a total of
Impact of Syntactic Frame Removal
We repeated the experiment for the top-ranked syntactic frame (i.e.,
There are a total of
There are
In contrast, for Machine Learning (ML) systems in general, it is unclear what the impact of adding one example is in terms of the behaviour of the system. Usually, several examples of the same or similar type need to be provided for the ML system to learn a pattern, leading to high redundancy in training data.
Discussion
Most work on question answering over linked data currently builds on systems that use machine learning to learn a model to map NLQs into SPARQL. Our approach has the following advantages over these systems:
These systems can not be extended to cover new types of questions in a principled way. Our approach overcomes the limitation in a more principled way by simply adding a new syntactic construction to the system, which takes only
Another limitation of machine learning approaches is that the addition of new training questions involving a new lexical element does not guarantee that the system can induce the semantics of that lexical element correctly. For example, adding a lexical entry for
Further, the machine learning-based approaches follow an inductive paradigm to port the system to a new language. The paradigm is costly and time-consuming since it requires adding training data for that language. In our approach, porting the system to a new language involves two steps: (i) creating lexical entries and (ii) creating sentence templates considering the features of that particular language. For example, we ported the system to German by adding lexical entries for all syntactic frames considering features of the German language such as the gender and case information for nouns in Lemon format (as shown in Section 3.2.1). We also ported the system to Italian (Section 3.2.2) and Spanish (Section 3.2.3) and showed that we only needed to add language-specific properties to the lexicon and adapted the sentence templates with respect to the features of these languages, but the process remains the same.
The machine learning-based approaches, for example, Zhang et al., 2016b, rely on algorithms having a large number of learning parameters and require a significant amount of training data. Creating a new training dataset for the new dataset is very expensive (Berant et al., 2013). Finally, our approach operates independently of training data. Instead, the capabilities of our system can be increased by extending the lexicon, which is a completely different paradigm. This allows us to improve our system step by step (as detailed in Section 5.3).
In the ’Hackathon on question answering over RDF data’ event, the participants were able to create a basic version of the QA system for the ArCo dataset (i.e., Italian Cultural Heritage linked data) (Carriero et al., 2019) for English and Italian in
Vollmers et al. (2021b) presented a question-answering over knowledge graph (KGQA) approach that requires less effort to create training data compared to the state-of-art machine learning approaches as it uses existing benchmarks as training data. The approach learns templates from existing benchmarks (in particular, QALD-8 and QALD-9) by employing machine learning and feature engineering to learn to classify NLQs into isomorphic basic graph patterns. A disadvantage of the approach is that it depends heavily on benchmarks which limit the system to the language and RDF dataset of the existing benchmarks. Moreover, the research in the field of KGQA suffers from the lack of multilingual benchmarks (Loginova et al., 2021; Neves et al., 2020), and only a few benchmarks (i.e., QALD series
32
(Usbeck et al., 2018), LC-QuAD
33
(Dubey et al., 2019), CWQ (Cui et al., 2022), RuBQ (Rybin et al., 2021), etc.) exist that involve multiple languages. In contrast, our approach can be adapted to a new language without the availability of benchmarks. For example, to the best of our knowledge, there are no benchmarks available for the Bangla language, yet the participants of the ’Hackathon on question answering over RDF data’ event were able to create a basic version of the QA system for Wikidata for the Bangla language in
There are also QALD that exploit large language models (Banerjee et al., 2023; Ouyang et al., 2022). One promising system in this approach is ChatGPT (Faria et al., 2023; Tan et al., 2023). Our approach outperforms ChatGPT in zero-shot scenarios across four languages, in both inductive and incremental modes. However, in the few-shot scenario, ChatGPT outperforms our approach in the inductive mode. It is unclear whether the QALD-9 dataset was part of the data used to train ChatGPT. Nevertheless, our approach outperforms ChatGPT in the few-shot scenario in the incremental evaluation mode.
We compare how ChatGPT performs in comparison to our approach and outline the cases where our approach performs better. As an example, when evaluating with the QALD benchmark (i.e., QALD-9 dataset), we found that only a few instances (i.e.,
Besides systems using machine learning techniques, there are rule-based systems that rely on a set of rules to map natural language (NL) questions into a representation that can be either directly evaluated over the knowledge graph or rely on graph exploration to map the representation of the NL question into a full-fledged SPARQL query. Although no training data is required by the rule-based systems, there are limitations to porting these systems to a new language. The rule-based systems and their limitations compared to our approach are as follows.
To the best of our knowledge, WDAqua-core1 (Diefenbach et al., 2020a) is the only QA system that is implemented for languages other than English such as German, Spanish, French, and Italian and ported for several RDF datasets (Diefenbach et al., 2020b). For lexicalizations, WDAqua-core1 maps n-grams (of natural language sentences) to KB elements by comparing an n-gram with an entity’s rdfs:label, which is limited to the languages available in the dataset. Moreover, there is a well-known lexical gap between content expressed in the form of natural language (NL) texts and content stored in an RDF KB.
Similar to WDAqua-core1, some approaches (Gashkov et al., 2022; Perevalov et al., 2022c) use rdfs:label to bridge the lexical gap between natural language terms and KB elements, enhancing the quality of lexicalization by analyzing SPARQL queries and determining their correctness with respect to the given question. This correction is performed using the VANiLLa Dataset (Magnini et al., 2002), which contains both correct and incorrect answers to questions. However, the dataset is limited to English and Spanish. Furthermore, the approach was not evaluated with respect to the QALD benchmark, leaving its effectiveness in the question-answering system unknown.
In contrast, in our approach, the Lemon model of lexicalization (detailed in Section 2.5) is not limited to any language, and the questions are more natural as the lexicalization is provided by a language expert. For example, consider the lexical entry ‘high’ (as shown in Figure 8); the semantics of this gradable adjective is captured with respect to the property dbo:elevation. However, such lexicalization is not possible when considering the WDAqua-core1 approach, which uses
WDAqua-core1 is based on the observation that many questions can be understood from the semantics of the words but the syntax of the question has less importance. The authors claimed that the system is adaptable to any language by changing only the stop word removal and stemming, but provide no evidence of how language language-specific features (i.e., gender information, grammatical cases, word order, verb types, etc.) are incorporated into their approach. In contrast, we create a lexicon for each language (as detailed in Section 3) by incorporating language-specific features in Lemon format and sentence templates.
Similar to WDAqua-core1, there are pattern-based approaches (Abujabal et al., 2017; Rico et al., 2015; Steinmetz & Ann-Katrin, 2019) that make use of a number of patterns (i.e., a pattern library) that have been defined to map natural language to SPARQL queries. But these works are either in the preliminary stage (Rico et al., 2015) and provide only two patterns as proof of concept or have been developed for the English language (Steinmetz & Ann-Katrin, 2019) only. We adopted the underlying idea of using patterns but we use automatically generated grammar rules, which can be easily extended to another language and RDF dataset.
SemGraphQA (Beaumont et al., 2015), gAnswer (Zou et al., 2014), and Xser (Xu et al., 2014) use external tools (i.e., parts-of-speech taggers, dependency parsers, semantic parsers, etc.) and other approaches such as AskNow (Dubey et al., 2016) and DEANNA (Yahya et al., 2012) use language resources or dictionaries (such as WordNet, BOA, etc.) to map natural language terms to KB elements. Both the language tools and resources are limited to a few languages and it is very difficult (and time-consuming) to adapt them to a new language. In contrast, our approach is independent of any such tool or external dictionary and porting to a new language is straightforward by creating lexical entries (as explained in Section 3) and by writing sentence templates for that language.
Creating a question answering system on top of a new RDF dataset is still challenging and cumbersome (Diefenbach et al., 2018). The main open challenge remains portability (Diefenbach et al., 2020b), that is, the ability to easily apply a QA algorithm to new and previously untested RDF datasets. Qanary (Both et al., 2016) achieved limited portability to a new dataset by integrating a consistent number of tools. Diefenbach et al. (2020b) provided a QA system and argued that the system can be ported to a new RDF dataset with minimal investments, but provide no evidence of how much time it requires to port to a new dataset. Our approach allows us to port our system to a wide range of RDF datasets in hours, not days (as detailed in Section 5.9).
Conclusion
We present a multilingual question-answering system that relies on a model of the lexicon-ontology interface in which the meaning of lexical entries is specified with respect to a given vocabulary or ontology. More specifically, our model-based approach automatically generates a lexicalized grammar given a lexicon and sentence templates in a particular language and given an RDF dataset. We present the high-level architecture of our multilingual QA system.
Following this, we describe the automatically generated grammar for five syntactic frames at two levels of abstraction. First, we describe GRTs that are independent of specific lexical entries. Secondly, we provide example instantiations of these templates using lexical entries for illustration. We also include SPARQL queries to retrieve the values of non-terminals in the grammar rules. Further, we demonstrate the methods and implementations of creating a lexicon for English, also adapting the system to other languages by creating lexical entries and sentence templates for these languages.
To compare with machine learning-based approaches, we evaluated our approach in two modes: inductive and incremental, showing that our approach outperforms all state-of-the-art approaches in the incremental evaluation mode. So far there is no system described in the literature that works for four languages (i.e., English, German, Italian, and Spanish) while reaching state-of-the-art performance on all of them for QALD-9 benchmarks and outperforming current QA systems.
A necessary prerequisite for our grammar generation approach is the availability of a Lemon lexicon for each supported language, which is manually created in our approach. Previous work (Elahi et al., 2023) has proposed a method for the fully automatic creation of a Lexicon for QA systems using LexExMachina (Ell et al., 2021) that uses association rules to identify correspondences between lexical elements on the one hand and ontological vocabulary elements on the other hand. Although this method significantly reduces the human effort involved in creating a lexicon for a language and linked data, it causes a
Furthermore, our approach can handle a limited form of composition that allows us to nest some rules into others. In future work, we will investigate how to implement a more principled approach to semantic composition by Flexible Semantic Composition with DUDES (Cimiano, 2009). We also intend to enable the community to contribute to and adapt the grammar generation to other languages. More specifically, we intend to cover Indian and Arabic languages, as there is no QA system for an RDF dataset described in the literature that works for these languages. In this research, we focus on an established task—question answering over linked data (Diefenbach et al., 2018; Unger et al., 2014)—which does not involve semi-structured or unstructured data.This task gained popularity through the QALD challenge, established in 2012, which has undergone 10 iterations. In future work, we will investigate applying the methodology to semi-structured or unstructured data.
Footnotes
Acknowledgments
The work described here is supported by “Linked-data aware NLP services (WG2)” of the Nexus Linguarum (
) as well as “Lexical and conceptual linking (WG3)” of Prêt-à-LLOD (the European Commission under grant 825182). B. Ell has been partially supported by the SIRIUS centre: Norwegian Research Council project No 237898 and Integreat—Norwegian Centre for knowledge-driven machine learning, project number 332645. Thanks to the participants of the ‘‘Hackathon on question answering over RDF data.’’ Special thanks to participant Japesh Methuku from ADAPT, the world-leading SFI Research Centre for AI-Driven Digital Content Technology in Ireland, for actively participating in the Hackathon and contributing to the system. The authors also extend our appreciation to participants Gennaro Nolano and Maria Pia di Buono from the University of Naples ’L’Orientale,’ Italy, for their valuable contributions to the Italian language. Additionally, they want to acknowledge and thank Wasim Mahmud Surjo from BRAC University, Bangladesh, and Subhana Mahmud Toshi from Arab Open University, Bahrain, for their contributions to the Bangla language.
Funding
The authors received no financial support for the research, authorship, and/or publication of this article.
Declaration of Conflicting Interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Notes
Appendix A. SPARQL Queries for Grammar Rules of Lexicon Entries of LexInfo Frames
