RSP-RS
A high-performance RDF Stream Processing engine in Rust built on Oxigraph.
Installation
[]
= "0.3.2"
Or:
Quick Start
use RSPEngine;
use *;
Key Concepts
Window Closure & Results
Results emit when windows close, triggered by event timestamps (not wall-clock time):
stream.add_quads?; // Added to window
stream.add_quads?; // Added to window
stream.add_quads?; // Closes window → results emitted!
Important: Always call close_stream() after your last event to trigger final window closures.
Timestamps vs Wall-Clock
The system is timestamp-driven:
- You can add all events instantly
- Only the
timestampparameter matters - Windows close when an event's timestamp exceeds the window's end time
Features
- RSP-QL Support - Full RSP-QL syntax for continuous queries
- Sliding Windows - Time-based windows with configurable range and step
- SPARQL Aggregations - COUNT, AVG, MIN, MAX, SUM with GROUP BY
- Stream-Static Joins - Join streaming data with static knowledge
- Multi-threaded - Efficient concurrent processing
- Cloneable Streams - No lifetime issues, easy API
API
RSPEngine
new(query)- Create engine with RSP-QL queryinitialize()- Initialize windows and streamsstart_processing()- Start processing, returns result receiverget_stream(name)- Get stream for adding dataclose_stream(uri, timestamp)- Trigger final window closuresadd_static_data(quad)- Add static background data
RDFStream
add_quads(quads, timestamp)- Add quads with event timestamp- Cloneable - can be stored and reused
Debugging
let window = engine.get_window.unwrap;
let mut w = window.lock.unwrap;
println!;
w.set_debug_mode; // Enable verbose logging
Performance
- Throughput: Up to 1.28M quads/second
- Latency: ~400-700µs query execution on 30s windows
- Memory: ~2.5KB per quad in window
Run benchmarks:
Examples
See examples/streaming_lifecycle.rs and tests/integration/ for more examples.
Documentation
License
MIT License - Copyright Ghent University - imec
Acknowledgments
Rust port of RSP-JS. Thanks to the original authors for their excellent work.
Contact
Kush Bisen or create an issue on GitHub.