@@ -61,11 +61,11 @@ Register a new JanusQL query.
6161``` json
6262{
6363 "query_id" : " sensor_query_1" ,
64- "janusql" : " SELECT ?sensor ?temp FROM HISTORICAL FIXED WINDOW [2024-01-01T00:00:00Z, 2024-01-02T00:00:00Z ] WHERE { ?sensor <http://example.org/ temperature> ?temp . }"
64+ "janusql" : " PREFIX ex: <http://example.org/> SELECT ?sensor ?temp FROM NAMED WINDOW ex:histWindow ON STREAM ex:sensorStream [START 1704067200 END 1704153600 ] WHERE { WINDOW ex:histWindow { ?sensor ex: temperature ?temp . } }"
6565}
6666```
6767
68- ** Response (201 Created ):**
68+ ** Response (200 OK ):**
6969``` json
7070{
7171 "query_id" : " sensor_query_1" ,
@@ -375,7 +375,7 @@ curl -X POST http://localhost:8080/api/queries \
375375 -H " Content-Type: application/json" \
376376 -d ' {
377377 "query_id": "temp_query",
378- "janusql": "SELECT ?sensor ?temp FROM HISTORICAL FIXED WINDOW [2024-01-01T00:00:00Z, 2024-01-02T00:00:00Z ] WHERE { ?sensor <http://example.org/ temperature> ?temp . }"
378+ "janusql": "PREFIX ex: <http://example.org/> SELECT ?sensor ?temp FROM NAMED WINDOW ex:histWindow ON STREAM ex:sensorStream [START 1704067200 END 1704153600 ] WHERE { WINDOW ex:histWindow { ?sensor ex: temperature ?temp . } }"
379379 }'
380380```
381381
@@ -439,7 +439,7 @@ response = requests.post(
439439 f " { BASE_URL } /api/queries " ,
440440 json = {
441441 " query_id" : " my_query" ,
442- " janusql" : " SELECT ?s ?p ?o FROM HISTORICAL FIXED WINDOW [2024-01-01T00:00:00Z, 2024-01-02T00:00:00Z ] WHERE { ?s ?p ?o }"
442+ " janusql" : " PREFIX ex: <http://example.org/> SELECT ?s ?p ?o FROM NAMED WINDOW ex:histWindow ON STREAM ex:sensorStream [START 1704067200 END 1704153600 ] WHERE { WINDOW ex:histWindow { ?s ?p ?o . } }"
443443 }
444444)
445445print (f " Register: { response.json()} " )
@@ -477,7 +477,7 @@ async function demo() {
477477 // Register a query
478478 const registerResponse = await axios .post (` ${ BASE_URL } /api/queries` , {
479479 query_id: ' js_query' ,
480- janusql: ' SELECT ?s ?p ?o FROM HISTORICAL FIXED WINDOW [2024-01-01T00:00:00Z, 2024-01-02T00:00:00Z ] WHERE { ?s ?p ?o }'
480+ janusql: ' PREFIX ex: <http://example.org/> SELECT ?s ?p ?o FROM NAMED WINDOW ex:histWindow ON STREAM ex:sensorStream [START 1704067200 END 1704153600 ] WHERE { WINDOW ex:histWindow { ?s ?p ?o . } }'
481481 });
482482 console .log (' Registered:' , registerResponse .data );
483483
@@ -606,7 +606,7 @@ For a simple demo dashboard with "Start Replay" and "Start Query" buttons:
606606 headers: { ' Content-Type' : ' application/json' },
607607 body: JSON .stringify ({
608608 query_id: QUERY_ID ,
609- janusql: ' SELECT ?sensor ?temp FROM HISTORICAL FIXED WINDOW [2024-01-01T00:00:00Z, 2024-01-02T00:00:00Z ] WHERE { ?sensor <http://example.org/ temperature> ?temp . }'
609+ janusql: ' PREFIX ex: <http://example.org/> SELECT ?sensor ?temp FROM NAMED WINDOW ex:histWindow ON STREAM ex:sensorStream [START 1704067200 END 1704153600 ] WHERE { WINDOW ex:histWindow { ?sensor ex: temperature ?temp . } }'
610610 })
611611 });
612612
@@ -844,4 +844,4 @@ Options:
844844
845845For issues, feature requests, or questions:
846846- GitHub Issues: https://github.com/SolidLabResearch/janus/issues
847- - Documentation: https://github.com/SolidLabResearch/janus
847+ - Documentation: https://github.com/SolidLabResearch/janus
0 commit comments