Live Janus queries use an MQTT-backed stream path. The local Compose setup
provides Eclipse Mosquitto on localhost:1883.
docker-compose up -d mosquitto
cargo run --bin http_server -- --host 127.0.0.1 --port 8080 --storage-dir ./data/storageCheck the broker separately if a live query does not receive results:
docker exec -it janus-mosquitto mosquitto_sub -t sensors -vThe CLI reads N-Triples or N-Quads, writes events to storage, and optionally publishes them to MQTT:
cargo run --bin stream_bus_cli -- \
--input data/sensors.nq \
--broker mqtt \
--topics sensors \
--rate 64 \
--mqtt-host localhost \
--mqtt-port 1883Use --broker none to write to storage without publishing. Use --rate 0 for
unlimited publication and --loop-file to repeat the source file.
Use an ON STREAM declaration with a positive range and step:
PREFIX ex: <http://example.org/>
REGISTER RStream ex:output AS
SELECT ?sensor ?value
FROM NAMED WINDOW ex:live ON STREAM ex:stream [RANGE 60000 STEP 30000]
WHERE { WINDOW ex:live { ?sensor ex:hasValue ?value . } }Register and start it through the HTTP API, then
subscribe to WS /api/queries/:id/results before replaying data.
- Check
/healthand/ops/statusbefore diagnosing the query. - Verify the broker host, port, and topic used by replay match the live setup.
- Use the WebSocket result endpoint, not an HTTP poll, to receive running-query results.
- Stop the query and replay explicitly when repeating an experiment.