Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Simplify AVRO example, and link

...

{
   "ts" : "2020-01-10T02:59:43.491751Z # Zulu time, ISO std with microseconds
   "value" : "42 "
}

GeospatialRecord:

{
"pos" : "[format tbd]"
   "ts" : "2020-01-10T02:59:43.491751Z # Zulu time, ISO std with microseconds
   "value" : "42 "
}


SpecifiedRecord:

{
"signal" : "vehicle.Chassis.Axle2.WheelCount"
   "value" : "2"
}

...


    "signal"  :  "vehicle.body.cabin.temperature"
"count" : "132" # Might be redundant information, optional.
    "values" : {
        { 
   "ts" : "2020-01-10T02:59:43.491751"
   "value" : "42.5"
     },
        { 
   "ts" : "2020-01-10T02:59:43.491751"
   "value" : "43.0"
     },
... 130 more records
}
}

AVRO-schema example (not complete, and of course the "#comments" are not allowed to be there)
# First attempt at AVRO schema for TimeSeries
{ Simple SpecifiedTimestampedRecord (note, no array support in this one yet)
{
"type": "record",
"name": "SpecifiedTimeStampedRecord",
"fields" : #[
This is the AVRO{ meaning"name" of record (i.e. kind of struct), not the Record type in our type hierarchy. "name": "TimeSeries", # We are defining the TimeSeries value format "fields: "signal_identifier", "type" : "string" },
{ "name" : "ts", "type" : "long" },
 { "name" : "value", "type" : [ {"name": "signal "int", "long", "float", "typedouble":, "string"}, "boolean" ] #}
Full path VSS with dot-notation, like in example above {"name": "count", "type": "int" }, # as above
{"name": "values", "type": "array",
"items" : {
"type" : "record", # ***
"name" : "TimeStampedRecord",
"fields" : [
{ "name" : "ts", "type" : "string" # ISO formatted timestamp, maybe use int later for efficiency },
# "value" can be any VSS data type, so here we must define a "union" of types. Also arrays are possible in that union.
{ "name" : "value", "type" : [ "int", "long", "float", "double", "string", "boolean",
{ "type" : "array", "items" :
# This gets a bit complex because the array primitive type could also be any type (i.e. another union, except we don't do arrays in arrays)
[ "int", "long", "float", "double", "string", "boolean"
] # End of union definition for the items in an array
} # End of the VSS Array type definition
] # End of union definition for the field "value" in the TimeStampedRecord
] # End of list of fields
} # End of "items"
} # end of "values"
] # end of "fields"
} # end of TimeSeries record
*** Note that we should define the TimeStampedRecord schema separately, and refer to it instead of having it inline like this... ]
}

More AVRO example work here: vss-tools (serializations branch)


Snapshot:


"timeperiod" {
"start" : "2020-01-10T02:00:00Z",
"end" : "2020-01-11T01:59:59Z"
},
"values" : {
{
    "signal" : "vehicle.body.cabin.temperature",
     "value" : "22.0",
     "ts" : "2020-01-10T02:59:43.491751"
},
{
    "signal" : "vehicle.drivetrain.engine.rpm.average",
      "value" : "3200",
     "ts" : "2020-01-10T02:59:44.100403"
}
}

...