Skip to content

An interactive web app built with Streamlit to visualize tables or graphs, and execute SPARQL queries. The app is designed with a simple, user-friendly layout to make it easier to interact with and explore linked data.

License

Notifications You must be signed in to change notification settings

group-f3-dsp/streamlit-sparql-ui

Repository files navigation

Streamlit SPARQL Query UI

This Streamlit app provides an interactive user interface to visualize tables or graphs, and execute SPARQL queries. The app is designed with a simple, user-friendly layout to make it easier to interact with and explore data.

Index

  1. Features
  2. Installation
  3. Usage
  4. Project Structure
  5. Requirements
  6. Running the WebVOWL Server
  7. Using OWL2VOWL
  8. Demo & Teaser Videos
  9. Contributing
  10. License
  11. Technologies Used

Features

  • Data visualization
  • SPARQL query execution
  • Chat interface aware of the current SPARQL query
  • Integration with WebVOWL for visualizing ontologies

Installation

  1. Clone this repository:

    git clone https://github.com/group-f3-dsp/streamlit-sparql-ui.git
    cd streamlit-sparql-ui
  2. Set up the virtual environment:

    python -m venv .venv
  3. Activate the virtual environment:

    • On Windows:
      .venv\Scripts\activate
    • On macOS/Linux:
      source .venv/bin/activate
  4. Install the required dependencies:

    pip install -r requirements.txt
  5. Set up your OpenAI API key and Gemini API key in the Streamlit secrets:

    echo "[secrets]" > .streamlit/secrets.toml
    echo "OPENAI_API_KEY = 'your-openai-api-key'" >> .streamlit/secrets.toml
    echo "GEMINI_API_KEY = 'your-gemini-api-key'" >> .streamlit/secrets.toml

Usage

  1. Run the Streamlit app:

    streamlit run main.py
  2. Open your browser and navigate to:

    http://localhost:8501
    

Project Structure

streamlit-sparql-ui/
│
├── .streamlit/       # Streamlit configuration and secrets
   ├── secrets.toml
├── archive/          # Directory containing archive code
├── data/             # Directory containing ontology and example files
│   ├── example.owl
│   ├── example.json
│   ├── dbpedia_ontology.owl
│   ├── dbpedia_ontology.json
│   └── smallTest.md
├── main.py           # Main Streamlit app code
├── README.md         # Documentation for the app
├── requirements.txt  # Python dependencies
└── sparql_utils.py   # Utility functions for running SPARQL queries
└── chat_utils.py     # Utility functions for the Gemini chat
└── config.py         # Configuration file

Requirements

Running the WebVOWL Server

Prerequisites

  • Node.js

Steps

  1. Download and install Node.js from Node.js download page)

  2. Clone the WebVOWL repository:

    git clone https://github.com/VisualDataWeb/WebVOWL.git
    cd WebVOWL
  3. Install dependencies and build the project:

    npm install
  4. Build the project:

    npm run-script release
  5. Install serve globally:

    npm install serve -g
  6. Run the WebVOWL server locally:

    serve deploy/
  7. Access WebVOWL:

Using OWL2VOWL

With OWL2VOWL, you can convert an OWL file to JSON. Follow these steps to set up and use OWL2VOWL:

  1. Build the Docker image:

    docker build -t owl2vowl/owl2vowl .
  2. Run the Docker container:

    docker run --rm -d -p 8080:8080 owl2vowl/owl2vowl
  3. Convert an OWL file to JSON:

    • First, get the timestamp:

      curl -X GET http://localhost:8080/timestamp
    • Then, supply the OWL file and get the JSON back:

      curl -X POST -F "file=@path/to/your/file.owl" http://localhost:8080/convert

    Replace path/to/your/file.owl with the actual path to your OWL file.

Demo & Teaser Videos

Contributing

Feel free to open issues or submit pull requests if you have any improvements or bug fixes.

License

This project is licensed under the GPL-3.0 license.

Technologies Used

Python Docker Node.js

About

An interactive web app built with Streamlit to visualize tables or graphs, and execute SPARQL queries. The app is designed with a simple, user-friendly layout to make it easier to interact with and explore linked data.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages