From 866f97ff44c93a52f63d6a4ed7f28bdabbf02852 Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Mon, 18 Mar 2024 13:42:33 -0400 Subject: [PATCH 01/11] [ADDED] Timeline edits schema (initial version) --- schemas/Timeline.schema.json | 414 +++++++++++++++++++++++++++++++++++ 1 file changed, 414 insertions(+) create mode 100644 schemas/Timeline.schema.json diff --git a/schemas/Timeline.schema.json b/schemas/Timeline.schema.json new file mode 100644 index 0000000..e28504b --- /dev/null +++ b/schemas/Timeline.schema.json @@ -0,0 +1,414 @@ +{ + "$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." +} \ No newline at end of file From b7b0e168b3672bfc570a007fa9a64fe7783ca658 Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Mon, 18 Mar 2024 13:43:47 -0400 Subject: [PATCH 02/11] [REFACTOR] Move some objects to `$defs` --- schemas/Timeline.schema.json | 732 +++++++++++++++++------------------ 1 file changed, 365 insertions(+), 367 deletions(-) diff --git a/schemas/Timeline.schema.json b/schemas/Timeline.schema.json index e28504b..b166758 100644 --- a/schemas/Timeline.schema.json +++ b/schemas/Timeline.schema.json @@ -1,414 +1,412 @@ { + "$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": { - "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": { + "$ref": "#/$defs/timelineEditsItem" + } + } + }, + "required": [ + "timelineEdits" + ], + "$defs": { + "timelineEditsItem": { + "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", - "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.", + "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": [ - "2023-12-14T08:00:55Z", - "2023-12-10T08:01:01Z" + 0 ] }, - "endTime": { + "bucketSpanDays": { + "type": "integer", + "description": "The span of the buckets in days.", + "examples": [ + 0 + ] + }, + "point": { + "$ref": "#/$defs/point" + }, + "placeId": { "type": "string", - "format": "date-time", - "description": "The end time of the processing window.", + "description": "The unique identifier for the place.", "examples": [ - "2024-03-07T08:00:55Z", - "2024-03-03T08:01:01Z" + "ChIJV8SII64E1YkRvAqrnP5G_x8", + "ChIJ4_FHs78TK4gRw8h22XkBDEA" ] + }, + "placePoint": { + "$ref": "#/$defs/point" } }, "required": [ - "startTime", - "endTime" + "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" + ] + } }, - "metadata": { + "required": [ + "startTime", + "endTime" + ] + }, + "metadata": { + "$ref": "#/$defs/metadata" + } + }, + "required": [ + "placeAggregateInfo", + "windowSizeHrs", + "topRankedPlacesPlaceIds", + "processWindow", + "metadata" + ] + }, + "rawSignal": { + "type": "object", + "description": "Raw signal data from the device.", + "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": { + "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", - "description": "Metadata about the place aggregates, including the platform.", "properties": { - "platform": { + "activityType": { "type": "string", - "description": "The platform that generated the data.", + "description": "The type of the detected activity.", "examples": [ - "UNKNOWN" + "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": [ - "platform" + "activityType", + "probability" ] } }, - "required": [ - "placeAggregateInfo", - "windowSizeHrs", - "topRankedPlacesPlaceIds", - "processWindow", - "metadata" - ] + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the activity record.", + "examples": [ + "2024-02-17T05:26:47.066Z" + ] + } }, - "rawSignal": { - "type": "object", - "description": "Raw signal data from the device.", - "properties": { - "signal": { + "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", - "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" + "mac": { + "type": "string", + "description": "The mac address of the wifi device.", + "examples": [ + "145830537259886", + "212032510881561", + "212032510881562" ] }, - "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.", + "rawRssi": { + "type": "integer", + "description": "The raw RSSI of the wifi device.", "examples": [ - "ANDROID" + -51, + -53, + -58 ] } }, "required": [ - "platform" + "mac", + "rawRssi" ] } + }, + "source": { + "type": "string", + "description": "The source of the wifi scan data.", + "examples": [ + "ACTIVE_SCAN" + ] } - } - }, - "required": [ - "deviceId" - ] + }, + "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" + ] } - }, - "required": [ - "timelineEdits" - ], - "description": "The root object of the timeline edits data." + } } \ No newline at end of file From 47f5773212dc7d38622a20a3be0a470f6bfd8993 Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Mon, 18 Mar 2024 13:58:35 -0400 Subject: [PATCH 03/11] [UPDATE] Rename file --- schemas/{Timeline.schema.json => TimelineEdits.schema.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename schemas/{Timeline.schema.json => TimelineEdits.schema.json} (100%) diff --git a/schemas/Timeline.schema.json b/schemas/TimelineEdits.schema.json similarity index 100% rename from schemas/Timeline.schema.json rename to schemas/TimelineEdits.schema.json From b4792f9b2bebbd88ea29e1005146ec0a895f32e9 Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Mon, 18 Mar 2024 13:58:44 -0400 Subject: [PATCH 04/11] [ADDED] JSON examples --- schemas/TimelineEdits.schema.json | 87 ++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) diff --git a/schemas/TimelineEdits.schema.json b/schemas/TimelineEdits.schema.json index b166758..cc7a9bd 100644 --- a/schemas/TimelineEdits.schema.json +++ b/schemas/TimelineEdits.schema.json @@ -11,7 +11,8 @@ "description": "List of all timeline edits.", "items": { "$ref": "#/$defs/timelineEditsItem" - } + }, + "examples": [] } }, "required": [ @@ -20,6 +21,70 @@ "$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", @@ -148,6 +213,26 @@ "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" From f23000f06c81bfb609e432877cebec8dd9a79e3b Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Mon, 18 Mar 2024 14:55:05 -0400 Subject: [PATCH 05/11] [REFACTOR] Reused Point object and added missing prop --- schemas/TimelineEdits.schema.json | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/schemas/TimelineEdits.schema.json b/schemas/TimelineEdits.schema.json index cc7a9bd..f9cbe35 100644 --- a/schemas/TimelineEdits.schema.json +++ b/schemas/TimelineEdits.schema.json @@ -264,28 +264,7 @@ "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" - ] + "$ref": "#/$defs/point" }, "accuracyMm": { "type": "integer", @@ -309,6 +288,11 @@ "WIFI" ] }, + "speedMetersPerSecond": { + "type": "number", + "description": "Speed in meters per second.", + "examples": [0.0] + }, "timestamp": { "type": "string", "format": "date-time", From e1054f7ba0419f04a7bd712123cbffa5ab651871 Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Mon, 18 Mar 2024 15:01:59 -0400 Subject: [PATCH 06/11] [MINOR] Added note about activity type for future --- schemas/TimelineEdits.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/TimelineEdits.schema.json b/schemas/TimelineEdits.schema.json index f9cbe35..dbea349 100644 --- a/schemas/TimelineEdits.schema.json +++ b/schemas/TimelineEdits.schema.json @@ -320,7 +320,7 @@ "properties": { "activityType": { "type": "string", - "description": "The type of the detected activity.", + "description": "The type of the detected activity. This could re-use the `#/$defs/activityType` from Records schema later.", "examples": [ "STILL", "ON_FOOT", From de754560c750dcab76fb616ef206dfcfece0355b Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Wed, 20 Mar 2024 11:48:33 -0400 Subject: [PATCH 07/11] [UPDATE] Added missing title property Addresses https://github.com/CarlosBergillos/LocationHistoryFormat/pull/5#issuecomment-2008327829 --- schemas/TimelineEdits.schema.json | 42 ++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/schemas/TimelineEdits.schema.json b/schemas/TimelineEdits.schema.json index dbea349..be67928 100644 --- a/schemas/TimelineEdits.schema.json +++ b/schemas/TimelineEdits.schema.json @@ -20,6 +20,8 @@ ], "$defs": { "timelineEditsItem": { + "title": "Timeline Edit Information", + "description": "Various information about the timeline edit, including device ID, place aggregates, and raw signal data.", "type": "object", "examples": [ { @@ -88,6 +90,7 @@ "properties": { "deviceId": { "type": "string", + "title": "Device ID", "description": "The unique identifier for the device that generated the data.", "examples": [ "0", @@ -96,16 +99,20 @@ }, "placeAggregates": { "type": "object", + "title": "Place Aggregates", "description": "Aggregated information about places visited by the device.", "properties": { "placeAggregateInfo": { "type": "array", + "title": "Place Aggregate Information", "description": "An array of place information, including score, location, and place ID.", "items": { + "title": "Place Aggregate Info Item", "type": "object", "properties": { "score": { "type": "number", + "title": "Score", "description": "The score assigned to the place.", "examples": [ 1228.0, @@ -114,6 +121,7 @@ }, "numBucketsWithLocation": { "type": "integer", + "title": "Number of Buckets", "description": "The number of location buckets associated with the place.", "examples": [ 0 @@ -121,6 +129,7 @@ }, "bucketSpanDays": { "type": "integer", + "title": "Bucket Span", "description": "The span of the buckets in days.", "examples": [ 0 @@ -131,6 +140,7 @@ }, "placeId": { "type": "string", + "title": "Place ID", "description": "The unique identifier for the place.", "examples": [ "ChIJV8SII64E1YkRvAqrnP5G_x8", @@ -153,6 +163,7 @@ }, "windowSizeHrs": { "type": "integer", + "title": "Time Window Size", "description": "The size of the window in hours for the place aggregates.", "examples": [ 2016 @@ -160,6 +171,7 @@ }, "topRankedPlacesPlaceIds": { "type": "array", + "title": "Top Ranked Places", "description": "An array of place IDs for the top-ranked places.", "items": { "type": "string", @@ -172,11 +184,13 @@ }, "processWindow": { "type": "object", + "title": "Process Window", "description": "The start and end time of the processing window.", "properties": { "startTime": { "type": "string", "format": "date-time", + "title": "Start Time", "description": "The start time of the processing window.", "examples": [ "2023-12-14T08:00:55Z", @@ -186,6 +200,7 @@ "endTime": { "type": "string", "format": "date-time", + "title": "End Time", "description": "The end time of the processing window.", "examples": [ "2024-03-07T08:00:55Z", @@ -212,6 +227,7 @@ }, "rawSignal": { "type": "object", + "title": "Raw Signal", "description": "Raw signal data from the device.", "examples": [ { @@ -240,6 +256,7 @@ "additionalTimestamp": { "type": "string", "format": "date-time", + "title": "Additional Timestamp", "description": "An additional timestamp associated with the raw signal.", "examples": [ "2024-02-17T05:54:01.359Z" @@ -257,10 +274,12 @@ }, "signal": { "type": "object", + "title": "Signal", "description": "The signal data, including position, activity record, and wifi scan.", "properties": { "position": { "type": "object", + "title": "Position", "description": "The position data, including point, accuracy, altitude, source, and timestamp.", "properties": { "point": { @@ -268,6 +287,7 @@ }, "accuracyMm": { "type": "integer", + "title": "Signal Position Accuracy", "description": "The accuracy of the position in millimeters.", "examples": [ 100000, @@ -276,6 +296,7 @@ }, "altitudeMeters": { "type": "number", + "title": "Altitude", "description": "The altitude of the position in meters.", "examples": [ 224.0 @@ -283,6 +304,7 @@ }, "source": { "type": "string", + "title": "Signal Position Source", "description": "The source of the position data.", "examples": [ "WIFI" @@ -290,12 +312,16 @@ }, "speedMetersPerSecond": { "type": "number", + "title": "Speed", "description": "Speed in meters per second.", - "examples": [0.0] + "examples": [ + 0.0 + ] }, "timestamp": { "type": "string", "format": "date-time", + "title": "Timestamp", "description": "The timestamp of the position data.", "examples": [ "2024-02-17T05:54:00.932Z", @@ -310,16 +336,20 @@ }, "activityRecord": { "type": "object", + "title": "Activity Record", "description": "The activity record data, including detected activities and timestamp.", "properties": { "detectedActivities": { "type": "array", + "title": "Detected Activities", "description": "An array of detected activities, including activity type and probability.", "items": { "type": "object", + "title": "Detected Activity Item", "properties": { "activityType": { "type": "string", + "title": "Activity Type", "description": "The type of the detected activity. This could re-use the `#/$defs/activityType` from Records schema later.", "examples": [ "STILL", @@ -333,6 +363,7 @@ }, "probability": { "type": "number", + "title": "Probability", "description": "The probability of the detected activity.", "examples": [ 0.96, @@ -350,6 +381,7 @@ "timestamp": { "type": "string", "format": "date-time", + "title": "Timestamp", "description": "The timestamp of the activity record.", "examples": [ "2024-02-17T05:26:47.066Z" @@ -363,11 +395,13 @@ }, "wifiScan": { "type": "object", + "title": "Wifi Scan Data", "description": "The wifi scan data, including delivery time, devices, and source.", "properties": { "deliveryTime": { "type": "string", "format": "date-time", + "title": "Delivery Time", "description": "The delivery time of the wifi scan.", "examples": [ "2024-02-17T04:26:44.661Z" @@ -375,12 +409,15 @@ }, "devices": { "type": "array", + "title": "Wifi Devices", "description": "An array of wifi devices, including mac address and raw RSSI.", "items": { "type": "object", + "title": "Wifi Device", "properties": { "mac": { "type": "string", + "title": "MAC Address", "description": "The mac address of the wifi device.", "examples": [ "145830537259886", @@ -390,6 +427,7 @@ }, "rawRssi": { "type": "integer", + "title": "Raw RSSI", "description": "The raw RSSI of the wifi device.", "examples": [ -51, @@ -406,6 +444,7 @@ }, "source": { "type": "string", + "title": "Wifi Scan Source", "description": "The source of the wifi scan data.", "examples": [ "ACTIVE_SCAN" @@ -421,6 +460,7 @@ }, "metadata": { "type": "object", + "title": "Metadata", "description": "Metadata about the data object.", "properties": { "platform": { From 13d51ffa12e429f51db8904376ab5902136e8e02 Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Wed, 20 Mar 2024 11:49:50 -0400 Subject: [PATCH 08/11] [MINOR] Applied 4 space indentation Address https://github.com/CarlosBergillos/LocationHistoryFormat/pull/5#issuecomment-2008309106 --- schemas/TimelineEdits.schema.json | 988 +++++++++++++++--------------- 1 file changed, 494 insertions(+), 494 deletions(-) diff --git a/schemas/TimelineEdits.schema.json b/schemas/TimelineEdits.schema.json index be67928..0219c9d 100644 --- a/schemas/TimelineEdits.schema.json +++ b/schemas/TimelineEdits.schema.json @@ -1,521 +1,521 @@ { - "$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": { - "title": "Timeline Edit Information", - "description": "Various information about the timeline edit, including device ID, place aggregates, and raw signal data.", - "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" + "$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" }, - "metadata": { - "platform": "UNKNOWN" - } - } + "examples": [] } - ], - "properties": { - "deviceId": { - "type": "string", - "title": "Device ID", - "description": "The unique identifier for the device that generated the data.", - "examples": [ - "0", - "-538926953" - ] - }, - "placeAggregates": { - "type": "object", - "title": "Place Aggregates", - "description": "Aggregated information about places visited by the device.", - "properties": { - "placeAggregateInfo": { - "type": "array", - "title": "Place Aggregate Information", - "description": "An array of place information, including score, location, and place ID.", - "items": { - "title": "Place Aggregate Info Item", - "type": "object", - "properties": { - "score": { - "type": "number", - "title": "Score", - "description": "The score assigned to the place.", - "examples": [ - 1228.0, - 166.0 - ] - }, - "numBucketsWithLocation": { - "type": "integer", - "title": "Number of Buckets", - "description": "The number of location buckets associated with the place.", - "examples": [ - 0 - ] - }, - "bucketSpanDays": { - "type": "integer", - "title": "Bucket Span", - "description": "The span of the buckets in days.", - "examples": [ - 0 - ] - }, - "point": { - "$ref": "#/$defs/point" - }, - "placeId": { + }, + "required": [ + "timelineEdits" + ], + "$defs": { + "timelineEditsItem": { + "title": "Timeline Edit Information", + "description": "Various information about the timeline edit, including device ID, place aggregates, and raw signal data.", + "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", - "title": "Place ID", - "description": "The unique identifier for the place.", + "title": "Device ID", + "description": "The unique identifier for the device that generated the data.", "examples": [ - "ChIJV8SII64E1YkRvAqrnP5G_x8", - "ChIJ4_FHs78TK4gRw8h22XkBDEA" + "0", + "-538926953" ] - }, - "placePoint": { - "$ref": "#/$defs/point" - } }, - "required": [ - "score", - "numBucketsWithLocation", - "bucketSpanDays", - "point", - "placeId", - "placePoint" - ] - } - }, - "windowSizeHrs": { - "type": "integer", - "title": "Time Window Size", - "description": "The size of the window in hours for the place aggregates.", - "examples": [ - 2016 - ] - }, - "topRankedPlacesPlaceIds": { - "type": "array", - "title": "Top Ranked Places", - "description": "An array of place IDs for the top-ranked places.", - "items": { - "type": "string", - "examples": [ - "ChIJV8SII64E1YkRvAqrnP5G_x8", - "ChIJ4_FHs78TK4gRw8h22XkBDEA", - "ChIJJRdROh863YkRmXCWQ14VMcI" - ] - } - }, - "processWindow": { - "type": "object", - "title": "Process Window", - "description": "The start and end time of the processing window.", - "properties": { - "startTime": { - "type": "string", - "format": "date-time", - "title": "Start Time", - "description": "The start time of the processing window.", - "examples": [ - "2023-12-14T08:00:55Z", - "2023-12-10T08:01:01Z" - ] + "placeAggregates": { + "type": "object", + "title": "Place Aggregates", + "description": "Aggregated information about places visited by the device.", + "properties": { + "placeAggregateInfo": { + "type": "array", + "title": "Place Aggregate Information", + "description": "An array of place information, including score, location, and place ID.", + "items": { + "title": "Place Aggregate Info Item", + "type": "object", + "properties": { + "score": { + "type": "number", + "title": "Score", + "description": "The score assigned to the place.", + "examples": [ + 1228.0, + 166.0 + ] + }, + "numBucketsWithLocation": { + "type": "integer", + "title": "Number of Buckets", + "description": "The number of location buckets associated with the place.", + "examples": [ + 0 + ] + }, + "bucketSpanDays": { + "type": "integer", + "title": "Bucket Span", + "description": "The span of the buckets in days.", + "examples": [ + 0 + ] + }, + "point": { + "$ref": "#/$defs/point" + }, + "placeId": { + "type": "string", + "title": "Place ID", + "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", + "title": "Time Window Size", + "description": "The size of the window in hours for the place aggregates.", + "examples": [ + 2016 + ] + }, + "topRankedPlacesPlaceIds": { + "type": "array", + "title": "Top Ranked Places", + "description": "An array of place IDs for the top-ranked places.", + "items": { + "type": "string", + "examples": [ + "ChIJV8SII64E1YkRvAqrnP5G_x8", + "ChIJ4_FHs78TK4gRw8h22XkBDEA", + "ChIJJRdROh863YkRmXCWQ14VMcI" + ] + } + }, + "processWindow": { + "type": "object", + "title": "Process Window", + "description": "The start and end time of the processing window.", + "properties": { + "startTime": { + "type": "string", + "format": "date-time", + "title": "Start 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", + "title": "End 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" + ] }, - "endTime": { - "type": "string", - "format": "date-time", - "title": "End Time", - "description": "The end time of the processing window.", - "examples": [ - "2024-03-07T08:00:55Z", - "2024-03-03T08:01:01Z" - ] + "rawSignal": { + "type": "object", + "title": "Raw Signal", + "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", + "title": "Additional Timestamp", + "description": "An additional timestamp associated with the raw signal.", + "examples": [ + "2024-02-17T05:54:01.359Z" + ] + }, + "metadata": { + "$ref": "#/$defs/metadata" + } + } } - }, - "required": [ - "startTime", - "endTime" - ] }, - "metadata": { - "$ref": "#/$defs/metadata" - } - }, - "required": [ - "placeAggregateInfo", - "windowSizeHrs", - "topRankedPlacesPlaceIds", - "processWindow", - "metadata" - ] + "required": [ + "deviceId" + ] }, - "rawSignal": { - "type": "object", - "title": "Raw Signal", - "description": "Raw signal data from the device.", - "examples": [ - { - "signal": { + "signal": { + "type": "object", + "title": "Signal", + "description": "The signal data, including position, activity record, and wifi scan.", + "properties": { "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", - "title": "Additional Timestamp", - "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", - "title": "Signal", - "description": "The signal data, including position, activity record, and wifi scan.", - "properties": { - "position": { - "type": "object", - "title": "Position", - "description": "The position data, including point, accuracy, altitude, source, and timestamp.", - "properties": { - "point": { - "$ref": "#/$defs/point" - }, - "accuracyMm": { - "type": "integer", - "title": "Signal Position Accuracy", - "description": "The accuracy of the position in millimeters.", - "examples": [ - 100000, - 13000 - ] - }, - "altitudeMeters": { - "type": "number", - "title": "Altitude", - "description": "The altitude of the position in meters.", - "examples": [ - 224.0 - ] - }, - "source": { - "type": "string", - "title": "Signal Position Source", - "description": "The source of the position data.", - "examples": [ - "WIFI" - ] - }, - "speedMetersPerSecond": { - "type": "number", - "title": "Speed", - "description": "Speed in meters per second.", - "examples": [ - 0.0 - ] - }, - "timestamp": { - "type": "string", - "format": "date-time", - "title": "Timestamp", - "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", - "title": "Activity Record", - "description": "The activity record data, including detected activities and timestamp.", - "properties": { - "detectedActivities": { - "type": "array", - "title": "Detected Activities", - "description": "An array of detected activities, including activity type and probability.", - "items": { - "type": "object", - "title": "Detected Activity Item", - "properties": { - "activityType": { - "type": "string", - "title": "Activity Type", - "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" + "type": "object", + "title": "Position", + "description": "The position data, including point, accuracy, altitude, source, and timestamp.", + "properties": { + "point": { + "$ref": "#/$defs/point" + }, + "accuracyMm": { + "type": "integer", + "title": "Signal Position Accuracy", + "description": "The accuracy of the position in millimeters.", + "examples": [ + 100000, + 13000 + ] + }, + "altitudeMeters": { + "type": "number", + "title": "Altitude", + "description": "The altitude of the position in meters.", + "examples": [ + 224.0 + ] + }, + "source": { + "type": "string", + "title": "Signal Position Source", + "description": "The source of the position data.", + "examples": [ + "WIFI" + ] + }, + "speedMetersPerSecond": { + "type": "number", + "title": "Speed", + "description": "Speed in meters per second.", + "examples": [ + 0.0 + ] + }, + "timestamp": { + "type": "string", + "format": "date-time", + "title": "Timestamp", + "description": "The timestamp of the position data.", + "examples": [ + "2024-02-17T05:54:00.932Z", + "2024-02-17T04:26:44.661Z" + ] + } + }, + "required": [ + "point", + "timestamp" ] - }, - "probability": { - "type": "number", - "title": "Probability", - "description": "The probability of the detected activity.", - "examples": [ - 0.96, - 0.02, - 0.01 + }, + "activityRecord": { + "type": "object", + "title": "Activity Record", + "description": "The activity record data, including detected activities and timestamp.", + "properties": { + "detectedActivities": { + "type": "array", + "title": "Detected Activities", + "description": "An array of detected activities, including activity type and probability.", + "items": { + "type": "object", + "title": "Detected Activity Item", + "properties": { + "activityType": { + "type": "string", + "title": "Activity Type", + "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", + "title": "Probability", + "description": "The probability of the detected activity.", + "examples": [ + 0.96, + 0.02, + 0.01 + ] + } + }, + "required": [ + "activityType", + "probability" + ] + } + }, + "timestamp": { + "type": "string", + "format": "date-time", + "title": "Timestamp", + "description": "The timestamp of the activity record.", + "examples": [ + "2024-02-17T05:26:47.066Z" + ] + } + }, + "required": [ + "detectedActivities", + "timestamp" ] - } }, - "required": [ - "activityType", - "probability" - ] - } - }, - "timestamp": { - "type": "string", - "format": "date-time", - "title": "Timestamp", - "description": "The timestamp of the activity record.", - "examples": [ - "2024-02-17T05:26:47.066Z" - ] + "wifiScan": { + "type": "object", + "title": "Wifi Scan Data", + "description": "The wifi scan data, including delivery time, devices, and source.", + "properties": { + "deliveryTime": { + "type": "string", + "format": "date-time", + "title": "Delivery Time", + "description": "The delivery time of the wifi scan.", + "examples": [ + "2024-02-17T04:26:44.661Z" + ] + }, + "devices": { + "type": "array", + "title": "Wifi Devices", + "description": "An array of wifi devices, including mac address and raw RSSI.", + "items": { + "type": "object", + "title": "Wifi Device", + "properties": { + "mac": { + "type": "string", + "title": "MAC Address", + "description": "The mac address of the wifi device.", + "examples": [ + "145830537259886", + "212032510881561", + "212032510881562" + ] + }, + "rawRssi": { + "type": "integer", + "title": "Raw RSSI", + "description": "The raw RSSI of the wifi device.", + "examples": [ + -51, + -53, + -58 + ] + } + }, + "required": [ + "mac", + "rawRssi" + ] + } + }, + "source": { + "type": "string", + "title": "Wifi Scan Source", + "description": "The source of the wifi scan data.", + "examples": [ + "ACTIVE_SCAN" + ] + } + }, + "required": [ + "deliveryTime", + "devices" + ] + } } - }, - "required": [ - "detectedActivities", - "timestamp" - ] }, - "wifiScan": { - "type": "object", - "title": "Wifi Scan Data", - "description": "The wifi scan data, including delivery time, devices, and source.", - "properties": { - "deliveryTime": { - "type": "string", - "format": "date-time", - "title": "Delivery Time", - "description": "The delivery time of the wifi scan.", - "examples": [ - "2024-02-17T04:26:44.661Z" - ] - }, - "devices": { - "type": "array", - "title": "Wifi Devices", - "description": "An array of wifi devices, including mac address and raw RSSI.", - "items": { - "type": "object", - "title": "Wifi Device", - "properties": { - "mac": { + "metadata": { + "type": "object", + "title": "Metadata", + "description": "Metadata about the data object.", + "properties": { + "platform": { "type": "string", - "title": "MAC Address", - "description": "The mac address of the wifi device.", + "description": "The platform that generated the data.", "examples": [ - "145830537259886", - "212032510881561", - "212032510881562" + "ANDROID", + "UNKNOWN" ] - }, - "rawRssi": { + } + }, + "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": "Raw RSSI", - "description": "The raw RSSI of the wifi device.", + "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": [ - -51, - -53, - -58 - ] - } + 439362473, + 436994475 + ], + "minimum": -900000000, + "maximum": 900000000 }, - "required": [ - "mac", - "rawRssi" - ] - } + "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 + } }, - "source": { - "type": "string", - "title": "Wifi Scan Source", - "description": "The source of the wifi scan data.", - "examples": [ - "ACTIVE_SCAN" - ] - } - }, - "required": [ - "deliveryTime", - "devices" - ] - } - } - }, - "metadata": { - "type": "object", - "title": "Metadata", - "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" + ] } - }, - "required": [ - "latE7", - "lngE7" - ] } - } } \ No newline at end of file From 203cf445b820cfea7ddb46b477892884df34c194 Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Wed, 20 Mar 2024 11:55:21 -0400 Subject: [PATCH 09/11] [UPDATE] `Makefile` and docs to include the timeline edits schema Addresses https://github.com/CarlosBergillos/LocationHistoryFormat/pull/5#issuecomment-2008309106 --- Makefile | 6 ++++-- docs/reference/index.md | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b6d2d8a..e0a392d 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,8 @@ EXPORTS_DIR = ./docs/reference/ SOURCES = \ settings:=Settings.schema.json \ records:=Records.schema.json \ - semantic:=Semantic.schema.json + semantic:=Semantic.schema.json \ + timeline-edits:=TimelineEdits.schema.json # List of titles to use in the output MD files, each item in the form: # {output_key}:={output_title} @@ -15,7 +16,8 @@ SOURCES = \ SOURCE_TITLES = \ settings:=**\`Settings.json\`**\_Format\_Definition \ records:=**\`Records.json\`**\_Format\_Definition \ - semantic:=Semantic\_Location\_History\_Format\_Definition + semantic:=Semantic\_Location\_History\_Format\_Definition \ + timeline-edits:=Timeline\_Edits\_Format\_Definition TOOL_JSONSCHEMA2MD = $(wildcard ./tools/jsonschema_to_md/*.py) $(wildcard ./tools/jsonschema_to_md/templates/*.jinja) diff --git a/docs/reference/index.md b/docs/reference/index.md index 0225f1a..f71a7da 100644 --- a/docs/reference/index.md +++ b/docs/reference/index.md @@ -7,9 +7,11 @@ User-friendly documentation for these files is provided in the following pages: - **[Records.json]** - **[Settings.json]** - **[Semantic Location History]** +- **[Timeline Edits]** [Schemas]: https://github.com/CarlosBergillos/LocationHistoryFormat/tree/main/schemas [Records.json]: records.md [Settings.json]: settings.md [Semantic Location History]: semantic.md +[Timeline Edits]: timeline-edits.md From 3c18c52e179d8ce0f6548723569b2ec03e3d23a4 Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Wed, 20 Mar 2024 21:02:09 -0400 Subject: [PATCH 10/11] [FIXED] Missing title and description of few items Addresses https://github.com/CarlosBergillos/LocationHistoryFormat/pull/5#issuecomment-2010630061 --- schemas/TimelineEdits.schema.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/schemas/TimelineEdits.schema.json b/schemas/TimelineEdits.schema.json index 0219c9d..1fb8762 100644 --- a/schemas/TimelineEdits.schema.json +++ b/schemas/TimelineEdits.schema.json @@ -108,6 +108,7 @@ "description": "An array of place information, including score, location, and place ID.", "items": { "title": "Place Aggregate Info Item", + "description": "The place aggregate info containing score, location, place ID, and other details.", "type": "object", "properties": { "score": { @@ -346,6 +347,7 @@ "items": { "type": "object", "title": "Detected Activity Item", + "description": "The detected activity item info containing activity type and probability.", "properties": { "activityType": { "type": "string", @@ -414,6 +416,7 @@ "items": { "type": "object", "title": "Wifi Device", + "description": "The wifi device info containing mac address and raw RSSI.", "properties": { "mac": { "type": "string", @@ -465,6 +468,7 @@ "properties": { "platform": { "type": "string", + "title": "Device Platform", "description": "The platform that generated the data.", "examples": [ "ANDROID", From 57466afb4206ce6d0e0b667e7c98dd4f0e61ff84 Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Thu, 21 Mar 2024 03:04:33 +0000 Subject: [PATCH 11/11] [FIXED] Last error --- schemas/TimelineEdits.schema.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/schemas/TimelineEdits.schema.json b/schemas/TimelineEdits.schema.json index 1fb8762..f3f22e6 100644 --- a/schemas/TimelineEdits.schema.json +++ b/schemas/TimelineEdits.schema.json @@ -176,6 +176,8 @@ "description": "An array of place IDs for the top-ranked places.", "items": { "type": "string", + "title": "Top Ranked Place ID", + "description": "The ID of top place ID", "examples": [ "ChIJV8SII64E1YkRvAqrnP5G_x8", "ChIJ4_FHs78TK4gRw8h22XkBDEA",