Linked Data technologies are used in many applications. Despite the ease of the triple form, learning the standard query language SPARQL and understanding SPARQL queries might become cumbersome. For example, if IRIs of the knowledge graph are formed using numeric IDs (e.g., Wikidata) a human might need additional effort to understand the semantics of a SPARQL query. In addition, the sheer number of properties and classes modeled in a knowledge graph can overwhelm developers and end users. Hence, converting SPARQL to a native tongue might develop a deeper query structure understanding and mitigate possible mistakes made by developers.
We present here LoRiS, a demo application that generates natural language representations of SPARQL queries for the DBpedia and Wikidata Knowledge Graphs. For the generation, the demo supports 3 Large Language Models that can be used with 2 prompt types. The demo provides the option of generating natural-language text in 3 languages.
This tool was implemented in Python 3 using the Streamlit library.
The online demo is available at https://wse-research.org/LoRiS-LLM-generated-representations-of-SPARQL-queries (or shorter at https://wse-research.org/LoRiS).
python -m streamlit run loris--llm-based-explanations-for-sparql-queries.py --server.port=8501
After that, you can access the application at http://localhost:8501.
The application is available at Dockerhub for free use in your environment.
docker run --rm -p 8501:8501 --name loris --env-file=service_config/files/env wseresearch/loris-llm-generated-representations-of-sparql-queries
docker run --rm -p 8501:8501 --name loris --env-file=service_config/files/env loris:latest
Now, you can access the application at http://localhost:8501.
We are happy to receive your contributions. Please create a pull request or an issue. As this tool is published under the MIT license, feel free to fork it and use it in your own projects.