# Configuration File

An OSH hub is configured with a single JSON file that includes parameters for all modules loaded on the hub.

# Common Config Parameters

Each module configuration contains a common set of parameters that are described below:

  • objClass: The class of the configuration object itself (needed for deserialization)
  • id: Local ID of the module instance
  • name: Name of the module instance
  • description: Description of the module instance
  • moduleClass: The class of the module to instantiate
  • autoStart: Boolean flag indicating if the module should be automatically started when the hub starts

Any other parameter is specific to the module and should be described in the module documentation.

# System Drivers Configuration

System drivers share some common configuration properties inherited from the SensorConfig class:

  • sensorML: URL pointing to a SensorML file describing the sensor characteristics (the content of the file will be merged with information generated automatically by the framework, see below)

  • lastUpdated: The date at which the SensorML description generated by the driver starts to be valid. Note that everytime this value is changed (or the validTime in the SensorML document is manually updated), the procedure description is versioned in OSH data stores.

The rules for merging an external SensorML file are as follow:

  • Input, output and taskable parameter descriptors generated by the driver code will always override the ones provided in the external SensorML description referenced by the sensorML property
  • If not provided in the external SensorML file, a validTime is generated using the lastUpdated config property. In this case, the validity period starts at the specified time stamp and ends 'now'
  • If not provided in the external SensorML file, the module name is used as the process name in the generated SensorML description.
  • If not provided in the external SensorML file, the module description is used as the process description in the generated SensorML description.

# Datastore Identifiers

The federated database needs each storage module deployed on an OSH hub to be assigned a unique number (in the hub scope) in order to generate unambiguous resource IDs.

A common configuration field called databaseNum is shared by all modules implementing data stores. The configuration of each storage module must set a different positive integer number to this field or the hub won't start.

# Database View Filters

Many modules make use of filtered views to select only a subset of the data available on an OSH hub.

In particular, filtered views are used to select what observations are exposed to external consumers via APIs or web services or data push clients. All modules maintained by the core team share a common exposedResources property that takes a ObsFilter object or, for the sake of simplicity, directly a DataStreamFilter or SystemFilter.

Example filters:

Expose observations from all procedures with matching UIDs (exact match or prefix match):

includeFilter": {
  "objClass": "org.sensorhub.api.datastore.system.SystemFilter",
  "uniqueIDs": [
    "urn:osh:sensor:simgps:d136b6ea",
    "urn:osh:sensor:simweather:0123456879",
    "urn:osh:sensor:v4l-cam:*"
  ]
}

Expose observations from all datastreams with given observed properties URI:

includeFilter": {
  "objClass": "org.sensorhub.api.datastore.obs.DataStreamFilter",
  "observedProperties": [
    "http://mmisw.org/ont/cf/parameter/air_temperature",
    "http://mmisw.org/ont/cf/parameter/air_pressure"
  ]
}

Expose observations from selected procedures but only for a specific time period:

"includeFilter": {
  "objClass": "org.sensorhub.api.datastore.obs.ObsFilter",
  "phenomenonTime": {
    "during": [
      "2020-03-25Z",
      "2020-04-17Z"
    ]
  },
  "withDatastreams": {
    "objClass": "org.sensorhub.api.datastore.obs.DataStreamFilter",
    "withSystems": {
      "objClass": "org.sensorhub.api.datastore.system.SystemFilter",
      "uniqueIDs": [
        "urn:osh:sensor:simgps:d136b6ea",
        "urn:osh:sensor:simweather:0123456879"
      ]
    }
  }
}

Expose only the latest observations from all datastreams:

"includeFilter": {
  "objClass": "org.sensorhub.api.datastore.obs.ObsFilter",
  "phenomenonTime": {
    "indeterminate": "current"
  }
}
Last Updated: 10/13/2021, 10:18:26 PM