--- license: mit language: - en --- ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6672c4d07584614dcaac1f46/R5g4fowcFiu5RD1Ocw6oS.jpeg) # A Dataset for Semantic Parsing of Natural Language Into SPARQL for Wikidata ## Dataset Summary The Natural Language to SPARQL (Lexicographic Data) dataset is designed for the task of semantic parsing, specifically converting natural language utterances into SPARQL queries targeting lexicographic data within the Wikidata Knowledge Graph. This dataset was created as part of a Master's thesis at the University of Zurich. The dataset contains natural language utterances focused on lexicographic data and their corresponding SPARQL queries. These SPARQL queries were generated using 78 hand-written templates, which were populated with data from the Wikidata Knowledge Graph. The templates were designed to minimize the use of specific Knowledge Graph identifiers (e.g., Q-items). ## Supported Tasks and Leaderboards 1. **Semantic Parsing**: The primary task supported by this dataset is semantic parsing, where the goal is to convert natural language utterances into SPARQL queries. 2. **Question Answering**: The dataset can also be used for question answering tasks within the context of lexicographic data in Wikidata. ## Languages The natural language utterances in this dataset are in English. For multilingual utterances, selected words can be in other languages. ## Dataset Structure ### Data Instances Each instance in the dataset consists of: 1. A natural language utterance targeting lexicographic data on Wikidata. 2. An identifier of the template that was used to generate the tuple 3. A corresponding SPARQL query for the Wikidata Knowledge Graph. ### Example 1. *utterance*: where does the word color come from 2. *template_name*:q20 3. *template*: "SELECT ?etonymLexeme ?qitemLanguageOfOrigin ?etonym ?qitemLanguageOfOriginLabel \ WHERE \ { \ VALUES ?lemma {'color'@en} . \ ?lexeme wikibase:lemma ?lemma ; \ wdt:P5191 ?etonymLexeme. \ ?etonymLexeme dct:language ?qitemLanguageOfOrigin; \ wikibase:lemma ?etonym . \ SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' } \ }" ### Data Fields 1. *utterance*: A string containing the natural language question or statement. 2. *template_name*: A string containing the corresponding identifier for the template used to generate the tuple. 3. *template*: A string containing the corresponding SPARQL query ## Intended Use This dataset is intended for research in semantic parsing and related tasks within the context of lexicographic data in the Wikidata Knowledge Graph. It can be used to train and evaluate models that convert natural language to SPARQL queries. ## Limitations - The dataset focuses specifically on lexicographic data and may not generalize to other domains within Wikidata. - The use of templates limits the diversity of SPARQL query structures. ## Citation Please cite the following if you use this dataset in your work: ``` @mastersthesis{author2024lexicographic, title={Natural Language to SPARQL: Querying Lexicographic Data on Knowledge Graphs}, author={Kilian Sennrich}, school={University of Zurich}, year={2024} } ``` ## Contact For any questions or issues with the dataset, please contact the author at kilian.sennrich@uzh.ch.