# πΈοΈ oxigraph-web


[](https://crates.io/crates/oxigraph-web)

A **high-performance**, full-featured web API for [**Oxigraph**](https://github.com/oxigraph/oxigraph) β a modern Rust-based RDF/SPARQL database.
Provides REST endpoints, SPARQL query support, RDF import/export, graph management, interactive dashboard, and OpenAPI documentation for building scalable **semantic web applications**.
---
## π Features
- β‘ **High-performance async REST API** built with [Salvo](https://salvo.rs/)
- π§ **SPARQL support** via GET & POST
- π‘ **SPARQL UPDATE support** via POST
- π¦ **CRUD operations** for RDF triples
- π₯ **RDF import**: Turtle, N-Triples, RDF/XML
- π€ **RDF export** in multiple formats
- π **Named graph management**
- πΎ **Persistent Oxigraph store**
- π₯οΈ **Interactive dashboard** for real-time monitoring and visualization
- π **OpenAPI / Swagger UI documentation**
- ποΈ Ready for **production and scalable semantic web apps**
---
## ποΈ Installation
Make sure you have Rust installed:
```bash
Clone the repository:
```bash
git clone https://github.com/darixsamani/oxigraph-web.git
cd oxigraph-web
cargo build --release
```
## π₯οΈ Running the Server
```bash
cargo run --release
```
Server runs on:
```
http://localhost:8080
```
## π§© API Endpoints
| `/health` | GET | Server health check |
| `/triples` | POST | Insert a triple |
| `/sparql` | POST | SPARQL query |
| `sparql/update` | POST | SPQRQL update query
| `/sparql?query=` | GET | SPARQL query via URL |
| `/graphs` | POST / DELETE | Create or delete named graphs |
| `/graphs` | GET | Get list of named graphs |
| `/rdf/import` | POST | Import RDF data (Turtle, N-Triples, RDF/XML) |
| `/rdf/export` | GET | Export RDF data in selected format |
| `/docs` | GET | OpenAPI / Swagger UI |
## π Example Requests
**Insert Triple**
```bash
curl -X POST http://localhost:8080/triples \
-H "Content-Type: application/json" \
-d '{
"subject":"http://example.com/alice",
"predicate":"http://xmlns.com/foaf/0.1/name",
"object":"http://example.com/Alice"
}'
```
**SPARQL Query (POST)**
```bash
curl -X POST http://localhost:8080/sparql \
-H "Content-Type: application/json" \
-d '{"query":"SELECT ?s ?p ?o WHERE { ?s ?p ?o }"}'
```
**Export RDF in Turtle**
```bash
curl -X GET "http://localhost:8080/rdf/export?format=ttl"
```
## βοΈ Configuration
- Persistent database folder: data/ (can be changed in `db/oxigraph.rs`)
- Supported RDF formats for import/export: `ttl`, `nt`, `rdf`
## π₯ Video Demonstration
Get a quick overview of how **Oxigraph Web** works:
[Screencast from 2026-03-25 22-23-49.webm](https://github.com/user-attachments/assets/14136ef0-d1b4-400c-9782-96202e36eb00)
## π License
This project is licensed under the MIT License. See the LICENSE
file for details.
Made with β€οΈ by [darixsamani](https://github.com/darixsamani)