Commit ae005b7e authored by j.hoerdt's avatar j.hoerdt
Browse files

produce correct json for string only attributes

parent 6076716a
......@@ -72,7 +72,7 @@ class Sensor {
);
add_attribute(body,
"21.T11148/709a23220f2c3d64d1e1",
rec.get("sensor_type").asString()
'\"' + rec.get("sensor_type").asString() + '\"'
);
add_attribute(body,
"21.T11148/68c2cc7f0ceaa3e499ec",
......@@ -80,12 +80,13 @@ class Sensor {
);
add_attribute(body,
"21.T11148/9a15a4735d4bda329d80",
"https://sensor.community"
"\"https://sensor.community\""
);
add_attribute(body,
"21.T11148/4eaec4bc0f1df68ab2a7",
"{\"Owners\":[{\"Owner\":{\"ownerName\":\"SensorCommunity\",\"ownerContact\":\"contact@open-forecast.eu\"}}]}"
);
Main.glogger.fine("sent body: " + body);
HttpRequest request = HttpRequest.newBuilder(URI.create(Main.pid_registry_uri + target_uri))
......@@ -149,9 +150,9 @@ class Sensor {
" 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 " +
"with s, type.sensor_type as sensor_type\n" +
"with s, type.sensor_type as sensor_type, type.manufacturer as manufacturer\n" +
"match (s)--(all_measurements:MeasurementLocation)" +
"return s.pid, id(s), sensor_type, min(all_measurements.first_msg), max(all_measurements.last_msg)"
"return s.pid, id(s), sensor_type, manufacturer, min(all_measurements.first_msg), max(all_measurements.last_msg)"
).withParameters(properties);
}
......
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