From 14fae825472fd79a342757d0366617d456e4f1fd Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Tue, 28 Jul 2026 23:43:16 +0200 Subject: [PATCH 01/50] Add W3DS Health ontologies: observation-model health data (34 schemas) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BiometricFacts (4): BloodTypeFact, BiologicalSexFact, SkinTypeFact, WheelchairUseFact — one self-sufficient biometric attribute per envelope; identity fields (name, birthDate) deliberately stay in the shared User ontology, nothing is duplicated. Observations (9): BodyMass, Height, BloodPressure (systolic+diastolic as one measurement event), BodyTemperature, BloodGlucose, VO2Max, RestingHeartRate, BodyFatPercentage, LeanBodyMass — one envelope per measurement, so e.g. a smart scale writes BodyMassObservation and nothing else. Series (15): HeartRate, HeartRateVariability, Step, WalkingRunningDistance, CyclingDistance, ActiveEnergy, BasalEnergy, ExerciseMinutes, StandMinutes, FlightsClimbed, OxygenSaturation, RespiratoryRate, WristTemperature, EnvironmentalAudio, HeadphoneAudio — RAW samples chunked one envelope per (person x local day x device); multiple devices coexist as separate envelopes; the stats block is documented as derived preview. Events (4): Workout (GPS route as polyline5 INSIDE the private envelope), SleepSession (neutral stages inBed/awake/light/deep/rem/asleep), Meal (photo embedded; nutritionEstimate structurally labeled as an AI estimate), DailyActivitySummary (source-computed totals + goals). Infrastructure (2): Device — a device passport living on the DEVICE's OWN eVault (each measuring device gets its own w3id via the provisioner); DeviceLink — pure reference on the person's vault (signatureHash -> device w3id). Health data always lives on the person's vault and references devices by w3id, so device ownership can change hands without touching the person's data. All envelopes carry subject, provenance (vendor identity lives only here — metric keys are vendor-neutral), dedupKey and contentHash for idempotent re-imports. ACLs are [@owner] — health data is private by default. Authored by W3DS Health (platform vault @1a73617b-7b1d-56a8-88a9-963bcf9dfcc2). --- .../ontology/schemas/activeEnergySeries.json | 116 +++++++++++++ .../ontology/schemas/basalEnergySeries.json | 116 +++++++++++++ .../ontology/schemas/biologicalSexFact.json | 68 ++++++++ .../schemas/bloodGlucoseObservation.json | 72 +++++++++ .../schemas/bloodPressureObservation.json | 76 +++++++++ services/ontology/schemas/bloodTypeFact.json | 68 ++++++++ .../schemas/bodyFatPercentageObservation.json | 72 +++++++++ .../ontology/schemas/bodyMassObservation.json | 72 +++++++++ .../schemas/bodyTemperatureObservation.json | 72 +++++++++ .../schemas/cyclingDistanceSeries.json | 116 +++++++++++++ .../schemas/dailyActivitySummary.json | 81 ++++++++++ services/ontology/schemas/device.json | 69 ++++++++ services/ontology/schemas/deviceLink.json | 38 +++++ .../schemas/environmentalAudioSeries.json | 116 +++++++++++++ .../schemas/exerciseMinutesSeries.json | 116 +++++++++++++ .../schemas/flightsClimbedSeries.json | 116 +++++++++++++ .../schemas/headphoneAudioSeries.json | 116 +++++++++++++ .../ontology/schemas/heartRateSeries.json | 116 +++++++++++++ .../schemas/heartRateVariabilitySeries.json | 116 +++++++++++++ .../ontology/schemas/heightObservation.json | 72 +++++++++ .../schemas/leanBodyMassObservation.json | 72 +++++++++ services/ontology/schemas/meal.json | 152 ++++++++++++++++++ .../schemas/oxygenSaturationSeries.json | 116 +++++++++++++ .../schemas/respiratoryRateSeries.json | 116 +++++++++++++ .../schemas/restingHeartRateObservation.json | 72 +++++++++ services/ontology/schemas/skinTypeFact.json | 68 ++++++++ services/ontology/schemas/sleepSession.json | 126 +++++++++++++++ .../ontology/schemas/standMinutesSeries.json | 116 +++++++++++++ services/ontology/schemas/stepSeries.json | 116 +++++++++++++ .../ontology/schemas/vO2MaxObservation.json | 72 +++++++++ .../schemas/walkingRunningDistanceSeries.json | 116 +++++++++++++ .../ontology/schemas/wheelchairUseFact.json | 68 ++++++++ services/ontology/schemas/workout.json | 135 ++++++++++++++++ .../schemas/wristTemperatureSeries.json | 116 +++++++++++++ 34 files changed, 3265 insertions(+) create mode 100644 services/ontology/schemas/activeEnergySeries.json create mode 100644 services/ontology/schemas/basalEnergySeries.json create mode 100644 services/ontology/schemas/biologicalSexFact.json create mode 100644 services/ontology/schemas/bloodGlucoseObservation.json create mode 100644 services/ontology/schemas/bloodPressureObservation.json create mode 100644 services/ontology/schemas/bloodTypeFact.json create mode 100644 services/ontology/schemas/bodyFatPercentageObservation.json create mode 100644 services/ontology/schemas/bodyMassObservation.json create mode 100644 services/ontology/schemas/bodyTemperatureObservation.json create mode 100644 services/ontology/schemas/cyclingDistanceSeries.json create mode 100644 services/ontology/schemas/dailyActivitySummary.json create mode 100644 services/ontology/schemas/device.json create mode 100644 services/ontology/schemas/deviceLink.json create mode 100644 services/ontology/schemas/environmentalAudioSeries.json create mode 100644 services/ontology/schemas/exerciseMinutesSeries.json create mode 100644 services/ontology/schemas/flightsClimbedSeries.json create mode 100644 services/ontology/schemas/headphoneAudioSeries.json create mode 100644 services/ontology/schemas/heartRateSeries.json create mode 100644 services/ontology/schemas/heartRateVariabilitySeries.json create mode 100644 services/ontology/schemas/heightObservation.json create mode 100644 services/ontology/schemas/leanBodyMassObservation.json create mode 100644 services/ontology/schemas/meal.json create mode 100644 services/ontology/schemas/oxygenSaturationSeries.json create mode 100644 services/ontology/schemas/respiratoryRateSeries.json create mode 100644 services/ontology/schemas/restingHeartRateObservation.json create mode 100644 services/ontology/schemas/skinTypeFact.json create mode 100644 services/ontology/schemas/sleepSession.json create mode 100644 services/ontology/schemas/standMinutesSeries.json create mode 100644 services/ontology/schemas/stepSeries.json create mode 100644 services/ontology/schemas/vO2MaxObservation.json create mode 100644 services/ontology/schemas/walkingRunningDistanceSeries.json create mode 100644 services/ontology/schemas/wheelchairUseFact.json create mode 100644 services/ontology/schemas/workout.json create mode 100644 services/ontology/schemas/wristTemperatureSeries.json diff --git a/services/ontology/schemas/activeEnergySeries.json b/services/ontology/schemas/activeEnergySeries.json new file mode 100644 index 000000000..db8611b56 --- /dev/null +++ b/services/ontology/schemas/activeEnergySeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "915892f9-693b-4f4f-95e6-17f9ceeb55ff", + "title": "ActiveEnergySeries", + "description": "Raw active energy burned samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: kcal.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "kcal" + }, + "sampleType": { + "type": "string", + "const": "interval" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/basalEnergySeries.json b/services/ontology/schemas/basalEnergySeries.json new file mode 100644 index 000000000..2145e1934 --- /dev/null +++ b/services/ontology/schemas/basalEnergySeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "28b50f16-0db1-445b-9f45-0412e9ac3f56", + "title": "BasalEnergySeries", + "description": "Raw basal (resting) energy burned samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: kcal.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "kcal" + }, + "sampleType": { + "type": "string", + "const": "interval" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/biologicalSexFact.json b/services/ontology/schemas/biologicalSexFact.json new file mode 100644 index 000000000..6b83b8350 --- /dev/null +++ b/services/ontology/schemas/biologicalSexFact.json @@ -0,0 +1,68 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "ae1f8c24-41e6-4ec3-a128-07e423811332", + "title": "BiologicalSexFact", + "description": "A BiometricFact: one self-sufficient biometric attribute of a person — biological sex, e.g. \"male\". One envelope per (person × source). Identity fields (name, birthDate) are NOT here — they live in the shared User ontology.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": [ + "string", + "boolean" + ] + }, + "recordedAt": { + "type": "string" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value" + ] +} diff --git a/services/ontology/schemas/bloodGlucoseObservation.json b/services/ontology/schemas/bloodGlucoseObservation.json new file mode 100644 index 000000000..2bb30e0c4 --- /dev/null +++ b/services/ontology/schemas/bloodGlucoseObservation.json @@ -0,0 +1,72 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "79568be5-45b3-40ed-a96a-e5e39bc8814b", + "title": "BloodGlucoseObservation", + "description": "One spot measurement of blood glucose = one envelope. Canonical unit: mmol/L.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": "number" + }, + "unit": { + "type": "string", + "const": "mmol/L" + }, + "measuredAt": { + "type": "string", + "description": "ISO 8601 with offset" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value", + "unit", + "measuredAt" + ] +} diff --git a/services/ontology/schemas/bloodPressureObservation.json b/services/ontology/schemas/bloodPressureObservation.json new file mode 100644 index 000000000..5afb95374 --- /dev/null +++ b/services/ontology/schemas/bloodPressureObservation.json @@ -0,0 +1,76 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "89b92b95-d631-4331-87c2-1fb4d2d695f4", + "title": "BloodPressureObservation", + "description": "One blood-pressure measurement event. Systolic and diastolic belong to the same measurement and are never split.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "systolic": { + "type": "number" + }, + "diastolic": { + "type": "number" + }, + "unit": { + "type": "string", + "const": "mmHg" + }, + "measuredAt": { + "type": "string", + "description": "ISO 8601 with offset" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "systolic", + "diastolic", + "unit", + "measuredAt" + ] +} diff --git a/services/ontology/schemas/bloodTypeFact.json b/services/ontology/schemas/bloodTypeFact.json new file mode 100644 index 000000000..afe61c2c4 --- /dev/null +++ b/services/ontology/schemas/bloodTypeFact.json @@ -0,0 +1,68 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "0efd35ac-56f8-4e17-9109-63985f4547c3", + "title": "BloodTypeFact", + "description": "A BiometricFact: one self-sufficient biometric attribute of a person — blood type, e.g. \"A+\". One envelope per (person × source). Identity fields (name, birthDate) are NOT here — they live in the shared User ontology.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": [ + "string", + "boolean" + ] + }, + "recordedAt": { + "type": "string" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value" + ] +} diff --git a/services/ontology/schemas/bodyFatPercentageObservation.json b/services/ontology/schemas/bodyFatPercentageObservation.json new file mode 100644 index 000000000..4acfab90d --- /dev/null +++ b/services/ontology/schemas/bodyFatPercentageObservation.json @@ -0,0 +1,72 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "f41d7580-ff0c-497a-9f2e-04c8f060978e", + "title": "BodyFatPercentageObservation", + "description": "One spot measurement of body fat percentage = one envelope. Canonical unit: %.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": "number" + }, + "unit": { + "type": "string", + "const": "%" + }, + "measuredAt": { + "type": "string", + "description": "ISO 8601 with offset" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value", + "unit", + "measuredAt" + ] +} diff --git a/services/ontology/schemas/bodyMassObservation.json b/services/ontology/schemas/bodyMassObservation.json new file mode 100644 index 000000000..c01e9c60d --- /dev/null +++ b/services/ontology/schemas/bodyMassObservation.json @@ -0,0 +1,72 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "bb45aa75-6be7-4024-84f9-7c68426e04d9", + "title": "BodyMassObservation", + "description": "One spot measurement of body mass = one envelope. Canonical unit: kg.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": "number" + }, + "unit": { + "type": "string", + "const": "kg" + }, + "measuredAt": { + "type": "string", + "description": "ISO 8601 with offset" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value", + "unit", + "measuredAt" + ] +} diff --git a/services/ontology/schemas/bodyTemperatureObservation.json b/services/ontology/schemas/bodyTemperatureObservation.json new file mode 100644 index 000000000..699070b10 --- /dev/null +++ b/services/ontology/schemas/bodyTemperatureObservation.json @@ -0,0 +1,72 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "85efca03-b202-4dc1-83b1-02c683d32b79", + "title": "BodyTemperatureObservation", + "description": "One spot measurement of body temperature = one envelope. Canonical unit: degC.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": "number" + }, + "unit": { + "type": "string", + "const": "degC" + }, + "measuredAt": { + "type": "string", + "description": "ISO 8601 with offset" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value", + "unit", + "measuredAt" + ] +} diff --git a/services/ontology/schemas/cyclingDistanceSeries.json b/services/ontology/schemas/cyclingDistanceSeries.json new file mode 100644 index 000000000..dd11caef6 --- /dev/null +++ b/services/ontology/schemas/cyclingDistanceSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "cf7d02f4-1a9c-40cf-be30-aaf5985a1738", + "title": "CyclingDistanceSeries", + "description": "Raw cycling distance samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: km.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "km" + }, + "sampleType": { + "type": "string", + "const": "interval" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/dailyActivitySummary.json b/services/ontology/schemas/dailyActivitySummary.json new file mode 100644 index 000000000..c6e0b1301 --- /dev/null +++ b/services/ontology/schemas/dailyActivitySummary.json @@ -0,0 +1,81 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "571803c6-6324-4b69-9f8a-6dd2ec8c4d32", + "title": "DailyActivitySummary", + "description": "Source-computed daily activity totals and goals (goals are user-set facts, not derivable from series). One envelope per (person × day × source).", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$" + }, + "energyKcal": { + "type": "number" + }, + "energyKcalGoal": { + "type": "number" + }, + "exerciseMin": { + "type": "number" + }, + "exerciseMinGoal": { + "type": "number" + }, + "standHours": { + "type": "number" + }, + "standHoursGoal": { + "type": "number" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date" + ] +} diff --git a/services/ontology/schemas/device.json b/services/ontology/schemas/device.json new file mode 100644 index 000000000..455c8b66f --- /dev/null +++ b/services/ontology/schemas/device.json @@ -0,0 +1,69 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "d8b587d2-fbde-4b7d-87c8-a9b6c4199601", + "title": "Device", + "description": "A measuring device's passport, living on the DEVICE'S OWN eVault (the device has its own w3id). Health data always lives on the person's vault and references the device by w3id. Ownership can change (device sold) without touching the person's data.", + "type": "object", + "properties": { + "w3id": { + "type": "string", + "description": "the device's own @-prefixed w3id (self-reference)" + }, + "kind": { + "type": "string", + "enum": [ + "watch", + "phone", + "scale", + "app", + "other" + ] + }, + "name": { + "type": "string" + }, + "manufacturer": { + "type": "string" + }, + "model": { + "type": "string" + }, + "hardwareVersion": { + "type": "string" + }, + "softwareVersion": { + "type": "string" + }, + "serialNumber": { + "type": "string" + }, + "ownerEName": { + "type": "string", + "description": "current owner (@-prefixed eName)" + }, + "signature": { + "type": "string", + "description": "normalized source signature this passport was created from" + }, + "registeredAt": { + "type": "string" + }, + "dedupKey": { + "type": "string" + }, + "contentHash": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + }, + "required": [ + "w3id", + "kind", + "ownerEName", + "signature", + "dedupKey", + "contentHash" + ] +} diff --git a/services/ontology/schemas/deviceLink.json b/services/ontology/schemas/deviceLink.json new file mode 100644 index 000000000..4b0c6fee3 --- /dev/null +++ b/services/ontology/schemas/deviceLink.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "76a5dae4-0543-4605-97fc-7478a8048d86", + "title": "DeviceLink", + "description": "Pure reference on the PERSON's vault: maps a device signature hash to the device's w3id. No device description is copied here (rule: canonical + reference, never a copy) — the passport lives on the device's own vault. Lets a fresh install rebuild signature→device mapping without re-provisioning duplicate vaults.", + "type": "object", + "properties": { + "subject": { + "type": "string" + }, + "deviceEName": { + "type": "string" + }, + "signatureHash": { + "type": "string", + "description": "sha256 of the normalized signature — the dedup key" + }, + "linkedAt": { + "type": "string" + }, + "dedupKey": { + "type": "string" + }, + "contentHash": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + }, + "required": [ + "subject", + "deviceEName", + "signatureHash", + "dedupKey", + "contentHash" + ] +} diff --git a/services/ontology/schemas/environmentalAudioSeries.json b/services/ontology/schemas/environmentalAudioSeries.json new file mode 100644 index 000000000..9e348a5e5 --- /dev/null +++ b/services/ontology/schemas/environmentalAudioSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "8fcac357-0d1e-45fe-9d09-b89acb60520d", + "title": "EnvironmentalAudioSeries", + "description": "Raw environmental audio exposure samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [epochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: dBASPL.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "dBASPL" + }, + "sampleType": { + "type": "string", + "const": "point" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/exerciseMinutesSeries.json b/services/ontology/schemas/exerciseMinutesSeries.json new file mode 100644 index 000000000..ad264ac9b --- /dev/null +++ b/services/ontology/schemas/exerciseMinutesSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "6a728f1b-0ed1-4fda-8cb6-c242b813d8a4", + "title": "ExerciseMinutesSeries", + "description": "Raw exercise minutes samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: min.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "min" + }, + "sampleType": { + "type": "string", + "const": "interval" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/flightsClimbedSeries.json b/services/ontology/schemas/flightsClimbedSeries.json new file mode 100644 index 000000000..edf2024ff --- /dev/null +++ b/services/ontology/schemas/flightsClimbedSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "f9c6bf77-968c-41cd-abb8-232792223183", + "title": "FlightsClimbedSeries", + "description": "Raw flights of stairs climbed samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: count.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "count" + }, + "sampleType": { + "type": "string", + "const": "interval" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/headphoneAudioSeries.json b/services/ontology/schemas/headphoneAudioSeries.json new file mode 100644 index 000000000..b2329b155 --- /dev/null +++ b/services/ontology/schemas/headphoneAudioSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "f173f942-edbb-41ef-b964-65f3f2ddb084", + "title": "HeadphoneAudioSeries", + "description": "Raw headphone audio exposure samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [epochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: dBASPL.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "dBASPL" + }, + "sampleType": { + "type": "string", + "const": "point" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/heartRateSeries.json b/services/ontology/schemas/heartRateSeries.json new file mode 100644 index 000000000..988c9e34c --- /dev/null +++ b/services/ontology/schemas/heartRateSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "a1bc3128-2248-4248-8411-1bdc5f81c151", + "title": "HeartRateSeries", + "description": "Raw heart rate samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [epochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: count/min.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "count/min" + }, + "sampleType": { + "type": "string", + "const": "point" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/heartRateVariabilitySeries.json b/services/ontology/schemas/heartRateVariabilitySeries.json new file mode 100644 index 000000000..3430bcd62 --- /dev/null +++ b/services/ontology/schemas/heartRateVariabilitySeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "d613e09f-2f41-43d8-b92d-5b84cbf0aa30", + "title": "HeartRateVariabilitySeries", + "description": "Raw heart rate variability (SDNN) samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [epochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: ms.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "ms" + }, + "sampleType": { + "type": "string", + "const": "point" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/heightObservation.json b/services/ontology/schemas/heightObservation.json new file mode 100644 index 000000000..18d1c8315 --- /dev/null +++ b/services/ontology/schemas/heightObservation.json @@ -0,0 +1,72 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "c5cf620f-2b75-489d-8937-5f77e8e2e23e", + "title": "HeightObservation", + "description": "One spot measurement of height = one envelope. Canonical unit: cm.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": "number" + }, + "unit": { + "type": "string", + "const": "cm" + }, + "measuredAt": { + "type": "string", + "description": "ISO 8601 with offset" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value", + "unit", + "measuredAt" + ] +} diff --git a/services/ontology/schemas/leanBodyMassObservation.json b/services/ontology/schemas/leanBodyMassObservation.json new file mode 100644 index 000000000..0a5c5a0bf --- /dev/null +++ b/services/ontology/schemas/leanBodyMassObservation.json @@ -0,0 +1,72 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "f262892c-98e9-4b66-a6af-eea4c9ef94bc", + "title": "LeanBodyMassObservation", + "description": "One spot measurement of lean body mass = one envelope. Canonical unit: kg.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": "number" + }, + "unit": { + "type": "string", + "const": "kg" + }, + "measuredAt": { + "type": "string", + "description": "ISO 8601 with offset" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value", + "unit", + "measuredAt" + ] +} diff --git a/services/ontology/schemas/meal.json b/services/ontology/schemas/meal.json new file mode 100644 index 000000000..2aacaa74e --- /dev/null +++ b/services/ontology/schemas/meal.json @@ -0,0 +1,152 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "879df524-f062-44eb-9a05-52dc62884e6c", + "title": "Meal", + "description": "One meal. The photo is embedded INSIDE this private envelope (downscaled data URI) — never in public blob storage. nutritionEstimate is STRUCTURALLY an estimate (AI vision output) — readers must present it as an estimate, never as a measured fact.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "timestamp": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$" + }, + "mealType": { + "type": "string", + "enum": [ + "breakfast", + "lunch", + "dinner", + "snack" + ] + }, + "comment": { + "type": "string" + }, + "place": { + "type": "string" + }, + "photo": { + "type": "object", + "properties": { + "dataUri": { + "type": "string" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + } + }, + "required": [ + "dataUri" + ] + }, + "nutritionEstimate": { + "type": "object", + "description": "AI ESTIMATE — not a measurement", + "properties": { + "method": { + "type": "string", + "const": "ai-vision" + }, + "estimatedAt": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "massG": { + "type": "number" + }, + "kcal": { + "type": "number" + }, + "proteinG": { + "type": "number" + }, + "fatG": { + "type": "number" + }, + "carbsG": { + "type": "number" + }, + "confidence": { + "type": "number" + } + }, + "required": [ + "name" + ] + } + }, + "totalKcal": { + "type": "number" + } + }, + "required": [ + "method", + "estimatedAt", + "items" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "timestamp", + "date" + ] +} diff --git a/services/ontology/schemas/oxygenSaturationSeries.json b/services/ontology/schemas/oxygenSaturationSeries.json new file mode 100644 index 000000000..0499b573b --- /dev/null +++ b/services/ontology/schemas/oxygenSaturationSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "a58b8b8a-0651-414d-9836-269dd6b2ed3d", + "title": "OxygenSaturationSeries", + "description": "Raw blood oxygen saturation samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [epochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: %.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "%" + }, + "sampleType": { + "type": "string", + "const": "point" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/respiratoryRateSeries.json b/services/ontology/schemas/respiratoryRateSeries.json new file mode 100644 index 000000000..65bc76801 --- /dev/null +++ b/services/ontology/schemas/respiratoryRateSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "a3a2b37a-1120-4b02-abba-41baff0e6c3e", + "title": "RespiratoryRateSeries", + "description": "Raw respiratory rate samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [epochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: count/min.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "count/min" + }, + "sampleType": { + "type": "string", + "const": "point" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/restingHeartRateObservation.json b/services/ontology/schemas/restingHeartRateObservation.json new file mode 100644 index 000000000..41909f1b0 --- /dev/null +++ b/services/ontology/schemas/restingHeartRateObservation.json @@ -0,0 +1,72 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "3ef62702-c021-4367-b152-b6e257f2ad30", + "title": "RestingHeartRateObservation", + "description": "One spot measurement of resting heart rate (device-computed daily value) = one envelope. Canonical unit: count/min.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": "number" + }, + "unit": { + "type": "string", + "const": "count/min" + }, + "measuredAt": { + "type": "string", + "description": "ISO 8601 with offset" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value", + "unit", + "measuredAt" + ] +} diff --git a/services/ontology/schemas/skinTypeFact.json b/services/ontology/schemas/skinTypeFact.json new file mode 100644 index 000000000..6b9576a38 --- /dev/null +++ b/services/ontology/schemas/skinTypeFact.json @@ -0,0 +1,68 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "8d4fe698-9d6b-4a54-a973-d3964e7bcd4a", + "title": "SkinTypeFact", + "description": "A BiometricFact: one self-sufficient biometric attribute of a person — skin type on the Fitzpatrick scale, e.g. \"Fitzpatrick II\". One envelope per (person × source). Identity fields (name, birthDate) are NOT here — they live in the shared User ontology.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": [ + "string", + "boolean" + ] + }, + "recordedAt": { + "type": "string" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value" + ] +} diff --git a/services/ontology/schemas/sleepSession.json b/services/ontology/schemas/sleepSession.json new file mode 100644 index 000000000..dbe56af69 --- /dev/null +++ b/services/ontology/schemas/sleepSession.json @@ -0,0 +1,126 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "f53146ba-0f25-4d1d-b612-35fb464d9a2e", + "title": "SleepSession", + "description": "One sleep session (a night). Neutral stage vocabulary: inBed | awake | light | deep | rem | asleep (unspecified). date = local morning of wake-up.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$" + }, + "startDate": { + "type": "string" + }, + "endDate": { + "type": "string" + }, + "stages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "stage": { + "type": "string", + "enum": [ + "inBed", + "awake", + "light", + "deep", + "rem", + "asleep" + ] + }, + "start": { + "type": "string" + }, + "end": { + "type": "string" + } + }, + "required": [ + "stage", + "start", + "end" + ] + } + }, + "totals": { + "type": "object", + "properties": { + "inBedMin": { + "type": "number" + }, + "asleepMin": { + "type": "number" + }, + "lightMin": { + "type": "number" + }, + "deepMin": { + "type": "number" + }, + "remMin": { + "type": "number" + }, + "awakeMin": { + "type": "number" + } + } + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "startDate", + "endDate", + "stages", + "totals" + ] +} diff --git a/services/ontology/schemas/standMinutesSeries.json b/services/ontology/schemas/standMinutesSeries.json new file mode 100644 index 000000000..42509941a --- /dev/null +++ b/services/ontology/schemas/standMinutesSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "3bba969c-1b36-4b93-b4b4-b9fdf856c39a", + "title": "StandMinutesSeries", + "description": "Raw standing minutes samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: min.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "min" + }, + "sampleType": { + "type": "string", + "const": "interval" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/stepSeries.json b/services/ontology/schemas/stepSeries.json new file mode 100644 index 000000000..1e9394c17 --- /dev/null +++ b/services/ontology/schemas/stepSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "4690ca86-3a4a-448a-b505-b4de58902546", + "title": "StepSeries", + "description": "Raw step count samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: count.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "count" + }, + "sampleType": { + "type": "string", + "const": "interval" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/vO2MaxObservation.json b/services/ontology/schemas/vO2MaxObservation.json new file mode 100644 index 000000000..25499f3e1 --- /dev/null +++ b/services/ontology/schemas/vO2MaxObservation.json @@ -0,0 +1,72 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "49efc0c5-2851-4e3c-8759-957d11427edf", + "title": "VO2MaxObservation", + "description": "One spot measurement of VO2Max = one envelope. Canonical unit: mL/kg/min.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": "number" + }, + "unit": { + "type": "string", + "const": "mL/kg/min" + }, + "measuredAt": { + "type": "string", + "description": "ISO 8601 with offset" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value", + "unit", + "measuredAt" + ] +} diff --git a/services/ontology/schemas/walkingRunningDistanceSeries.json b/services/ontology/schemas/walkingRunningDistanceSeries.json new file mode 100644 index 000000000..d21b3865a --- /dev/null +++ b/services/ontology/schemas/walkingRunningDistanceSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "e7d4f532-8999-47da-b96f-e46402a24f78", + "title": "WalkingRunningDistanceSeries", + "description": "Raw walking+running distance samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: km.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "km" + }, + "sampleType": { + "type": "string", + "const": "interval" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/wheelchairUseFact.json b/services/ontology/schemas/wheelchairUseFact.json new file mode 100644 index 000000000..6c0471a9e --- /dev/null +++ b/services/ontology/schemas/wheelchairUseFact.json @@ -0,0 +1,68 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "6ef27c3e-c684-48b2-937c-838caa473f66", + "title": "WheelchairUseFact", + "description": "A BiometricFact: one self-sufficient biometric attribute of a person — whether the person uses a wheelchair (boolean). One envelope per (person × source). Identity fields (name, birthDate) are NOT here — they live in the shared User ontology.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": [ + "string", + "boolean" + ] + }, + "recordedAt": { + "type": "string" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value" + ] +} diff --git a/services/ontology/schemas/workout.json b/services/ontology/schemas/workout.json new file mode 100644 index 000000000..83fb0ca1a --- /dev/null +++ b/services/ontology/schemas/workout.json @@ -0,0 +1,135 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "c693b036-9cd8-45d7-b53f-c5f068ab58b8", + "title": "Workout", + "description": "A workout/training session. The GPS route lives INSIDE this private envelope (encoded polyline5) — never in public blob storage. avgHeartRate/maxHeartRate/stats are DEVICE-COMPUTED aggregates over the workout window, not copies of series data. dedupKey = provenance-scoped external id.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "activityType": { + "type": "string", + "description": "Open neutral enum: Running, Walking, Cycling, Swimming, …" + }, + "startDate": { + "type": "string" + }, + "endDate": { + "type": "string" + }, + "durationSec": { + "type": "number" + }, + "distanceKm": { + "type": "number" + }, + "activeEnergyKcal": { + "type": "number" + }, + "avgHeartRate": { + "type": "number" + }, + "maxHeartRate": { + "type": "number" + }, + "elevationAscendedM": { + "type": "number" + }, + "stats": { + "type": "object", + "description": "Device-computed per-metric aggregates, keyed by neutral metric keys", + "additionalProperties": { + "type": "object", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "unit": { + "type": "string" + } + } + } + }, + "route": { + "type": "object", + "description": "Canonical GPS route, INSIDE the private envelope", + "properties": { + "format": { + "type": "string", + "const": "polyline5" + }, + "data": { + "type": "string" + }, + "pointCount": { + "type": "integer" + } + }, + "required": [ + "format", + "data", + "pointCount" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "activityType", + "startDate", + "endDate", + "durationSec" + ] +} diff --git a/services/ontology/schemas/wristTemperatureSeries.json b/services/ontology/schemas/wristTemperatureSeries.json new file mode 100644 index 000000000..af1fe4833 --- /dev/null +++ b/services/ontology/schemas/wristTemperatureSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "d621eca8-4dde-4677-a60f-c45bdf908d97", + "title": "WristTemperatureSeries", + "description": "Raw wrist temperature during sleep samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [epochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: degC.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "degC" + }, + "sampleType": { + "type": "string", + "const": "point" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} From eafaadf37efa7cad1e5446aac91dd28ffa2174be Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 09:18:15 +0200 Subject: [PATCH 02/50] Add mobility + nutrition-intake series and WalkingHeartRateObservation (10 schemas) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mobility (point series, 1/person x day x device): walkingSpeedSeries (km/h), stepLengthSeries (cm), walkingDoubleSupportSeries (%), walkingAsymmetrySeries (%). Nutrition intake (interval series — food-log entries): energyIntakeSeries (kcal), proteinIntakeSeries (g), fatIntakeSeries (g), carbohydrateIntakeSeries (g), waterIntakeSeries (mL). Observation: walkingHeartRateObservation (device-computed daily value). --- .../schemas/carbohydrateIntakeSeries.json | 116 ++++++++++++++++++ .../ontology/schemas/energyIntakeSeries.json | 116 ++++++++++++++++++ .../ontology/schemas/fatIntakeSeries.json | 116 ++++++++++++++++++ .../ontology/schemas/proteinIntakeSeries.json | 116 ++++++++++++++++++ .../ontology/schemas/stepLengthSeries.json | 116 ++++++++++++++++++ .../schemas/walkingAsymmetrySeries.json | 116 ++++++++++++++++++ .../schemas/walkingDoubleSupportSeries.json | 116 ++++++++++++++++++ .../schemas/walkingHeartRateObservation.json | 72 +++++++++++ .../ontology/schemas/walkingSpeedSeries.json | 116 ++++++++++++++++++ .../ontology/schemas/waterIntakeSeries.json | 116 ++++++++++++++++++ 10 files changed, 1116 insertions(+) create mode 100644 services/ontology/schemas/carbohydrateIntakeSeries.json create mode 100644 services/ontology/schemas/energyIntakeSeries.json create mode 100644 services/ontology/schemas/fatIntakeSeries.json create mode 100644 services/ontology/schemas/proteinIntakeSeries.json create mode 100644 services/ontology/schemas/stepLengthSeries.json create mode 100644 services/ontology/schemas/walkingAsymmetrySeries.json create mode 100644 services/ontology/schemas/walkingDoubleSupportSeries.json create mode 100644 services/ontology/schemas/walkingHeartRateObservation.json create mode 100644 services/ontology/schemas/walkingSpeedSeries.json create mode 100644 services/ontology/schemas/waterIntakeSeries.json diff --git a/services/ontology/schemas/carbohydrateIntakeSeries.json b/services/ontology/schemas/carbohydrateIntakeSeries.json new file mode 100644 index 000000000..f948110e9 --- /dev/null +++ b/services/ontology/schemas/carbohydrateIntakeSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "ed7f2e84-b6cf-4354-8a52-6ab128e28d7e", + "title": "CarbohydrateIntakeSeries", + "description": "Raw dietary carbohydrate intake (food-log entries) samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: g.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "g" + }, + "sampleType": { + "type": "string", + "const": "interval" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/energyIntakeSeries.json b/services/ontology/schemas/energyIntakeSeries.json new file mode 100644 index 000000000..0ca11076b --- /dev/null +++ b/services/ontology/schemas/energyIntakeSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "120814e0-4c23-44c6-bb98-ca05d69c10f8", + "title": "EnergyIntakeSeries", + "description": "Raw dietary energy intake (food-log entries) samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: kcal.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "kcal" + }, + "sampleType": { + "type": "string", + "const": "interval" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/fatIntakeSeries.json b/services/ontology/schemas/fatIntakeSeries.json new file mode 100644 index 000000000..8c056585c --- /dev/null +++ b/services/ontology/schemas/fatIntakeSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "10bed212-eb97-4062-b325-8c037eb07ace", + "title": "FatIntakeSeries", + "description": "Raw dietary fat intake (food-log entries) samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: g.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "g" + }, + "sampleType": { + "type": "string", + "const": "interval" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/proteinIntakeSeries.json b/services/ontology/schemas/proteinIntakeSeries.json new file mode 100644 index 000000000..982f24311 --- /dev/null +++ b/services/ontology/schemas/proteinIntakeSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "6b591d75-2dce-4b2c-a8a3-eb236b5a4a89", + "title": "ProteinIntakeSeries", + "description": "Raw dietary protein intake (food-log entries) samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: g.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "g" + }, + "sampleType": { + "type": "string", + "const": "interval" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/stepLengthSeries.json b/services/ontology/schemas/stepLengthSeries.json new file mode 100644 index 000000000..6b168116c --- /dev/null +++ b/services/ontology/schemas/stepLengthSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "4e0cfb8a-99f2-4294-8432-41190bc8b3e7", + "title": "StepLengthSeries", + "description": "Raw walking step length samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [epochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: cm.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "cm" + }, + "sampleType": { + "type": "string", + "const": "point" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/walkingAsymmetrySeries.json b/services/ontology/schemas/walkingAsymmetrySeries.json new file mode 100644 index 000000000..e3733fa12 --- /dev/null +++ b/services/ontology/schemas/walkingAsymmetrySeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "5c3bac68-1902-4d18-8aa5-6f456dee2156", + "title": "WalkingAsymmetrySeries", + "description": "Raw walking asymmetry percentage samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [epochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: %.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "%" + }, + "sampleType": { + "type": "string", + "const": "point" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/walkingDoubleSupportSeries.json b/services/ontology/schemas/walkingDoubleSupportSeries.json new file mode 100644 index 000000000..01e2043d2 --- /dev/null +++ b/services/ontology/schemas/walkingDoubleSupportSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "5a1ff54e-37f9-42bb-87c9-b97248848553", + "title": "WalkingDoubleSupportSeries", + "description": "Raw walking double-support percentage samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [epochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: %.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "%" + }, + "sampleType": { + "type": "string", + "const": "point" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/walkingHeartRateObservation.json b/services/ontology/schemas/walkingHeartRateObservation.json new file mode 100644 index 000000000..0ce43b1a2 --- /dev/null +++ b/services/ontology/schemas/walkingHeartRateObservation.json @@ -0,0 +1,72 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "957e35c5-cbda-4b9f-b92b-9db1a519c0bc", + "title": "WalkingHeartRateObservation", + "description": "One spot measurement of average walking heart rate (device-computed daily value) = one envelope. Canonical unit: count/min.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": "number" + }, + "unit": { + "type": "string", + "const": "count/min" + }, + "measuredAt": { + "type": "string", + "description": "ISO 8601 with offset" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value", + "unit", + "measuredAt" + ] +} diff --git a/services/ontology/schemas/walkingSpeedSeries.json b/services/ontology/schemas/walkingSpeedSeries.json new file mode 100644 index 000000000..7ddf80368 --- /dev/null +++ b/services/ontology/schemas/walkingSpeedSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "a436853e-4fa1-4f55-9527-210579157ce3", + "title": "WalkingSpeedSeries", + "description": "Raw walking speed samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [epochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: km/h.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "km/h" + }, + "sampleType": { + "type": "string", + "const": "point" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} diff --git a/services/ontology/schemas/waterIntakeSeries.json b/services/ontology/schemas/waterIntakeSeries.json new file mode 100644 index 000000000..152502020 --- /dev/null +++ b/services/ontology/schemas/waterIntakeSeries.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "9596b22f-db7c-4801-a8cb-9101ce3e58dc", + "title": "WaterIntakeSeries", + "description": "Raw water intake (food-log entries) samples over one local day from ONE device. One envelope per (person × day × device) — multiple devices coexist as separate envelopes; merging is a reader-side presentation concern. Sample = [startEpochSeconds, endEpochSeconds, value], epoch = UTC seconds, utcOffset gives the person's local offset. `stats` is DERIVED from samples (cheap-read preview) — samples are the source of truth. Canonical unit: mL.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "local day — chunk key" + }, + "utcOffset": { + "type": "string", + "pattern": "^[+-]\\d{2}:\\d{2}$" + }, + "unit": { + "type": "string", + "const": "mL" + }, + "sampleType": { + "type": "string", + "const": "interval" + }, + "samples": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "stats": { + "type": "object", + "description": "DERIVED from samples — preview only", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "avg": { + "type": "number" + }, + "sum": { + "type": "number" + }, + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "date", + "utcOffset", + "unit", + "sampleType", + "samples", + "stats" + ] +} From ac5f05a8fc3d7c1dffec1b56fb6c73cefdd3e78d Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 09:38:04 +0200 Subject: [PATCH 03/50] meal: nutritionEstimate.method enum ai-vision|food-log (imported food-diary entries) --- services/ontology/schemas/meal.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/ontology/schemas/meal.json b/services/ontology/schemas/meal.json index 2aacaa74e..ea6109c9f 100644 --- a/services/ontology/schemas/meal.json +++ b/services/ontology/schemas/meal.json @@ -93,7 +93,11 @@ "properties": { "method": { "type": "string", - "const": "ai-vision" + "enum": [ + "ai-vision", + "food-log" + ], + "description": "ai-vision = AI photo analysis; food-log = user-entered food-app values" }, "estimatedAt": { "type": "string" From a9114b0e7668cec211c05507c666d3caa7b8802a Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:29:37 +0200 Subject: [PATCH 04/50] Add HealthPhoto ontology (private image envelope; blob store is public-read) --- services/ontology/schemas/healthPhoto.json | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 services/ontology/schemas/healthPhoto.json diff --git a/services/ontology/schemas/healthPhoto.json b/services/ontology/schemas/healthPhoto.json new file mode 100644 index 000000000..032732e95 --- /dev/null +++ b/services/ontology/schemas/healthPhoto.json @@ -0,0 +1,95 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "30b4bb28-494b-4d78-b99b-18f58a008da0", + "title": "HealthPhoto", + "description": "One private health image = one envelope, ACL [@owner]. The bytes are INLINE (data URI) by design: the platform blob store serves uploaded files from a public CDN regardless of the envelope ACL, so health imagery must not be stored there. Other envelopes (e.g. Meal) reference this envelope and never carry a second copy of the bytes.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "mediaType": { + "type": "string", + "enum": [ + "image/jpeg", + "image/png", + "image/webp" + ] + }, + "dataUri": { + "type": "string", + "description": "The image itself: data:;base64,…" + }, + "byteSize": { + "type": "integer" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "md5": { + "type": "string", + "description": "md5 of the bytes — dedup key for re-uploads of the same photo" + }, + "capturedAt": { + "type": "string" + }, + "purpose": { + "type": "string", + "description": "What the photo is of, in neutral terms (\"meal\", \"document\", \"other\")" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "mediaType", + "dataUri", + "byteSize", + "md5", + "capturedAt" + ] +} From c826c8107ea096084ef9948bc1856e52476cbdce Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:29:38 +0200 Subject: [PATCH 05/50] Meal: photo by reference to HealthPhoto; estimate carries model + derivedFrom; mealTypeSource --- services/ontology/schemas/meal.json | 34 +++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/services/ontology/schemas/meal.json b/services/ontology/schemas/meal.json index ea6109c9f..057348648 100644 --- a/services/ontology/schemas/meal.json +++ b/services/ontology/schemas/meal.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "schemaId": "879df524-f062-44eb-9a05-52dc62884e6c", "title": "Meal", - "description": "One meal. The photo is embedded INSIDE this private envelope (downscaled data URI) — never in public blob storage. nutritionEstimate is STRUCTURALLY an estimate (AI vision output) — readers must present it as an estimate, never as a measured fact.", + "description": "One meal. The photo is NOT embedded here: `photo.ref` points at the HealthPhoto envelope that holds the bytes (canonical + reference, never a copy). nutritionEstimate is STRUCTURALLY an estimate (AI vision output, `derivedFrom` names the photo it was read from) — readers must present it as an estimate, never as a measured fact.", "type": "object", "properties": { "subject": { @@ -64,16 +64,30 @@ "snack" ] }, + "mealTypeSource": { + "type": "string", + "enum": [ + "user", + "inferred" + ], + "description": "user = stated by the person; inferred = guessed from local time of day + dish. An inferred type must not be presented as stated." + }, "comment": { - "type": "string" + "type": "string", + "description": "The person's own words, stored verbatim" }, "place": { "type": "string" }, "photo": { "type": "object", + "description": "REFERENCE to the HealthPhoto envelope holding the bytes — never a copy of the image.", "properties": { - "dataUri": { + "ref": { + "type": "string", + "description": "w3ds://envelope?id=@owner/" + }, + "mediaType": { "type": "string" }, "width": { @@ -84,7 +98,7 @@ } }, "required": [ - "dataUri" + "ref" ] }, "nutritionEstimate": { @@ -136,6 +150,18 @@ }, "totalKcal": { "type": "number" + }, + "model": { + "type": "string", + "description": "Estimator identity (model id) — provenance of the estimate itself" + }, + "notes": { + "type": "string", + "description": "Estimator's stated assumptions/uncertainties" + }, + "derivedFrom": { + "type": "string", + "description": "w3ds:// reference to the HealthPhoto this estimate was derived from" } }, "required": [ From 3316e9687749c68dff5318cc6e03bbcb9eb32860 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:21 +0200 Subject: [PATCH 06/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/activeEnergySeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/activeEnergySeries.json b/services/ontology/schemas/activeEnergySeries.json index db8611b56..2d62fbc6a 100644 --- a/services/ontology/schemas/activeEnergySeries.json +++ b/services/ontology/schemas/activeEnergySeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 93ea25ae98b183f022f2354476d455404304e32c Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:22 +0200 Subject: [PATCH 07/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/basalEnergySeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/basalEnergySeries.json b/services/ontology/schemas/basalEnergySeries.json index 2145e1934..d493c045e 100644 --- a/services/ontology/schemas/basalEnergySeries.json +++ b/services/ontology/schemas/basalEnergySeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From b9c9c68513cac36867b27c500a204a8d8aa44391 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:24 +0200 Subject: [PATCH 08/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/biologicalSexFact.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/biologicalSexFact.json b/services/ontology/schemas/biologicalSexFact.json index 6b83b8350..6fd887ec3 100644 --- a/services/ontology/schemas/biologicalSexFact.json +++ b/services/ontology/schemas/biologicalSexFact.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From d9e87d843fd9a8325b3a634dd2454e05ff16eb96 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:25 +0200 Subject: [PATCH 09/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/bloodGlucoseObservation.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/bloodGlucoseObservation.json b/services/ontology/schemas/bloodGlucoseObservation.json index 2bb30e0c4..8a3549ddd 100644 --- a/services/ontology/schemas/bloodGlucoseObservation.json +++ b/services/ontology/schemas/bloodGlucoseObservation.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 32005bb4d114811891759143ad9b4fd0e4652964 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:27 +0200 Subject: [PATCH 10/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/bloodPressureObservation.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/bloodPressureObservation.json b/services/ontology/schemas/bloodPressureObservation.json index 5afb95374..d1db74bd1 100644 --- a/services/ontology/schemas/bloodPressureObservation.json +++ b/services/ontology/schemas/bloodPressureObservation.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From fa8c2bcad7ec0bea39fbcc595d7b98deadddebe1 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:29 +0200 Subject: [PATCH 11/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/bloodTypeFact.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/bloodTypeFact.json b/services/ontology/schemas/bloodTypeFact.json index afe61c2c4..353bc20a8 100644 --- a/services/ontology/schemas/bloodTypeFact.json +++ b/services/ontology/schemas/bloodTypeFact.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From debbe4a5266ff77e525e0bd03fb673e9ef3c8a94 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:30 +0200 Subject: [PATCH 12/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/bodyFatPercentageObservation.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/bodyFatPercentageObservation.json b/services/ontology/schemas/bodyFatPercentageObservation.json index 4acfab90d..ccbf85c7d 100644 --- a/services/ontology/schemas/bodyFatPercentageObservation.json +++ b/services/ontology/schemas/bodyFatPercentageObservation.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 0faeab584ae9309b9464f0caf7a09e3b9a1219a1 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:32 +0200 Subject: [PATCH 13/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/bodyMassObservation.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/bodyMassObservation.json b/services/ontology/schemas/bodyMassObservation.json index c01e9c60d..3048f0fba 100644 --- a/services/ontology/schemas/bodyMassObservation.json +++ b/services/ontology/schemas/bodyMassObservation.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From a61f7544b3d055e81e023cac5e29dada2365ead5 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:34 +0200 Subject: [PATCH 14/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/bodyTemperatureObservation.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/bodyTemperatureObservation.json b/services/ontology/schemas/bodyTemperatureObservation.json index 699070b10..7268b8ff0 100644 --- a/services/ontology/schemas/bodyTemperatureObservation.json +++ b/services/ontology/schemas/bodyTemperatureObservation.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 114b01b16c92cb9023149568dde4344660c0ce2d Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:35 +0200 Subject: [PATCH 15/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/carbohydrateIntakeSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/carbohydrateIntakeSeries.json b/services/ontology/schemas/carbohydrateIntakeSeries.json index f948110e9..e8f5ac30f 100644 --- a/services/ontology/schemas/carbohydrateIntakeSeries.json +++ b/services/ontology/schemas/carbohydrateIntakeSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From e33e7613471efade0513e501ff16b288776ae83a Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:36 +0200 Subject: [PATCH 16/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/cyclingDistanceSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/cyclingDistanceSeries.json b/services/ontology/schemas/cyclingDistanceSeries.json index dd11caef6..cf2fe1554 100644 --- a/services/ontology/schemas/cyclingDistanceSeries.json +++ b/services/ontology/schemas/cyclingDistanceSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 2845acdba66859b94f453ee7d5a83ee4458bb2df Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:38 +0200 Subject: [PATCH 17/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/dailyActivitySummary.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/dailyActivitySummary.json b/services/ontology/schemas/dailyActivitySummary.json index c6e0b1301..3dc42c05c 100644 --- a/services/ontology/schemas/dailyActivitySummary.json +++ b/services/ontology/schemas/dailyActivitySummary.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From e65184c12d0d607304a8b03fa47dc21dbe1960ef Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:39 +0200 Subject: [PATCH 18/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/deviceLink.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/deviceLink.json b/services/ontology/schemas/deviceLink.json index 4b0c6fee3..34e33e074 100644 --- a/services/ontology/schemas/deviceLink.json +++ b/services/ontology/schemas/deviceLink.json @@ -18,6 +18,10 @@ "linkedAt": { "type": "string" }, + "registeredBy": { + "type": "string", + "description": "w3id of the platform that created this link" + }, "dedupKey": { "type": "string" }, From 84f168e766c7e1e45a45bbffd2bc45c97aff2524 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:41 +0200 Subject: [PATCH 19/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/device.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/device.json b/services/ontology/schemas/device.json index 455c8b66f..f9a26cf5f 100644 --- a/services/ontology/schemas/device.json +++ b/services/ontology/schemas/device.json @@ -48,6 +48,10 @@ "registeredAt": { "type": "string" }, + "registeredBy": { + "type": "string", + "description": "w3id of the platform that provisioned this device vault" + }, "dedupKey": { "type": "string" }, From 475d1e6ae55624775272ffaa1dab8df8091e60c6 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:42 +0200 Subject: [PATCH 20/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/energyIntakeSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/energyIntakeSeries.json b/services/ontology/schemas/energyIntakeSeries.json index 0ca11076b..50f794f32 100644 --- a/services/ontology/schemas/energyIntakeSeries.json +++ b/services/ontology/schemas/energyIntakeSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 654d7989ca2b2a7bc86cd9c25df87ec5e25f5b0d Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:44 +0200 Subject: [PATCH 21/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/environmentalAudioSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/environmentalAudioSeries.json b/services/ontology/schemas/environmentalAudioSeries.json index 9e348a5e5..3af009376 100644 --- a/services/ontology/schemas/environmentalAudioSeries.json +++ b/services/ontology/schemas/environmentalAudioSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 90752d32f8706605e3bb4b93e4f06128dd841a51 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:46 +0200 Subject: [PATCH 22/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/exerciseMinutesSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/exerciseMinutesSeries.json b/services/ontology/schemas/exerciseMinutesSeries.json index ad264ac9b..182330c12 100644 --- a/services/ontology/schemas/exerciseMinutesSeries.json +++ b/services/ontology/schemas/exerciseMinutesSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From b6ff019afcf423eef4733159e1a673484267c71b Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:47 +0200 Subject: [PATCH 23/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/fatIntakeSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/fatIntakeSeries.json b/services/ontology/schemas/fatIntakeSeries.json index 8c056585c..f096da841 100644 --- a/services/ontology/schemas/fatIntakeSeries.json +++ b/services/ontology/schemas/fatIntakeSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 3643e1b2269b853f68213c90525d15b0073d7778 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:49 +0200 Subject: [PATCH 24/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/flightsClimbedSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/flightsClimbedSeries.json b/services/ontology/schemas/flightsClimbedSeries.json index edf2024ff..429050d07 100644 --- a/services/ontology/schemas/flightsClimbedSeries.json +++ b/services/ontology/schemas/flightsClimbedSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 0818ab7e552d1e5e98edc03f5a50d9a4f801e86b Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:50 +0200 Subject: [PATCH 25/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/headphoneAudioSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/headphoneAudioSeries.json b/services/ontology/schemas/headphoneAudioSeries.json index b2329b155..072b5ba0b 100644 --- a/services/ontology/schemas/headphoneAudioSeries.json +++ b/services/ontology/schemas/headphoneAudioSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From b76100fdb16852f046734ea8d041adba787e9f5c Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:52 +0200 Subject: [PATCH 26/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/healthPhoto.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/healthPhoto.json b/services/ontology/schemas/healthPhoto.json index 032732e95..13e14881b 100644 --- a/services/ontology/schemas/healthPhoto.json +++ b/services/ontology/schemas/healthPhoto.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 33cf12155f5b24cb2aeeb4b73b7a5e05ae69db3c Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:53 +0200 Subject: [PATCH 27/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/heartRateSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/heartRateSeries.json b/services/ontology/schemas/heartRateSeries.json index 988c9e34c..75b570477 100644 --- a/services/ontology/schemas/heartRateSeries.json +++ b/services/ontology/schemas/heartRateSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From e976bf8394bede0208dc6ebb6c5926b8621739e4 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:55 +0200 Subject: [PATCH 28/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/heartRateVariabilitySeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/heartRateVariabilitySeries.json b/services/ontology/schemas/heartRateVariabilitySeries.json index 3430bcd62..20d11da3d 100644 --- a/services/ontology/schemas/heartRateVariabilitySeries.json +++ b/services/ontology/schemas/heartRateVariabilitySeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 9ca2538b7b46b71cbb7b99f47231f19c905596c7 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:57 +0200 Subject: [PATCH 29/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/heightObservation.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/heightObservation.json b/services/ontology/schemas/heightObservation.json index 18d1c8315..d8f212022 100644 --- a/services/ontology/schemas/heightObservation.json +++ b/services/ontology/schemas/heightObservation.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 785965f3e69804e79fed331354e6f1f8f4035c55 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:58 +0200 Subject: [PATCH 30/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/leanBodyMassObservation.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/leanBodyMassObservation.json b/services/ontology/schemas/leanBodyMassObservation.json index 0a5c5a0bf..651827957 100644 --- a/services/ontology/schemas/leanBodyMassObservation.json +++ b/services/ontology/schemas/leanBodyMassObservation.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From d4fcdd84ea0270768facb5da4c7577074d3d5e59 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:32:59 +0200 Subject: [PATCH 31/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/meal.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/meal.json b/services/ontology/schemas/meal.json index 057348648..ad10ff7d6 100644 --- a/services/ontology/schemas/meal.json +++ b/services/ontology/schemas/meal.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 3dcd244d09c8a9561d353c7441f5f78cd608fce4 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:01 +0200 Subject: [PATCH 32/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/oxygenSaturationSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/oxygenSaturationSeries.json b/services/ontology/schemas/oxygenSaturationSeries.json index 0499b573b..9191e4b9b 100644 --- a/services/ontology/schemas/oxygenSaturationSeries.json +++ b/services/ontology/schemas/oxygenSaturationSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 66b363f2256e267449c50039b300812eb45061a1 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:02 +0200 Subject: [PATCH 33/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/proteinIntakeSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/proteinIntakeSeries.json b/services/ontology/schemas/proteinIntakeSeries.json index 982f24311..4d2664972 100644 --- a/services/ontology/schemas/proteinIntakeSeries.json +++ b/services/ontology/schemas/proteinIntakeSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 58a922e7c324cbaa9a2023dd056b369de1cbc761 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:04 +0200 Subject: [PATCH 34/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/respiratoryRateSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/respiratoryRateSeries.json b/services/ontology/schemas/respiratoryRateSeries.json index 65bc76801..7ac31784a 100644 --- a/services/ontology/schemas/respiratoryRateSeries.json +++ b/services/ontology/schemas/respiratoryRateSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From d6613a16239a20eefa9ac0431aedb54b76a7640c Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:05 +0200 Subject: [PATCH 35/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/restingHeartRateObservation.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/restingHeartRateObservation.json b/services/ontology/schemas/restingHeartRateObservation.json index 41909f1b0..0d64f069e 100644 --- a/services/ontology/schemas/restingHeartRateObservation.json +++ b/services/ontology/schemas/restingHeartRateObservation.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 0d7983754f529a2db670145ebab03a31b1592b27 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:07 +0200 Subject: [PATCH 36/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/skinTypeFact.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/skinTypeFact.json b/services/ontology/schemas/skinTypeFact.json index 6b9576a38..8501f1ae5 100644 --- a/services/ontology/schemas/skinTypeFact.json +++ b/services/ontology/schemas/skinTypeFact.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 7c62485de2123e8d5c83b01f65ca4bc3364ea05e Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:09 +0200 Subject: [PATCH 37/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/sleepSession.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/sleepSession.json b/services/ontology/schemas/sleepSession.json index dbe56af69..5cfd6b1cb 100644 --- a/services/ontology/schemas/sleepSession.json +++ b/services/ontology/schemas/sleepSession.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 0ad4626af6bf8309a629d8c134754a097dad9fb5 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:11 +0200 Subject: [PATCH 38/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/standMinutesSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/standMinutesSeries.json b/services/ontology/schemas/standMinutesSeries.json index 42509941a..b36515f5b 100644 --- a/services/ontology/schemas/standMinutesSeries.json +++ b/services/ontology/schemas/standMinutesSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 06e6ec8c73e78c58feb2aec2a214f40db11709df Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:12 +0200 Subject: [PATCH 39/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/stepLengthSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/stepLengthSeries.json b/services/ontology/schemas/stepLengthSeries.json index 6b168116c..2a922594c 100644 --- a/services/ontology/schemas/stepLengthSeries.json +++ b/services/ontology/schemas/stepLengthSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From b4598301db772c19a8ce8234c2679304c9890db2 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:14 +0200 Subject: [PATCH 40/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/stepSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/stepSeries.json b/services/ontology/schemas/stepSeries.json index 1e9394c17..c88328648 100644 --- a/services/ontology/schemas/stepSeries.json +++ b/services/ontology/schemas/stepSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From c1380cffa3a95687dbb23174c5b77b968090cf71 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:15 +0200 Subject: [PATCH 41/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- .../ontology/schemas/vo2MaxObservation.json | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 services/ontology/schemas/vo2MaxObservation.json diff --git a/services/ontology/schemas/vo2MaxObservation.json b/services/ontology/schemas/vo2MaxObservation.json new file mode 100644 index 000000000..18cdcdb54 --- /dev/null +++ b/services/ontology/schemas/vo2MaxObservation.json @@ -0,0 +1,76 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "schemaId": "49efc0c5-2851-4e3c-8759-957d11427edf", + "title": "VO2MaxObservation", + "description": "One spot measurement of VO2Max = one envelope. Canonical unit: mL/kg/min.", + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "@-prefixed eName of the person this data is about" + }, + "device": { + "type": [ + "string", + "null" + ], + "description": "w3id (@eName) of the measuring device's OWN eVault, where its Device passport lives; null if unknown" + }, + "provenance": { + "type": "object", + "description": "Import provenance. Vendor identity lives HERE only (source), never in metric keys.", + "properties": { + "source": { + "type": "string" + }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, + "externalId": { + "type": "string" + }, + "sourceName": { + "type": "string" + }, + "deviceSignature": { + "type": "string" + } + }, + "required": [ + "source" + ] + }, + "dedupKey": { + "type": "string", + "description": "Writer's idempotency key, unique within this ontology on the vault" + }, + "contentHash": { + "type": "string", + "description": "Writer-maintained md5 of the payload; recomputed on every rewrite" + }, + "updatedAt": { + "type": "string" + }, + "value": { + "type": "number" + }, + "unit": { + "type": "string", + "const": "mL/kg/min" + }, + "measuredAt": { + "type": "string", + "description": "ISO 8601 with offset" + } + }, + "required": [ + "subject", + "provenance", + "dedupKey", + "contentHash", + "value", + "unit", + "measuredAt" + ] +} From f79effadd14ca80fd533eff09e6ba2b47949bfec Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:17 +0200 Subject: [PATCH 42/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/walkingAsymmetrySeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/walkingAsymmetrySeries.json b/services/ontology/schemas/walkingAsymmetrySeries.json index e3733fa12..219c689ec 100644 --- a/services/ontology/schemas/walkingAsymmetrySeries.json +++ b/services/ontology/schemas/walkingAsymmetrySeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From a6112c57f3eb321c4672ff9a4963613ae6ce94a1 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:18 +0200 Subject: [PATCH 43/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/walkingDoubleSupportSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/walkingDoubleSupportSeries.json b/services/ontology/schemas/walkingDoubleSupportSeries.json index 01e2043d2..f9dc10233 100644 --- a/services/ontology/schemas/walkingDoubleSupportSeries.json +++ b/services/ontology/schemas/walkingDoubleSupportSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 31d9fa291a92f19d19fed9bca2834aee333b2cb6 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:20 +0200 Subject: [PATCH 44/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/walkingHeartRateObservation.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/walkingHeartRateObservation.json b/services/ontology/schemas/walkingHeartRateObservation.json index 0ce43b1a2..d7a5a3a45 100644 --- a/services/ontology/schemas/walkingHeartRateObservation.json +++ b/services/ontology/schemas/walkingHeartRateObservation.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From bf1ef179b7cb6710172c8f3132205860a0ff6f11 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:21 +0200 Subject: [PATCH 45/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/walkingRunningDistanceSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/walkingRunningDistanceSeries.json b/services/ontology/schemas/walkingRunningDistanceSeries.json index d21b3865a..8ea6dea59 100644 --- a/services/ontology/schemas/walkingRunningDistanceSeries.json +++ b/services/ontology/schemas/walkingRunningDistanceSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From f9060b074502e3b8d50a33263232d97a80252433 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:23 +0200 Subject: [PATCH 46/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/walkingSpeedSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/walkingSpeedSeries.json b/services/ontology/schemas/walkingSpeedSeries.json index 7ddf80368..644122719 100644 --- a/services/ontology/schemas/walkingSpeedSeries.json +++ b/services/ontology/schemas/walkingSpeedSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 690b082f0315131f1eeb1ac9de8882b7dadddb2a Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:24 +0200 Subject: [PATCH 47/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/waterIntakeSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/waterIntakeSeries.json b/services/ontology/schemas/waterIntakeSeries.json index 152502020..dd75c26f7 100644 --- a/services/ontology/schemas/waterIntakeSeries.json +++ b/services/ontology/schemas/waterIntakeSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From 298e913a22e937d426802e9d55e8614f601f4a2b Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:26 +0200 Subject: [PATCH 48/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/wheelchairUseFact.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/wheelchairUseFact.json b/services/ontology/schemas/wheelchairUseFact.json index 6c0471a9e..933acb0c4 100644 --- a/services/ontology/schemas/wheelchairUseFact.json +++ b/services/ontology/schemas/wheelchairUseFact.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From ca84c14002541d36f999d4cd47a1e6a45171ef02 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:27 +0200 Subject: [PATCH 49/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/workout.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/workout.json b/services/ontology/schemas/workout.json index 83fb0ca1a..915883e6f 100644 --- a/services/ontology/schemas/workout.json +++ b/services/ontology/schemas/workout.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" }, From af98b4f5a2733d986663e4329a6980d0798d9544 Mon Sep 17 00:00:00 2001 From: Egor Yakovlev Date: Wed, 29 Jul 2026 23:33:29 +0200 Subject: [PATCH 50/50] Add provenance.platform (machine-readable authorship) to all health ontologies --- services/ontology/schemas/wristTemperatureSeries.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ontology/schemas/wristTemperatureSeries.json b/services/ontology/schemas/wristTemperatureSeries.json index af1fe4833..10b5f7702 100644 --- a/services/ontology/schemas/wristTemperatureSeries.json +++ b/services/ontology/schemas/wristTemperatureSeries.json @@ -23,6 +23,10 @@ "source": { "type": "string" }, + "platform": { + "type": "string", + "description": "w3id (@eName) of the platform that wrote this envelope — machine-readable authorship; resolve it to read that platform's self-description" + }, "externalId": { "type": "string" },