# dev.sensorthings.datastream

> Published by [sensorthings.dev](https://lexicon.garden/identity/did:plc:gqcmwsromoknyigx2afqcvqk)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:gqcmwsromoknyigx2afqcvqk/dev.sensorthings.datastream)
- [Documentation](https://lexicon.garden/lexicon/did:plc:gqcmwsromoknyigx2afqcvqk/dev.sensorthings.datastream/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:gqcmwsromoknyigx2afqcvqk/dev.sensorthings.datastream/examples)

## Definitions

### `dev.sensorthings.datastream`

**Type**: `record`

Groups Observations of one ObservedProperty by one Sensor on one Thing. Carries all context needed to interpret observation results.

**Key**: `any`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes |  |
| `thing` | `string` (at-uri) | Yes | AT-URI of the dev.sensorthings.thing record |
| `sensor` | `string` (at-uri) | Yes | AT-URI of the dev.sensorthings.sensor record |
| `createdAt` | `string` (datetime) | Yes |  |
| `description` | `string` | No |  |
| `observedArea` | `ref` → `dev.sensorthings.thing#geoPoint` | No | Representative location for the datastream |
| `verticalDatum` | `string` | No | Vertical datum reference for water level or elevation measurements. Either a URI (e.g. http://www.opengis.net/def/crs/EPSG/0/5731 for Malin Head) or a human-readable identifier (e.g. 'Chart Datum', 'local-gauge-zero'). Absent for non-vertical measurements. |
| `observationType` | `string` (uri) | Yes | O&M observation type URI, e.g. http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement |
| `observedProperty` | `string` (at-uri) | Yes | AT-URI of the dev.sensorthings.observedProperty record |
| `resultScaleFactor` | `integer` | No | 10^n divisor for numeric results. E.g. 2 means observation integers are in centi-units (÷100). Default 0. Only meaningful for numericResult and arrayResult types. |
| `unitOfMeasurement` | `ref` → `#unitOfMeasurement` | Yes |  |

### `dev.sensorthings.datastream#unitOfMeasurement`

**Type**: `object`

UCUM-compatible unit description.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes |  |
| `symbol` | `string` | Yes |  |
| `definition` | `string` (uri) | No | URI from QUDT, UCUM, or similar unit ontology |

## Raw Schema

```json
{
  "id": "dev.sensorthings.datastream",
  "defs": {
    "main": {
      "key": "any",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "name",
          "thing",
          "sensor",
          "observedProperty",
          "unitOfMeasurement",
          "observationType",
          "createdAt"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 256
          },
          "thing": {
            "type": "string",
            "format": "at-uri",
            "description": "AT-URI of the dev.sensorthings.thing record"
          },
          "sensor": {
            "type": "string",
            "format": "at-uri",
            "description": "AT-URI of the dev.sensorthings.sensor record"
          },
          "createdAt": {
            "type": "string",
            "format": "datetime"
          },
          "description": {
            "type": "string",
            "maxLength": 2048
          },
          "observedArea": {
            "ref": "dev.sensorthings.thing#geoPoint",
            "type": "ref",
            "description": "Representative location for the datastream"
          },
          "verticalDatum": {
            "type": "string",
            "maxLength": 256,
            "description": "Vertical datum reference for water level or elevation measurements. Either a URI (e.g. http://www.opengis.net/def/crs/EPSG/0/5731 for Malin Head) or a human-readable identifier (e.g. 'Chart Datum', 'local-gauge-zero'). Absent for non-vertical measurements."
          },
          "observationType": {
            "type": "string",
            "format": "uri",
            "description": "O&M observation type URI, e.g. http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement"
          },
          "observedProperty": {
            "type": "string",
            "format": "at-uri",
            "description": "AT-URI of the dev.sensorthings.observedProperty record"
          },
          "resultScaleFactor": {
            "type": "integer",
            "description": "10^n divisor for numeric results. E.g. 2 means observation integers are in centi-units (÷100). Default 0. Only meaningful for numericResult and arrayResult types."
          },
          "unitOfMeasurement": {
            "ref": "#unitOfMeasurement",
            "type": "ref"
          }
        }
      },
      "description": "Groups Observations of one ObservedProperty by one Sensor on one Thing. Carries all context needed to interpret observation results."
    },
    "unitOfMeasurement": {
      "type": "object",
      "required": [
        "name",
        "symbol"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 128
        },
        "symbol": {
          "type": "string",
          "maxLength": 32
        },
        "definition": {
          "type": "string",
          "format": "uri",
          "description": "URI from QUDT, UCUM, or similar unit ontology"
        }
      },
      "description": "UCUM-compatible unit description."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
