Datachunk - JSON
JSON Datachunk documentation is describing Datachunk JSON implementation.
JSON (JavaScript Object Notation) : is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.
The whole Datachunk message consisting of wrapper and payload MUST be valid JSON encoded with the UTF-8 (see RFC3629) character encoding.
Example
JSON representation of a Datachunk.
Float Sample’s value example
{
"v": "2.1",
"f": "2019-01-04T11:25:30.000Z",
"t": "2019-01-04T11:25:40.000Z",
"bbox": [100.0, 0.0, 105.0, 1.0],
"m": ["measurementName"],
"r": [
{
"d": "123",
"u": ["a", "b"],
"tw": {
"f": "2019-01-04T11:25:30.000Z",
"t": "2019-01-04T11:25:40.000Z"
},
"bbox": [100.0, 0.0, 100.0, 0.0],
"s" : [
{
"m": "measurementName",
"t": "float",
"schema": "float",
"tw": {
"f": "2019-01-04T11:25:30.000Z",
"t": "2019-01-04T11:25:40.000Z"
},
"i": {
"f": 5,
"t": 5,
},
"bbox": [100.0, 0.0, 105.0, 1.0],
"s" : [
{
"i": 5,
"t": "2019-01-04T11:25:40.000Z",
"q": "good",
"v": 50.2,
"g": {
"type": "Point",
"coordinates": [100.0, 0.0]
},
"e": {
"key1": "value1",
"key2": "value2"
}
}
],
"e": {
"key1": "value1",
"key2": "value2"
}
}
],
"e": {
"key1": "value1",
"key2": "value2"
}
}
],
"e": {
"key1": "value1",
"key2": "value2"
}
}
Location Sample’s value example
{
"v": "2.1",
"f": "2019-01-04T11:25:30.000Z",
"t": "2019-01-04T11:25:40.000Z",
"m": ["measurementName"],
"r": [
{
"d": "123",
"u": ["a", "b"],
"tw": {
"f": "2019-01-04T11:25:30.000Z",
"t": "2019-01-04T11:25:40.000Z"
},
"s" : [
{
"m": "measurementName",
"t": "location",
"tw": {
"f": "2019-01-04T11:25:30.000Z",
"t": "2019-01-04T11:25:40.000Z"
},
"i": {
"f": 5,
"t": 5,
},
"s" : [
{
"i": 5,
"t": "2019-01-04T11:25:40.000Z",
"q": "good",
"v":
{
"type":"Point",
"coordinates":[ 2.574562, 48.639395, 92.5 ],
"f": true,
"pa": 2,
"m": 0.0,
"e": {
"s": 60.0,
"sa": 3,
"h": 50.0
}
},
"e": {
"key1": "value1",
"key2": "value2"
}
}
],
"e": {
"key1": "value1",
"key2": "value2"
}
}
],
"e": {
"key1": "value1",
"key2": "value2"
}
}
],
"e": {
"key1": "value1",
"key2": "value2"
}
}
Array Sample’s value with location example
{
"v": "2.1",
"f": "2019-01-04T11:25:30.000Z",
"t": "2019-01-04T11:25:40.000Z",
"m": ["measurementName"],
"r": [
{
"d": "123",
"u": ["a", "b"],
"tw": {
"f": "2019-01-04T11:25:30.000Z",
"t": "2019-01-04T11:25:40.000Z"
},
"s" : [
{
"m": "measurementName",
"t": "location",
"tw": {
"f": "2019-01-04T11:25:30.000Z",
"t": "2019-01-04T11:25:40.000Z"
},
"i": {
"f": 5,
"t": 6,
},
"s" : {
"t": "array",
"i": [5, 6],
"t": ["2019-01-04T11:25:30.000Z", "2019-01-04T11:25:40.000Z"],
"q": ["good", "good"],
"v":
[
{
"type":"Point",
"coordinates":[ 2.594854, 48.958427, 92.1 ],
"f": true,
"pa": 2,
"m": 0.0,
"e": {
"s": 60.0,
"sa": 3,
"h": 50.0
}
},
{
"type":"Point",
"coordinates":[ 2.574562, 48.639395, 92.5 ],
"f": true,
"pa": 3,
"m": 0.0,
"e": {
"s": 61.0,
"sa": 3,
"h": 49.0
}
}
],
"e":
[
{
"key1": "value1",
"key2": "value2"
},
{
"key1": "value3",
"key2": "value4"
}
]
},
"e": {
"key1": "value1",
"key2": "value2"
}
}
],
"e": {
"key1": "value1",
"key2": "value2"
}
}
],
"e": {
"key1": "value1",
"key2": "value2"
}
}
Array Sample’s value with locations (as lineString) example
{
"v": "2.1",
"f": "2019-01-04T11:25:30.000Z",
"t": "2019-01-04T11:25:40.000Z",
"m": ["measurementName"],
"r": [
{
"d": "123",
"u": ["a", "b"],
"tw": {
"f": "2019-01-04T11:25:30.000Z",
"t": "2019-01-04T11:25:40.000Z"
},
"s" : [
{
"m": "measurementName",
"t": "location",
"tw": {
"f": "2019-01-04T11:25:30.000Z",
"t": "2019-01-04T11:25:40.000Z"
},
"i": {
"f": 5,
"t": 6,
},
"s" : {
"t": "array",
"i": [5, 6],
"t": ["2019-01-04T11:25:30.000Z", "2019-01-04T11:25:40.000Z"],
"q": ["good", "good"],
"v":
{
"type":"LineString",
"coordinates":[
[ 2.594854, 48.958427, 92.1 ],
[ 2.574562, 48.639395, 92.5 ]
]
"f": [true, true]
"pa": [2, 3]
"m": [0.0, 0.0],
"e": [
{ "s": 60.0, "sa": 3, "h", 50.0 },
{ "s": 61.0, "sa": 3, "h", 50.0 }
]
},
"e":
[
{
"key1": "value1",
"key2": "value2"
},
{
"key1": "value3",
"key2": "value4"
}
]
},
"e": {
"key1": "value1",
"key2": "value2"
}
}
],
"e": {
"key1": "value1",
"key2": "value2"
}
}
],
"e": {
"key1": "value1",
"key2": "value2"
}
}