Skip to content

PoC using OpenAI API via LangChain to create SPARQL queries that query RDF cubes

License

Notifications You must be signed in to change notification settings

ktk/cube-sparql-llm

Repository files navigation

Integrating RDF Cubes with SPARQL and LLMs

Binder

Welcome to the intersection of structured data and cutting-edge AI! This Jupyter notebook aims to explore the synergy between RDF cubes, SPARQL queries, and Language Model (LM) capabilities. Using OpenAI's API through LangChain, we will dive into the process of constructing intuitive SPARQL queries to interact with RDF cubes, enhancing our data retrieval and analysis processes

This Proof of Concept (PoC) taps into the powerful combination of structured semantic web data (RDF cubes) and natural language processing.

Setting the Stage

The fastest way to try this is to click on the "launch binder" icon above. This will start a web-based container where you can directly try the notebook. The only thing you need to adjust is the OpenAI API key, which you can generate using the trial offer from OpenAI (requires credit card now apparently...).

If you wish to run the project locally, please follow the installation guide below.

Prerequisites

Ensure you have Python 3.10 installed to align with our dependencies.

Project Setup

  1. Install python.
  2. Install poetry globally.
pip install poetry
  1. Clone the repository and navigate to the project directory.
git clone https://github.com/ktk/cube-sparql-llm.git
cd cube-sparql-llm
  1. Create a virtual environment within the project directory.
python -m venv .venv
  1. Activate your virtual environment
source .venv/bin/activate
  1. Install dependencies using poetry in virtual environment
poetry install --no-root
  1. Run it within Visual Studio Code

The optimal experience is through Visual Studio Code equipped with the Jupyter extension . This setup allows seamless interaction with the playground/full_pipeline.ipynb notebook, our playground for our hands-on adventure.

Contributing

We welcome contributions from the community! If you have suggestions for improvements or want to contribute to the code, please feel free to fork the repository, make your changes, and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright 2023 Zazuko GmbH

About

PoC using OpenAI API via LangChain to create SPARQL queries that query RDF cubes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published