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

implement Name with sensor_id and delete AlternativeIdentifier

sensor_type is stored in Model
parent 2598908e
......@@ -65,11 +65,14 @@ class Sensor {
add_attribute(body, "100", "HS_ADMIN", admin_data);
}
add_attribute(body,
"1",
"21.T11148/eb3c713572f681e6c4c3",
new JsonPrimitive("[{\"AlternateIdentifier\":{\"AlternateIdentifierValue\":\"" + properties.get("sensor_id") + "\",\"alternateIdentifierType\":\"sensor_id\"}}]")
);
if (!rec.get("s.pid").isNull()) {
add_attribute(body,
"1",
"21.T11148/8eb858ee0b12e8e463a5",
new JsonPrimitive("{\"identifier-general-with-type\":{\"identifierValue\":\""+ rec.get("s.pid") +"\", \"identifierType\":\"Handle\"}}")
);
}
add_attribute(body,
"2",
"21.T11148/22c62082a4d2d9ae2602",
......@@ -78,7 +81,7 @@ class Sensor {
add_attribute(body,
"3",
"21.T11148/709a23220f2c3d64d1e1",
new JsonPrimitive('\"' + rec.get("sensor_type").asString() + '\"')
new JsonPrimitive('\"' + rec.get("s.sensor_id").asString() + '\"')
);
add_attribute(body,
"4",
......@@ -107,13 +110,6 @@ class Sensor {
new JsonPrimitive("\""+ rec.get("description") +"\"")
);
}
if (!rec.get("s.pid").isNull()) {
add_attribute(body,
"9",
"21.T11148/8eb858ee0b12e8e463a5",
new JsonPrimitive("{\"identifier-general-with-type\":{\"identifierValue\":\""+ rec.get("s.pid") +"\", \"identifierType\":\"Handle\"}}")
);
}
// add_attribute(body,
// "21.T11148/f76ad9d0324302fc47dd",
// "\"instrument type string\""
......@@ -193,7 +189,7 @@ class Sensor {
"with s, type.sensor_type as sensor_type, type.manufacturer as manufacturer, type.description as description\n" +
"match (s)--(all_measurements:MeasurementLocation)" +
"return s.pid, id(s), sensor_type, manufacturer, description, min(all_measurements.first_msg), max(all_measurements.last_msg)"
"return s.pid, id(s), s.sensor_id, sensor_type, manufacturer, description, 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