Commit dea6b80b authored by Giustozzi Franco's avatar Giustozzi Franco
Browse files

first update

parent 81158164
This diff is collapsed.
......@@ -75,19 +75,15 @@ public class Example {
//Create csparql engine instance
CsparqlEngineImpl engine = new CsparqlEngineImpl();
//Initialize the engine instance
//The initialization creates the static engine (SPARQL) and the stream engine (CEP)
//engine.initialize(); true for enable timestamp function
engine.initialize(true);
// put static model
//engine.putStaticNamedModel("http://streamreasoning.org/larkc/csparql/LBSMA-static-k.rdf", "http://streamreasoning.org/larkc/csparql/LBSMA-static-k.rdf");
//engine.putStaticNamedModel("http://streamreasoning.org/roomConnection",CsparqlUtils.serializeRDFFile("/home/franco/Repositories/SR-OntoInd4/SROntoInd4/examples_files/ex.rdf"));
engine.putStaticNamedModel("http://streamreasoning.org/roomConne",CsparqlUtils.serializeRDFFile("/home/franco/Repositories/OntoInd4/NEWONTOLOGY.owl"));
engine.putStaticNamedModel("http://semanticweb.org/STEaMINg/ContextOntology-COInd4",CsparqlUtils.serializeRDFFile("/home/franco/Repositories/STEaMINg-SR_SitDet/ContextOntology-COInd4.owl"));
//String fileOntology = "/home/franco/Repositories/OntoInd4/test.owl";
String fileOntology = "/home/franco/Repositories/OntoInd4/NEWONTOLOGY.owl";
String fileOntology = "/home/franco/Repositories/STEaMINg-SR_SitDet/ContextOntology-COInd4.owl";
/*
final String queryBody = "REGISTER QUERY reasoning AS "
......@@ -116,33 +112,59 @@ public class Example {
+ "FILTER ( ?p1 > 2 && ?s2 != :sensorTM1 ) . "
+ " } ";
*/
String queryS6 = "REGISTER QUERY reasoning AS "
+ "PREFIX : <http://onto#> "
+ "PREFIX sosa: <http://www.w3.org/ns/sosa/> "
+ "PREFIX f: <http://larkc.eu/csparql/sparql/jena/ext#> "
//+ "CONSTRUCT { [] a :situationCODE1234 ; :hasObservation ?o1 ; :hasObservation ?o2 . } "
+ "SELECT ?o1 ?o2 ?o3 ?m ?pl "
+ "FROM STREAM <Stream_C_Wtemp> [RANGE 10s TUMBLING] "
+ "FROM STREAM <Stream_TG_temp> [RANGE 10s TUMBLING] "
+ "FROM STREAM <Stream_G_temp> [RANGE 10s TUMBLING] "
+ "FROM <http://streamreasoning.org/roomConne> "
+ "WHERE { "
+ "{ ?m :isPartOf ?pl ."
+ " ?m sosa:hosts sosa:S_C_Wtemp ."
+ " :S_C_Wtemp :madeObservation ?o1 ."
+ " ?o1 :hasSimpleResult ?p1 ."
+ " ?m sosa:hosts sosa:S_TG_temp ."
+ " :S_TG_temp :madeObservation ?o2 ."
+ " ?o2 :hasSimpleResult ?p2 ."
+ " ?m sosa:hosts sosa:S_G_temp ."
+ " :S_G_temp :madeObservation ?o3 ."
+ " ?o3 :hasSimpleResult ?p3 ."
+ "FILTER ("
//+ "f:timestamp(:sensorTM1,:madeObservation,?o1) < f:timestamp(?s1,:madeObservation,?o2)"
//+ " && "
+ "?p1 > 1.0 && ?p2 > 1.0 && ?p3 > 1.0 ). }"
+ "} ";
String queryS6 = "REGISTER QUERY S6-detection AS "
+ "PREFIX : <http://semanticweb.org/STEaMINg/ContextOntology-COInd4#> "
+ "PREFIX sosa: <http://www.w3.org/ns/sosa/> "
+ "SELECT ?m ?pl "
+ "FROM STREAM <Stream_C_Wtemp> [RANGE 15s STEPS 5s] "
+ "FROM STREAM <Stream_TG_temp> [RANGE 15s STEPS 5s] "
+ "FROM STREAM <Stream_G_temp> [RANGE 15s STEPS 5s] "
+ "FROM <http://semanticweb.org/STEaMINg/ContextOntology-COInd4#> "
+ "WHERE { "
+ " ?m :isPartOf ?pl . "
+ " ?m sosa:hosts sosa:S_C_Wtemp . "
+ " :S_C_Wtemp sosa:madeObservation ?o1 . "
+ " ?o1 sosa:hasSimpleResult ?v1 . "
+ " ?m sosa:hosts sosa:S_TG_temp . "
+ " :S_TG_temp sosa:madeObservation ?o2 "
+ " ?o2 sosa:hasSimpleResult ?v2 . "
+ " ?m sosa:hosts sosa:S_G_temp . "
+ " :S_G_temp sosa:madeObservation ?o3 . "
+ " ?o3 sosa:hasSimpleResult ?v3 . "
+ " FILTER ( "
+ " ?v1 > 60.0 && "
+ " ?v2 < 35.0 && "
+ " ?v3 > 45.0 ) . "
+ "} ";
//String queryS6 = "REGISTER QUERY reasoning AS "
// + "PREFIX : <http://semanticweb.org/STEaMINg/ContextOntology-COInd4#> "
// + "PREFIX sosa: <http://www.w3.org/ns/sosa/> "
// + "PREFIX f: <http://larkc.eu/csparql/sparql/jena/ext#> "
// //+ "CONSTRUCT { [] a :situationCODE1234 ; :hasObservation ?o1 ; :hasObservation ?o2 . } "
// + "SELECT ?o1 ?o2 ?o3 ?m ?pl "
// + "FROM STREAM <Stream_C_Wtemp> [RANGE 10s TUMBLING] "
// + "FROM STREAM <Stream_TG_temp> [RANGE 10s TUMBLING] "
// + "FROM STREAM <Stream_G_temp> [RANGE 10s TUMBLING] "
// + "FROM <http://semanticweb.org/STEaMINg/ContextOntology-COInd4> "
// + "WHERE { "
// + "{ ?m :isPartOf ?pl ."
// + " ?m sosa:hosts sosa:S_C_Wtemp ."
// + " :S_C_Wtemp :madeObservation ?o1 ."
// + " ?o1 :hasSimpleResult ?p1 ."
// + " ?m sosa:hosts sosa:S_TG_temp ."
// + " :S_TG_temp :madeObservation ?o2 ."
// + " ?o2 :hasSimpleResult ?p2 ."
// + " ?m sosa:hosts sosa:S_G_temp ."
// + " :S_G_temp :madeObservation ?o3 ."
// + " ?o3 :hasSimpleResult ?p3 ."
// + "FILTER ("
// //+ "f:timestamp(:sensorTM1,:madeObservation,?o1) < f:timestamp(?s1,:madeObservation,?o2)"
// //+ " && "
// + "?p1 > 1.0 && ?p2 > 1.0 && ?p3 > 1.0 ). }"
// + "} ";
String queryS7 = "REGISTER QUERY reasoning AS "
+ "PREFIX : <http://onto#> "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment