Giter VIP home page Giter VIP logo

Comments (4)

hossain-khan avatar hossain-khan commented on June 11, 2024

Here is sample data

{
  "timelineEdits": [{
    "deviceId": "0",
    "placeAggregates": {
      "placeAggregateInfo": [{
        "score": 5.0,
        "numBucketsWithLocation": 0,
        "bucketSpanDays": 0,
        "point": {
          "latE7": 439406551,
          "lngE7": -788458768
        },
        "placeId": "ChIJaWUW8E4b1YkRLPJRTVf0RTw",
        "placePoint": {
          "latE7": 439405376,
          "lngE7": -788457340
        }
      }, {
        "score": 862.0,
        "numBucketsWithLocation": 0,
        "bucketSpanDays": 0,
        "point": {
          "latE7": 439362266,
          "lngE7": -788308334
        },
        "placeId": "ChIJV8SII64E1YkRvAqrnP5G_x8",
        "placePoint": {
          "latE7": 439362443,
          "lngE7": -788308585
        }
      }, {
        "score": 15.0,
        "numBucketsWithLocation": 0,
        "bucketSpanDays": 0,
        "point": {
          "latE7": 439252743,
          "lngE7": -788749588
        },
        "placeId": "ChIJNcJr94Qc1YkRXPX0m3SswPk",
        "placePoint": {
          "latE7": 439250956,
          "lngE7": -788748381
        }
      }],
      "windowSizeHrs": 2016,
      "topRankedPlacesPlaceIds": ["ChIJV8SII64E1YkRvAqrnP5G_x8", "ChIJNcJr94Qc1YkRXPX0m3SswPk", "ChIJaWUW8E4b1YkRLPJRTVf0RTw"],
      "processWindow": {
        "startTime": "2023-09-20T08:01:15Z",
        "endTime": "2023-12-13T08:01:15Z"
      },
      "metadata": {
        "platform": "UNKNOWN"
      }
    }
  }, {
    "deviceId": "0",
    "placeAggregates": {
      "placeAggregateInfo": [{
        "score": 874.0,
        "numBucketsWithLocation": 0,
        "bucketSpanDays": 0,
        "point": {
          "latE7": 439362258,
          "lngE7": -788308344
        },
        "placeId": "ChIJV8SII64E1YkRvAqrnP5G_x8",
        "placePoint": {
          "latE7": 439362443,
          "lngE7": -788308585
        }
      }, {
        "score": 6.0,
        "numBucketsWithLocation": 0,
        "bucketSpanDays": 0,
        "point": {
          "latE7": 439396308,
          "lngE7": -788515883
        },
        "placeId": "ChIJ93yZJEUb1YkRbIEKh6BVbqs",
        "placePoint": {
          "latE7": 439397622,
          "lngE7": -788519525
        }
      }, {
        "score": 11.0,
        "numBucketsWithLocation": 0,
        "bucketSpanDays": 0,
        "point": {
          "latE7": 439253294,
          "lngE7": -788749012
        },
        "placeId": "ChIJNcJr94Qc1YkRXPX0m3SswPk",
        "placePoint": {
          "latE7": 439250956,
          "lngE7": -788748381
        }
      }],
      "windowSizeHrs": 2016,
      "topRankedPlacesPlaceIds": ["ChIJV8SII64E1YkRvAqrnP5G_x8", "ChIJNcJr94Qc1YkRXPX0m3SswPk", "ChIJ93yZJEUb1YkRbIEKh6BVbqs"],
      "processWindow": {
        "startTime": "2023-09-18T08:01:10Z",
        "endTime": "2023-12-11T08:01:10Z"
      },
      "metadata": {
        "platform": "UNKNOWN"
      }
    }
  }, {
    "deviceId": "0",
    "placeAggregates": {
      "placeAggregateInfo": [{
        "score": 870.0,
        "numBucketsWithLocation": 0,
        "bucketSpanDays": 0,
        "point": {
          "latE7": 439362272,
          "lngE7": -788308381
        },
        "placeId": "ChIJV8SII64E1YkRvAqrnP5G_x8",
        "placePoint": {
          "latE7": 439362443,
          "lngE7": -788308585
        }
      }, {
        "score": 21.0,
        "numBucketsWithLocation": 0,
        "bucketSpanDays": 0,
        "point": {
          "latE7": 439254671,
          "lngE7": -788750135
        },
        "placeId": "ChIJNcJr94Qc1YkRXPX0m3SswPk",
        "placePoint": {
          "latE7": 439250956,
          "lngE7": -788748381
        }
      }, {
        "score": 6.0,
        "numBucketsWithLocation": 0,
        "bucketSpanDays": 0,
        "point": {
          "latE7": 439352711,
          "lngE7": -788262603
        },
        "placeId": "ChIJ44zPZ6UE1YkRJREVPALbKh8",
        "placePoint": {
          "latE7": 439349008,
          "lngE7": -788262996
        }
      }],
      "windowSizeHrs": 2016,
      "topRankedPlacesPlaceIds": ["ChIJV8SII64E1YkRvAqrnP5G_x8", "ChIJNcJr94Qc1YkRXPX0m3SswPk", "ChIJ44zPZ6UE1YkRJREVPALbKh8"],
      "processWindow": {
        "startTime": "2023-09-12T08:00:58Z",
        "endTime": "2023-12-05T08:00:58Z"
      },
      "metadata": {
        "platform": "UNKNOWN"
      }
    }
  }]
}

from kgeo-timeline.

hossain-khan avatar hossain-khan commented on June 11, 2024

Here is new json schema

{
  "$schema": "http://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "timelineEdits": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "deviceId": {
            "type": "string"
          },
          "placeAggregates": {
            "type": "object",
            "properties": {
              "placeAggregateInfo": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "score": {
                      "type": "number"
                    },
                    "numBucketsWithLocation": {
                      "type": "integer"
                    },
                    "bucketSpanDays": {
                      "type": "integer"
                    },
                    "point": {
                      "type": "object",
                      "properties": {
                        "latE7": {
                          "type": "integer"
                        },
                        "lngE7": {
                          "type": "integer"
                        }
                      },
                      "required": ["latE7", "lngE7"]
                    },
                    "placeId": {
                      "type": "string"
                    },
                    "placePoint": {
                      "type": "object",
                      "properties": {
                        "latE7": {
                          "type": "integer"
                        },
                        "lngE7": {
                          "type": "integer"
                        }
                      },
                      "required": ["latE7", "lngE7"]
                    }
                  },
                  "required": ["score", "numBucketsWithLocation", "bucketSpanDays", "point", "placeId", "placePoint"]
                }
              },
              "windowSizeHrs": {
                "type": "integer"
              },
              "topRankedPlacesPlaceIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "processWindow": {
                "type": "object",
                "properties": {
                  "startTime": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "endTime": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": ["startTime", "endTime"]
              },
              "metadata": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string"
                  }
                },
                "required": ["platform"]
              }
            },
            "required": ["placeAggregateInfo", "windowSizeHrs", "topRankedPlacesPlaceIds", "processWindow", "metadata"]
          },
          "rawSignal": {
            "type": "object",
            "properties": {
              "signal": {
                "type": "object",
                "properties": {
                  "position": {
                    "type": "object",
                    "properties": {
                      "point": {
                        "type": "object",
                        "properties": {
                          "latE7": {
                            "type": "integer"
                          },
                          "lngE7": {
                            "type": "integer"
                          }
                        },
                        "required": ["latE7", "lngE7"]
                      },
                      "accuracyMm": {
                        "type": "integer"
                      },
                      "altitudeMeters": {
                        "type": "number"
                      },
                      "source": {
                        "type": "string"
                      },
                      "timestamp": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": ["point", "accuracyMm", "altitudeMeters", "source", "timestamp"]
                  },
                  "activityRecord": {
                    "type": "object",
                    "properties": {
                      "detectedActivities": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "activityType": {
                              "type": "string"
                            },
                            "probability": {
                              "type": "number"
                            }
                          },
                          "required": ["activityType", "probability"]
                        }
                      },
                      "timestamp": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": ["detectedActivities", "timestamp"]
                  },
                  "wifiScan": {
                    "type": "object",
                    "properties": {
                      "deliveryTime": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "devices": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "mac": {
                              "type": "string"
                            },
                            "rawRssi": {
                              "type": "integer"
                            }
                          },
                          "required": ["mac", "rawRssi"]
                        }
                      },
                      "source": {
                        "type": "string"
                      }
                    },
                    "required": ["deliveryTime", "devices", "source"]
                  }
                }
              },
              "additionalTimestamp": {
                "type": "string",
                "format": "date-time"
              },
              "metadata": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string"
                  }
                },
                "required": ["platform"]
              }
            }
          }
        },
        "required": ["deviceId"]
      }
    }
  },
  "required": ["timelineEdits"]
}

from kgeo-timeline.

hossain-khan avatar hossain-khan commented on June 11, 2024

Here is full schema with examples

Passed with command:

ajv --spec=draft2020 --validate-formats=false validate -s .\schema.json -d .\timeline-data.json
.\timeline-data.json valid
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "timelineEdits": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "deviceId": {
              "type": "string",
              "description": "The unique identifier for the device that generated the data.",
              "examples": ["0", "-538926953"]
            },
            "placeAggregates": {
              "type": "object",
              "description": "Aggregated information about places visited by the device.",
              "properties": {
                "placeAggregateInfo": {
                  "type": "array",
                  "description": "An array of place information, including score, location, and place ID.",
                  "items": {
                    "type": "object",
                    "properties": {
                      "score": {
                        "type": "number",
                        "description": "The score assigned to the place.",
                        "examples": [1228.0, 166.0]
                      },
                      "numBucketsWithLocation": {
                        "type": "integer",
                        "description": "The number of location buckets associated with the place.",
                        "examples": [0]
                      },
                      "bucketSpanDays": {
                        "type": "integer",
                        "description": "The span of the buckets in days.",
                        "examples": [0]
                      },
                      "point": {
                        "type": "object",
                        "description": "The geographical point of the place.",
                        "properties": {
                          "latE7": {
                            "type": "integer",
                            "description": "The latitude of the place, multiplied by 1e7.",
                            "examples": [439362473, 436994475]
                          },
                          "lngE7": {
                            "type": "integer",
                            "description": "The longitude of the place, multiplied by 1e7.",
                            "examples": [-788308560, -798539281]
                          }
                        },
                        "required": ["latE7", "lngE7"]
                      },
                      "placeId": {
                        "type": "string",
                        "description": "The unique identifier for the place.",
                        "examples": ["ChIJV8SII64E1YkRvAqrnP5G_x8", "ChIJ4_FHs78TK4gRw8h22XkBDEA"]
                      },
                      "placePoint": {
                        "type": "object",
                        "description": "The geographical point of the place.",
                        "properties": {
                          "latE7": {
                            "type": "integer",
                            "description": "The latitude of the place, multiplied by 1e7.",
                            "examples": [439362443, 436994650]
                          },
                          "lngE7": {
                            "type": "integer",
                            "description": "The longitude of the place, multiplied by 1e7.",
                            "examples": [-788308585, -798539291]
                          }
                        },
                        "required": ["latE7", "lngE7"]
                      }
                    },
                    "required": ["score", "numBucketsWithLocation", "bucketSpanDays", "point", "placeId", "placePoint"]
                  }
                },
                "windowSizeHrs": {
                  "type": "integer",
                  "description": "The size of the window in hours for the place aggregates.",
                  "examples": [2016]
                },
                "topRankedPlacesPlaceIds": {
                  "type": "array",
                  "description": "An array of place IDs for the top-ranked places.",
                  "items": {
                    "type": "string",
                    "examples": ["ChIJV8SII64E1YkRvAqrnP5G_x8", "ChIJ4_FHs78TK4gRw8h22XkBDEA", "ChIJJRdROh863YkRmXCWQ14VMcI"]
                  }
                },
                "processWindow": {
                  "type": "object",
                  "description": "The start and end time of the processing window.",
                  "properties": {
                    "startTime": {
                      "type": "string",
                      "format": "date-time",
                      "description": "The start time of the processing window.",
                      "examples": ["2023-12-14T08:00:55Z", "2023-12-10T08:01:01Z"]
                    },
                    "endTime": {
                      "type": "string",
                      "format": "date-time",
                      "description": "The end time of the processing window.",
                      "examples": ["2024-03-07T08:00:55Z", "2024-03-03T08:01:01Z"]
                    }
                  },
                  "required": ["startTime", "endTime"]
                },
                "metadata": {
                  "type": "object",
                  "description": "Metadata about the place aggregates, including the platform.",
                  "properties": {
                    "platform": {
                      "type": "string",
                      "description": "The platform that generated the data.",
                      "examples": ["UNKNOWN"]
                    }
                  },
                  "required": ["platform"]
                }
              },
              "required": ["placeAggregateInfo", "windowSizeHrs", "topRankedPlacesPlaceIds", "processWindow", "metadata"]
            },
            "rawSignal": {
              "type": "object",
              "description": "Raw signal data from the device.",
              "properties": {
                "signal": {
                  "type": "object",
                  "description": "The signal data, including position, activity record, and wifi scan.",
                  "properties": {
                    "position": {
                      "type": "object",
                      "description": "The position data, including point, accuracy, altitude, source, and timestamp.",
                      "properties": {
                        "point": {
                          "type": "object",
                          "description": "The geographical point of the position.",
                          "properties": {
                            "latE7": {
                              "type": "integer",
                              "description": "The latitude of the position, multiplied by 1e7.",
                              "examples": [436994865]
                            },
                            "lngE7": {
                              "type": "integer",
                              "description": "The longitude of the position, multiplied by 1e7.",
                              "examples": [-798539196]
                            }
                          },
                          "required": ["latE7", "lngE7"]
                        },
                        "accuracyMm": {
                          "type": "integer",
                          "description": "The accuracy of the position in millimeters.",
                          "examples": [100000, 13000]
                        },
                        "altitudeMeters": {
                          "type": "number",
                          "description": "The altitude of the position in meters.",
                          "examples": [224.0]
                        },
                        "source": {
                          "type": "string",
                          "description": "The source of the position data.",
                          "examples": ["WIFI"]
                        },
                        "timestamp": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The timestamp of the position data.",
                          "examples": ["2024-02-17T05:54:00.932Z", "2024-02-17T04:26:44.661Z"]
                        }
                      },
                      "required": ["point", "timestamp"]
                    },
                    "activityRecord": {
                      "type": "object",
                      "description": "The activity record data, including detected activities and timestamp.",
                      "properties": {
                        "detectedActivities": {
                          "type": "array",
                          "description": "An array of detected activities, including activity type and probability.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "activityType": {
                                "type": "string",
                                "description": "The type of the detected activity.",
                                "examples": ["STILL", "ON_FOOT", "WALKING", "IN_VEHICLE", "UNKNOWN", "IN_ROAD_VEHICLE", "IN_RAIL_VEHICLE"]
                              },
                              "probability": {
                                "type": "number",
                                "description": "The probability of the detected activity.",
                                "examples": [0.96, 0.02, 0.01]
                              }
                            },
                            "required": ["activityType", "probability"]
                          }
                        },
                        "timestamp": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The timestamp of the activity record.",
                          "examples": ["2024-02-17T05:26:47.066Z"]
                        }
                      },
                      "required": ["detectedActivities", "timestamp"]
                    },
                    "wifiScan": {
                      "type": "object",
                      "description": "The wifi scan data, including delivery time, devices, and source.",
                      "properties": {
                        "deliveryTime": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The delivery time of the wifi scan.",
                          "examples": ["2024-02-17T04:26:44.661Z"]
                        },
                        "devices": {
                          "type": "array",
                          "description": "An array of wifi devices, including mac address and raw RSSI.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mac": {
                                "type": "string",
                                "description": "The mac address of the wifi device.",
                                "examples": ["145830537259886", "212032510881561", "212032510881562"]
                              },
                              "rawRssi": {
                                "type": "integer",
                                "description": "The raw RSSI of the wifi device.",
                                "examples": [-51, -53, -58]
                              }
                            },
                            "required": ["mac", "rawRssi"]
                          }
                        },
                        "source": {
                          "type": "string",
                          "description": "The source of the wifi scan data.",
                          "examples": ["ACTIVE_SCAN"]
                        }
                      },
                      "required": ["deliveryTime", "devices"]
                    }
                  }
                },
                "additionalTimestamp": {
                  "type": "string",
                  "format": "date-time",
                  "description": "An additional timestamp associated with the raw signal.",
                  "examples": ["2024-02-17T05:54:01.359Z"]
                },
                "metadata": {
                  "type": "object",
                  "description": "Metadata about the raw signal, including the platform.",
                  "properties": {
                    "platform": {
                      "type": "string",
                      "description": "The platform that generated the data.",
                      "examples": ["ANDROID"]
                    }
                  },
                  "required": ["platform"]
                }
              }
            }
          },
          "required": ["deviceId"]
        }
      }
    },
    "required": ["timelineEdits"],
    "description": "The root object of the timeline edits data."
  }

from kgeo-timeline.

hossain-khan avatar hossain-khan commented on June 11, 2024

Refactored schema

{
  "$id": "https://locationhistoryformat.com/schemas/TimelineEdits.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Timeline Edits Schema",
  "description": "This schema outlines the structure of timeline edits data, encompassing device information, place visit aggregates, and raw signal data from the device.",
  "type": "object",
  "properties": {
    "timelineEdits": {
      "type": "array",
      "title": "Timeline Edits",
      "description": "List of all timeline edits.",
      "items": {
        "$ref": "#/$defs/timelineEditsItem"
      },
      "examples": []
    }
  },
  "required": [
    "timelineEdits"
  ],
  "$defs": {
    "timelineEditsItem": {
      "type": "object",
      "examples": [
        {
          "deviceId": "0",
          "placeAggregates": {
            "placeAggregateInfo": [
              {
                "score": 1228.0,
                "numBucketsWithLocation": 0,
                "bucketSpanDays": 0,
                "point": {
                  "latE7": 429362473,
                  "lngE7": -788308560
                },
                "placeId": "ChIJV8SII64E1YkRvAqrnP5G_x8",
                "placePoint": {
                  "latE7": 429362442,
                  "lngE7": -788308585
                }
              },
              {
                "score": 166.0,
                "numBucketsWithLocation": 0,
                "bucketSpanDays": 0,
                "point": {
                  "latE7": 426994475,
                  "lngE7": -778539281
                },
                "placeId": "ChIJ4_FHs78TK4gRw8h22XkBDEA",
                "placePoint": {
                  "latE7": 426994650,
                  "lngE7": -778539291
                }
              },
              {
                "score": 131.0,
                "numBucketsWithLocation": 0,
                "bucketSpanDays": 0,
                "point": {
                  "latE7": 415908301,
                  "lngE7": -739409850
                },
                "placeId": "ChIJJRdROh863YkRmXCWQ14VMcI",
                "placePoint": {
                  "latE7": 415908776,
                  "lngE7": -739409849
                }
              }
            ],
            "windowSizeHrs": 2011,
            "topRankedPlacesPlaceIds": [
              "ChIJV8SII64E1YkRvAqrnP5G_x8",
              "ChIJ4_FHs78TK4gRw8h22XkBDEA",
              "ChIJJRdROh863YkRmXCWQ14VMcI"
            ],
            "processWindow": {
              "startTime": "2023-12-14T08:00:55Z",
              "endTime": "2024-03-07T08:00:55Z"
            },
            "metadata": {
              "platform": "UNKNOWN"
            }
          }
        }
      ],
      "properties": {
        "deviceId": {
          "type": "string",
          "description": "The unique identifier for the device that generated the data.",
          "examples": [
            "0",
            "-538926953"
          ]
        },
        "placeAggregates": {
          "type": "object",
          "description": "Aggregated information about places visited by the device.",
          "properties": {
            "placeAggregateInfo": {
              "type": "array",
              "description": "An array of place information, including score, location, and place ID.",
              "items": {
                "type": "object",
                "properties": {
                  "score": {
                    "type": "number",
                    "description": "The score assigned to the place.",
                    "examples": [
                      1228.0,
                      166.0
                    ]
                  },
                  "numBucketsWithLocation": {
                    "type": "integer",
                    "description": "The number of location buckets associated with the place.",
                    "examples": [
                      0
                    ]
                  },
                  "bucketSpanDays": {
                    "type": "integer",
                    "description": "The span of the buckets in days.",
                    "examples": [
                      0
                    ]
                  },
                  "point": {
                    "$ref": "#/$defs/point"
                  },
                  "placeId": {
                    "type": "string",
                    "description": "The unique identifier for the place.",
                    "examples": [
                      "ChIJV8SII64E1YkRvAqrnP5G_x8",
                      "ChIJ4_FHs78TK4gRw8h22XkBDEA"
                    ]
                  },
                  "placePoint": {
                    "$ref": "#/$defs/point"
                  }
                },
                "required": [
                  "score",
                  "numBucketsWithLocation",
                  "bucketSpanDays",
                  "point",
                  "placeId",
                  "placePoint"
                ]
              }
            },
            "windowSizeHrs": {
              "type": "integer",
              "description": "The size of the window in hours for the place aggregates.",
              "examples": [
                2016
              ]
            },
            "topRankedPlacesPlaceIds": {
              "type": "array",
              "description": "An array of place IDs for the top-ranked places.",
              "items": {
                "type": "string",
                "examples": [
                  "ChIJV8SII64E1YkRvAqrnP5G_x8",
                  "ChIJ4_FHs78TK4gRw8h22XkBDEA",
                  "ChIJJRdROh863YkRmXCWQ14VMcI"
                ]
              }
            },
            "processWindow": {
              "type": "object",
              "description": "The start and end time of the processing window.",
              "properties": {
                "startTime": {
                  "type": "string",
                  "format": "date-time",
                  "description": "The start time of the processing window.",
                  "examples": [
                    "2023-12-14T08:00:55Z",
                    "2023-12-10T08:01:01Z"
                  ]
                },
                "endTime": {
                  "type": "string",
                  "format": "date-time",
                  "description": "The end time of the processing window.",
                  "examples": [
                    "2024-03-07T08:00:55Z",
                    "2024-03-03T08:01:01Z"
                  ]
                }
              },
              "required": [
                "startTime",
                "endTime"
              ]
            },
            "metadata": {
              "$ref": "#/$defs/metadata"
            }
          },
          "required": [
            "placeAggregateInfo",
            "windowSizeHrs",
            "topRankedPlacesPlaceIds",
            "processWindow",
            "metadata"
          ]
        },
        "rawSignal": {
          "type": "object",
          "description": "Raw signal data from the device.",
          "examples": [
            {
              "signal": {
                "position": {
                  "point": {
                    "latE7": 426974802,
                    "lngE7": -778539156
                  },
                  "accuracyMm": 100000,
                  "altitudeMeters": 224.0,
                  "source": "WIFI",
                  "timestamp": "2024-02-17T04:14:41.412Z"
                }
              },
              "additionalTimestamp": "2024-02-17T04:14:39.545Z",
              "metadata": {
                "platform": "ANDROID"
              }
            }
          ],
          "properties": {
            "signal": {
              "$ref": "#/$defs/signal"
            },
            "additionalTimestamp": {
              "type": "string",
              "format": "date-time",
              "description": "An additional timestamp associated with the raw signal.",
              "examples": [
                "2024-02-17T05:54:01.359Z"
              ]
            },
            "metadata": {
              "$ref": "#/$defs/metadata"
            }
          }
        }
      },
      "required": [
        "deviceId"
      ]
    },
    "signal": {
      "type": "object",
      "description": "The signal data, including position, activity record, and wifi scan.",
      "properties": {
        "position": {
          "type": "object",
          "description": "The position data, including point, accuracy, altitude, source, and timestamp.",
          "properties": {
            "point": {
              "$ref": "#/$defs/point"
            },
            "accuracyMm": {
              "type": "integer",
              "description": "The accuracy of the position in millimeters.",
              "examples": [
                100000,
                13000
              ]
            },
            "altitudeMeters": {
              "type": "number",
              "description": "The altitude of the position in meters.",
              "examples": [
                224.0
              ]
            },
            "source": {
              "type": "string",
              "description": "The source of the position data.",
              "examples": [
                "WIFI"
              ]
            },
            "speedMetersPerSecond": {
              "type": "number",
              "description": "Speed in meters per second.",
              "examples": [0.0]
            },
            "timestamp": {
              "type": "string",
              "format": "date-time",
              "description": "The timestamp of the position data.",
              "examples": [
                "2024-02-17T05:54:00.932Z",
                "2024-02-17T04:26:44.661Z"
              ]
            }
          },
          "required": [
            "point",
            "timestamp"
          ]
        },
        "activityRecord": {
          "type": "object",
          "description": "The activity record data, including detected activities and timestamp.",
          "properties": {
            "detectedActivities": {
              "type": "array",
              "description": "An array of detected activities, including activity type and probability.",
              "items": {
                "type": "object",
                "properties": {
                  "activityType": {
                    "type": "string",
                    "description": "The type of the detected activity. This could re-use the `#/$defs/activityType` from Records schema later.",
                    "examples": [
                      "STILL",
                      "ON_FOOT",
                      "WALKING",
                      "IN_VEHICLE",
                      "UNKNOWN",
                      "IN_ROAD_VEHICLE",
                      "IN_RAIL_VEHICLE"
                    ]
                  },
                  "probability": {
                    "type": "number",
                    "description": "The probability of the detected activity.",
                    "examples": [
                      0.96,
                      0.02,
                      0.01
                    ]
                  }
                },
                "required": [
                  "activityType",
                  "probability"
                ]
              }
            },
            "timestamp": {
              "type": "string",
              "format": "date-time",
              "description": "The timestamp of the activity record.",
              "examples": [
                "2024-02-17T05:26:47.066Z"
              ]
            }
          },
          "required": [
            "detectedActivities",
            "timestamp"
          ]
        },
        "wifiScan": {
          "type": "object",
          "description": "The wifi scan data, including delivery time, devices, and source.",
          "properties": {
            "deliveryTime": {
              "type": "string",
              "format": "date-time",
              "description": "The delivery time of the wifi scan.",
              "examples": [
                "2024-02-17T04:26:44.661Z"
              ]
            },
            "devices": {
              "type": "array",
              "description": "An array of wifi devices, including mac address and raw RSSI.",
              "items": {
                "type": "object",
                "properties": {
                  "mac": {
                    "type": "string",
                    "description": "The mac address of the wifi device.",
                    "examples": [
                      "145830537259886",
                      "212032510881561",
                      "212032510881562"
                    ]
                  },
                  "rawRssi": {
                    "type": "integer",
                    "description": "The raw RSSI of the wifi device.",
                    "examples": [
                      -51,
                      -53,
                      -58
                    ]
                  }
                },
                "required": [
                  "mac",
                  "rawRssi"
                ]
              }
            },
            "source": {
              "type": "string",
              "description": "The source of the wifi scan data.",
              "examples": [
                "ACTIVE_SCAN"
              ]
            }
          },
          "required": [
            "deliveryTime",
            "devices"
          ]
        }
      }
    },
    "metadata": {
      "type": "object",
      "description": "Metadata about the data object.",
      "properties": {
        "platform": {
          "type": "string",
          "description": "The platform that generated the data.",
          "examples": [
            "ANDROID",
            "UNKNOWN"
          ]
        }
      },
      "required": [
        "platform"
      ]
    },
    "point": {
      "type": "object",
      "title": "Point",
      "description": "The geographical point.",
      "examples": [
        {
          "latE7": 416032766,
          "lngE7": 21841819,
          "accuracyMeters": 10,
          "timestamp": "2022-03-03T08:27:48Z"
        }
      ],
      "properties": {
        "latE7": {
          "type": "integer",
          "title": "Latitude",
          "description": "Latitude coordinate of the point. Degrees multiplied by 10^7 and rounded to the nearest integer, in the range -900000000 to +900000000 (divide value by 10^7 for the usual range -90° to +90°).",
          "examples": [
            439362473,
            436994475
          ],
          "minimum": -900000000,
          "maximum": 900000000
        },
        "lngE7": {
          "type": "integer",
          "title": "Longitude",
          "description": "Longitude coordinate of the point. Degrees multiplied by 10^7 and rounded to the nearest integer, in the range -1800000000 to +1800000000 (divide value by 10^7 for the usual range -180° to +180°).",
          "examples": [
            -788308560,
            -798539281
          ],
          "minimum": -1800000000,
          "maximum": 1800000000
        }
      },
      "required": [
        "latE7",
        "lngE7"
      ]
    }
  }
}

PR created with updated schema - CarlosBergillos/LocationHistoryFormat#5

from kgeo-timeline.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.