From b75c91a4c7ead51cd747d3e110f4c53d39239333 Mon Sep 17 00:00:00 2001 From: Kevin Streeter Date: Tue, 8 Jan 2019 14:15:28 -0800 Subject: [PATCH] Revert "Issue 555 refactor measures to use descriptors" --- schemas/data/measure.description.md | 2 +- schemas/data/measure.example.1.json | 2 ++ schemas/data/measure.schema.json | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/schemas/data/measure.description.md b/schemas/data/measure.description.md index ba1491543a..cd5d23791c 100644 --- a/schemas/data/measure.description.md +++ b/schemas/data/measure.description.md @@ -1,3 +1,3 @@ A measure is a concrete quantifiable data point of a particular metric. -It has a value, and a unique identifier. +It has a value, and optionally a unit, although the unit can be inferred from the measure's metric. diff --git a/schemas/data/measure.example.1.json b/schemas/data/measure.example.1.json index 9bbf1db216..580aea0e7c 100644 --- a/schemas/data/measure.example.1.json +++ b/schemas/data/measure.example.1.json @@ -1,3 +1,5 @@ { + "@type": "https://ns.adobe.com/xdm/data/example-metric", + "xdm:unit": null, "xdm:value": 175 } diff --git a/schemas/data/measure.schema.json b/schemas/data/measure.schema.json index 1dfab4517d..9b56da2459 100644 --- a/schemas/data/measure.schema.json +++ b/schemas/data/measure.schema.json @@ -14,6 +14,12 @@ "definitions": { "measure": { "properties": { + "@type": { + "type": "string", + "format": "uri", + "description": + "Links to the `Metric` that this measure refers to. The `@type` can be omitted in contexts where it is obvious what metric is being referred to, for instance in the `Metrics` object that is keyed with `Metric` URIs." + }, "xdm:id": { "title": "Unique Identifier", "type": "string", @@ -23,6 +29,19 @@ "xdm:value": { "type": "number", "description": "The quantifiable value of this measure." + }, + "xdm:unit": { + "anyOf": [ + { + "type": "string" + }, + { + "const": null + } + ], + "description": + "The (optional) unit that this measure's value is measured in. The `unit` in the `Measure` is purely informational, as the `unit` property of the referenced `Metric` determines the interpretation.", + "examples": ["m", "kg", "s", "USD"] } } }