Commit 202e8bd8 authored by j.hoerdt's avatar j.hoerdt
Browse files

attempt to use new model in graphdb query

parent 75b80803
......@@ -123,19 +123,20 @@ class Sensor {
"merge (station:Station {location: $location })" +
//sensor merge here:
"merge (type)<-[:HAS_TYPE]-(s:Sensor {sensor_id: $sensor_id, coordinates: $coordinates})-[:BELONGS_TO]->(station)" +
"merge (type)<-[:HAS_TYPE]-(s:Sensor {sensor_id: $sensor_id})-[:BELONGS_TO]->(station)" +
"merge (s)-[:MEASURED_AT]->(measurement:MeasurementLocation {coordinates: $coordinates})" +
"merge (s)-[:IS_LOCATED]->(environment)" +
"merge (s)-[:HAS_MOBILITY]->(mobility)" +
string_if_exists.apply("country", "merge (s)-[:IN]->(country)") +
string_if_exists.apply("state", "merge (s)-[:IN]->(state)") +
string_if_exists.apply("city", "merge (s)-[:IN]->(city)") +
string_if_exists.apply("country", "merge (measurement)-[:IN]->(country)") +
string_if_exists.apply("state", "merge (measurement)-[:IN]->(state)") +
string_if_exists.apply("city", "merge (measurement)-[:IN]->(city)") +
"set" +
" s.first_msg = case when date_ > s.first_msg then s.first_msg else date_ end," +
" s.last_msg = case when date_ < s.last_msg then s.last_msg else date_ end " +
"return distinct s.pid, id(s), s.first_msg, s.last_msg, type.sensor_type"
" measurement.first_msg = case when date_ > measurement.first_msg then measurement.first_msg else date_ end," +
" measurement.last_msg = case when date_ < measurement.last_msg then measurement.last_msg else date_ end " +
"return distinct s.pid, id(s), measurement.first_msg, measurement.last_msg, type.sensor_type"
).withParameters(properties);
}
......
Supports Markdown
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