| Field | Value |
| Identifier | urn:obsp:schema:v3.1:observationrecord |
|---|
| Dialect | https://json-schema.org/draft/2020-12/schema |
|---|
| Used by functions | Describe, Observe, Qualify |
Properties
| Property | Required | Type | Description |
schemaVersion | yes | reference | |
observationUni | yes | reference | |
systemUni | yes | reference | |
observedProperty | yes | string | |
phenomenonTime | no | string | |
resultTime | yes | reference | |
validTime | no | string | |
geometry | no | object | |
unit | no | string | |
result | yes | object | array | string | number | boolean | null | Observation result value |
uncertainty | no | object | |
qualityFlags | no | array | |
evidenceRefs | yes | array | |
resultState | no | enumeration | Optional typed result state. Any state other than PRESENT carries a null result, never a zero. |
sensorPassportRef | no | reference | SensorPassport version in force for this observation (OBSP 0.1 section 5.3) |
timeQualityRef | no | reference | TimeQuality reported with this observation (OBSP 0.1 section 5.4) |
quality | no | array | Controlled quality flags with the test that set them (OBSP 0.1 section 5.6). qualityFlags (free strings) stays for backward compatibility. |
provenanceRef | no | reference | PROV-O provenance bundle (provenance.schema.json) |
extensions | no | reference | |
Positive fixtures
observation-record.missing-typed.valid.jsonobservation-record.obsp-fields.valid.jsonobservation-record.valid.json
Negative fixtures
observation-record.missing-as-zero.json: a MISSING result is null, never zeroobservation-record.missing-schemaversion.json: required at /: 'schemaVersion' is a required propertyobservation-record.quality-flag-without-test.json: a checked quality flag names its testobservation-record.sensor-passport-without-version.json: the sensor passport is referenced by version
Mappings to open standards
A mapping to a standard, never a conformance statement.
- maps to NS-3 Risk index record UNIs (relation REL-NS-3)
- maps to NRS-S11 System profile: instruments, sensors and calibration (OPS) (relation REL-NRS-S11)
- maps to NHS-1 Nexus Hazard Standard (relation REL-NHS-1)
- maps to NIS-1 Nexus Indicator Standard (relation REL-NIS-1)
- maps to RFC 3339 (date and time) (relation EXT-RFC3339)
- maps to W3C/OGC SOSA and SSN ontologies (relation EXT-SOSA)
- maps to OGC API - Features, proposed (OIP-0001)
- maps to OGC API - Environmental Data Retrieval (EDR), proposed (OIP-0001)
Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:obsp:schema:v3.1:observationrecord",
"title": "ObservationRecord",
"type": "object",
"required": [
"observationUni",
"systemUni",
"observedProperty",
"resultTime",
"result",
"evidenceRefs",
"schemaVersion"
],
"properties": {
"schemaVersion": {
"$ref": "#/$defs/SchemaVersion"
},
"observationUni": {
"$ref": "#/$defs/Uni"
},
"systemUni": {
"$ref": "#/$defs/Uni"
},
"observedProperty": {
"type": "string",
"minLength": 1
},
"phenomenonTime": {
"type": "string",
"minLength": 1
},
"resultTime": {
"$ref": "#/$defs/IsoDateTime"
},
"validTime": {
"type": "string",
"minLength": 1
},
"geometry": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"minLength": 1
},
"coordinates": true
},
"additionalProperties": true
},
"unit": {
"type": "string",
"minLength": 1
},
"result": {
"description": "Observation result value",
"type": [
"object",
"array",
"string",
"number",
"boolean",
"null"
]
},
"uncertainty": {
"type": "object",
"additionalProperties": {
"type": [
"string",
"number",
"boolean",
"integer"
]
}
},
"qualityFlags": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"evidenceRefs": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/$defs/EvidenceRef"
}
},
"resultState": {
"enum": [
"PRESENT",
"MISSING",
"NOT_OBSERVED",
"WITHHELD"
],
"description": "Optional typed result state. Any state other than PRESENT carries a null result, never a zero."
},
"sensorPassportRef": {
"$ref": "#/$defs/VersionedRecordRef",
"description": "SensorPassport version in force for this observation (OBSP 0.1 section 5.3)"
},
"timeQualityRef": {
"$ref": "#/$defs/RecordRef",
"description": "TimeQuality reported with this observation (OBSP 0.1 section 5.4)"
},
"quality": {
"type": "array",
"items": {
"$ref": "#/$defs/QualityFlagEntry"
},
"description": "Controlled quality flags with the test that set them (OBSP 0.1 section 5.6). qualityFlags (free strings) stays for backward compatibility."
},
"provenanceRef": {
"$ref": "#/$defs/RecordRef",
"description": "PROV-O provenance bundle (provenance.schema.json)"
},
"extensions": {
"$ref": "#/$defs/Extensions"
}
},
"allOf": [
{
"if": {
"properties": {
"resultState": {
"enum": [
"MISSING",
"NOT_OBSERVED",
"WITHHELD"
]
}
},
"required": [
"resultState"
]
},
"then": {
"properties": {
"result": {
"type": "null"
}
}
}
}
],
"$defs": {
"Uni": {
"type": "string",
"minLength": 8,
"maxLength": 256,
"pattern": "^[A-Za-z0-9][A-Za-z0-9:._/@-]{7,255}$",
"description": "Durable UNI or typed unresolved identifier according to authority rules"
},
"Digest": {
"type": "string",
"pattern": "^[a-z0-9]+:[A-Fa-f0-9]{32,128}$",
"description": "alg:hex digest"
},
"IsoDateTime": {
"type": "string",
"format": "date-time"
},
"NonEmptyString": {
"type": "string",
"minLength": 1,
"maxLength": 2048
},
"EvidenceRef": {
"type": "object",
"required": [
"uri",
"digest"
],
"properties": {
"uri": {
"type": "string",
"minLength": 1,
"maxLength": 4096
},
"digest": {
"$ref": "#/$defs/Digest"
},
"kind": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"recordedAt": {
"$ref": "#/$defs/IsoDateTime"
}
},
"additionalProperties": false
},
"StateVector": {
"type": "object",
"required": [
"implementationState",
"verificationState",
"operationalState",
"claimState",
"correctionState"
],
"properties": {
"implementationState": {
"enum": [
"NOT_STARTED",
"DECLARED",
"SCAFFOLDED",
"IMPLEMENTED",
"INTEGRATED"
]
},
"serviceState": {
"enum": [
"NOT_DEPLOYED",
"STARTING",
"AVAILABLE",
"DEGRADED",
"UNAVAILABLE"
]
},
"verificationState": {
"enum": [
"NOT_TESTED",
"TESTED",
"INTEGRATION_VERIFIED",
"INDEPENDENTLY_ASSESSED"
]
},
"operationalState": {
"enum": [
"NOT_OBSERVED",
"LAB_OBSERVED",
"PILOT_OBSERVED",
"PRODUCTION_OBSERVED"
]
},
"releaseState": {
"enum": [
"INTERNAL",
"LAB",
"PILOT",
"CONTROLLED_RELEASE",
"CONTROLLED_GA",
"RETIRED"
]
},
"claimState": {
"enum": [
"NOT_PERMITTED",
"QUALIFIED",
"PERMITTED_FOR_SCOPE"
]
},
"correctionState": {
"enum": [
"CURRENT",
"DISPUTED",
"SUPERSEDED",
"WITHDRAWN",
"RECALLED"
]
}
},
"additionalProperties": false
},
"Extensions": {
"type": "object",
"description": "Namespaced extension bag; unknown top-level fields remain forbidden.",
"propertyNames": {
"pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)+$"
},
"additionalProperties": true
},
"SchemaVersion": {
"type": "string",
"const": "3.1.0"
},
"RecordVersion": {
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]+){0,2}$"
},
"RecordRef": {
"type": "object",
"required": [
"uni",
"digest"
],
"properties": {
"uni": {
"$ref": "#/$defs/Uni"
},
"version": {
"$ref": "#/$defs/RecordVersion"
},
"digest": {
"$ref": "#/$defs/Digest"
}
},
"additionalProperties": false
},
"VersionedRecordRef": {
"type": "object",
"required": [
"uni",
"version",
"digest"
],
"properties": {
"uni": {
"$ref": "#/$defs/Uni"
},
"version": {
"$ref": "#/$defs/RecordVersion"
},
"digest": {
"$ref": "#/$defs/Digest"
}
},
"additionalProperties": false
},
"QualityFlagValue": {
"enum": [
"GOOD",
"SUSPECT",
"BAD",
"MISSING",
"ESTIMATED",
"NOT_CHECKED"
],
"description": "Controlled quality-flag vocabulary (OBSP 0.1 section 5.6, WMO-style)"
},
"TestCode": {
"type": "string",
"pattern": "^(RANGE|STEP|PERSISTENCE|SPIKE|CLIMATOLOGY|INTERNAL_CONSISTENCY|SPATIAL_CONSISTENCY|COMPLETENESS|TIME_INTEGRITY|CALIBRATION_VALIDITY|MANUAL_REVIEW|GAP_FILL_MODEL)$|^LOCAL\\.[a-z0-9-]+\\.[A-Z][A-Z0-9_]{1,63}$",
"description": "Quality-control test that set the flag: a controlled WMO-style code, or LOCAL.<namespace>.<CODE> for a registered local test"
},
"QualityFlagEntry": {
"type": "object",
"required": [
"flag"
],
"properties": {
"flag": {
"$ref": "#/$defs/QualityFlagValue"
},
"testCode": {
"$ref": "#/$defs/TestCode"
},
"testVersion": {
"type": "string",
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+([-+][0-9A-Za-z.-]+)?$"
},
"setAt": {
"$ref": "#/$defs/IsoDateTime"
}
},
"additionalProperties": false,
"if": {
"properties": {
"flag": {
"const": "NOT_CHECKED"
}
},
"required": [
"flag"
]
},
"then": {
"not": {
"anyOf": [
{
"required": [
"testCode"
]
},
{
"required": [
"testVersion"
]
}
]
}
},
"else": {
"required": [
"testCode",
"testVersion"
]
},
"description": "Inline form of quality-flag.schema.json: NOT_CHECKED carries no test; every other flag names its test and test version"
}
},
"additionalProperties": false
}