Skip to content

gkoulis/BIO-STREAMS-KG

Repository files navigation

BIO-STREAMS

BIO-STREAMS Knowledge Graph

This project provides a Docker-based setup for running Apache Jena Fuseki, initializing a TDB2 dataset, loading your ontology, and running SPARQL queries efficiently.

Everything is automated with scripts for smooth operation.


🚀 Quick Start

1. Start Fuseki Server

Spin up the Fuseki server using Docker Compose:

docker compose -f ./BIO-STREAMS-KG-Docker/docker-compose.yml up -d

To stop the server:

docker compose -f ./BIO-STREAMS-KG-Docker/docker-compose.yml down

2. Setup Dataset

We avoid the complexity of custom Docker images by using a script to create the dataset dynamically.

Make the setup script executable and run it:

chmod +x ./scripts/setup-fuseki.sh
./scripts/setup-fuseki.sh

3. Load Ontology

You can load your ontology using either the provided script or a direct curl command.

Option 1: Script

chmod +x ./scripts/load-ontology.sh
./scripts/load-ontology.sh

Option 2: Manual curl

curl -u admin:admin -X POST \
  -H "Content-Type: application/rdf+xml" \
  --data-binary "@BIO-STREAMS-Ontology.rdf" \
  "http://localhost:3030/biostreams/data"

🧪 Test the Setup

To verify that the dataset is up and running, run a simple test query:

curl -G http://localhost:3030/biostreams/query \
  --data-urlencode "query=SELECT * WHERE { ?s ?p ?o } LIMIT 10"

You should see results in JSON format, confirming your dataset is active!


🧰 Run SPARQL Queries

Use the script to run any SPARQL query file against your knowledge graph.

Run a query (provide the path to your SPARQL query file):

chmod +x ./scripts/run-sparql-query.sh
./scripts/run-sparql-query.sh ./data/SPARQL-Query1.txt

💡 Notes

  • The Fuseki configuration (BIO-STREAMS-Fuseki-Config.ttl) is simple and effective.
  • Whether you load the config at startup (--config=fuseki-config.ttl), create the dataset via the UI, or use the HTTP API, the result is the same.
  • Using the provided setup script avoids the need for custom Docker images like the one in BIO-STREAMS-KG-Docker-Custom.

📂 Project Structure

BIO-STREAMS-KG-Docker/           # Docker Compose setup
BIO-STREAMS-KG-Docker-Custom/    # (Optional) Custom Docker image setup
scripts/                         # Automation scripts
data/                            # Ontology and SPARQL query files
BIO-STREAMS-Fuseki-Config.ttl    # Fuseki assembler config (optional)
BIO-STREAMS-Ontology.rdf         # Ontology RDF/XML file

🔒 Default Credentials

  • Username: admin
  • Password: admin

Make sure to change these credentials in production environments!


Enjoy working with the BIO-STREAMS Knowledge Graph! 🎉

About

BIO-STREAMS Knowledge Graph

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published