vocab

package
v0.0.0-...-a67a4a9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package vocab with WoST iotschema vocabulary for sensor, actuator and unitname names TODO: base this of a universally accepted ontology. Closest is iotschema.org but that seems incomplete

Package vocab with WoT and JSON-LD defined vocabulary

Index

Constants

View Source
const (
	PropNameAcceleration           string = "acceleration"
	PropNameAddress                string = "address" // device domain or ip address
	PropNameAirQuality             string = "airQuality"
	PropNameAlarm                  string = "alarm"
	PropNameAtmosphericPressure    string = "atmosphericPressure"
	PropNameBatch                  string = "batch" // Batch publishing size
	PropNameBattery                string = "battery"
	PropNameCarbonDioxideLevel     string = "co2level"
	PropNameCarbonMonoxideDetector string = "coDetector"
	PropNameCarbonMonoxideLevel    string = "coLevel"
	PropNameChannel                string = "avChannel"
	PropNameColor                  string = "color" // Color in hex notation
	PropNameColorTemperature       string = "colorTemperature"
	PropNameConnections            string = "connections"
	PropNameCPULevel               string = "cpuLevel"
	PropNameDateTime               string = "dateTime"    //
	PropNameDescription            string = "description" // Device description
	PropNameDeviceType             string = "deviceType"  // Device type from list below
	PropNameDewpoint               string = "dewpoint"
	PropNameDimmer                 string = "dimmer"
	PropNameDisabled               string = "disabled" // device or sensor is disabled
	PropNameDoorWindowSensor       string = "doorWindowSensor"
	PropNameElectricCurrent        string = "current"
	PropNameElectricEnergy         string = "energy"
	PropNameElectricPower          string = "power"
	PropNameErrors                 string = "errors"
	PropNameEvent                  string = "event" // Enable/disable event publishing
	//
	PropNameFilename       string = "filename"       // [string] filename to write images or other values to
	PropNameGatewayAddress string = "gatewayAddress" // [string] the 3rd party gateway address
	PropNameHostname       string = "hostname"       // [string] network device hostname
	PropNameHeatIndex      string = "heatindex"      // [number] unit=C or F
	PropNameHue            string = "hue"            //
	PropNameHumidex        string = "humidex"        // [number] unit=C or F
	PropNameHumidity       string = "humidity"       // [string] %
	PropNameImage          string = "image"          // [byteArray] unit=jpg,gif,png
	PropNameLatency        string = "latency"        // [number] sec, msec
	PropNameLatitude       string = "latitude"       // [number]
	PropNameLatLon         string = "latlon"         // [number,number] latitude, longitude pair of the device for display on a map r/w
	PropNameLevel          string = "level"          // [number] generic sensor level
	PropNameLongitude      string = "longitude"      // [number]
	PropNameLocalIP        string = "localIP"        // [string] for IP nodes
	PropNameLocation       string = "location"       // [string]
	PropNameLocationName   string = "locationName"   // [string] name of a location
	PropNameLock           string = "lock"           //
	PropNameLoginName      string = "loginName"      // [string] login name to connect to the device. Value is not published
	PropNameLuminance      string = "luminance"      // [number]
	PropNameMAC            string = "mac"            // [string] MAC address for IP nodes
	PropNameManufacturer   string = "manufacturer"   // [string] device manufacturer
	PropNameMax            string = "max"            // [number] maximum value of sensor or config
	PropNameMin            string = "min"            // [number] minimum value of sensor or config
	PropNameModel          string = "model"          // [string] device model
	PropNameMotion         string = "motion"         // [boolean]
	PropNameMute           string = "avMute"         // [boolean]
	PropNameName           string = "name"           // [string] Name of device or service
	PropNameNetmask        string = "netmask"        // [string] IP network mask
	PropNameOnOffSwitch    string = "switch"         // [boolean]
	//
	PropNamePassword          string = "password" // password to connect. Value is not published.
	PropNamePlay              string = "avPlay"
	PropNamePollInterval      string = "pollInterval" // polling interval in seconds
	PropNamePort              string = "port"         // network address port
	PropNamePowerSource       string = "powerSource"  // battery, usb, mains
	PropNameProduct           string = "product"      // device product or model name
	PropNamePublicKey         string = "publicKey"    // public key for encrypting sensitive configuration settings
	PropNamePushButton        string = "pushButton"   // with nr of pushes
	PropNameRain              string = "rain"
	PropNameRelay             string = "relay"
	PropNameSaturation        string = "saturation"
	PropNameScale             string = "scale"
	PropNameSignalStrength    string = "signalStrength"
	PropNameSmokeDetector     string = "smokeDetector"
	PropNameSnow              string = "snow"
	PropNameSoftwareVersion   string = "softwareVersion" // version of the software running the node
	PropNameSoundDetector     string = "soundDetector"
	PropNameSubnet            string = "subnet" // IP subnets configuration
	PropNameSwitch            string = "switch" // on/off switch: "on" "off"
	PropNameTemperature       string = "temperature"
	PropNameTitle             string = "title" // device title
	PropNameUltraviolet       string = "ultraviolet"
	PropNameUnknown           string = ""    // Not a known output
	PropNameURL               string = "url" // node URL
	PropNameVibrationDetector string = "vibrationDetector"
	PropNameValue             string = "value" // generic value
	PropNameVoltage           string = "voltage"
	PropNameVolume            string = "volume"
	PropNameWaterLevel        string = "waterLevel"
	PropNameWeather           string = "weather" // description of weather, eg sunny
	PropNameWindHeading       string = "windHeading"
	PropNameWindSpeed         string = "windSpeed"
)

Vocabulary attribute and configuration property names to be used by Things and plugins.

View Source
const (
	UnitNameNone            string = ""
	UnitNameAmp             string = "A"
	UnitNameCelcius         string = "C"
	UnitNameCandela         string = "cd"
	UnitNameCount           string = "#"
	UnitNameDegree          string = "Degree"
	UnitNameFahrenheit      string = "F"
	UnitNameFeet            string = "ft"
	UnitNameGallon          string = "Gal"
	UnitNameJpeg            string = "jpeg"
	UnitNameKelvin          string = "K"
	UnitNameKmPerHour       string = "Kph"
	UnitNameLiter           string = "L"
	UnitNameMercury         string = "hg"
	UnitNameMeter           string = "m"
	UnitNameMetersPerSecond string = "m/s"
	UnitNameMilesPerHour    string = "mph"
	UnitNameMillibar        string = "mbar"
	UnitNameMole            string = "mol"
	UnitNamePartsPerMillion string = "ppm"
	UnitNamePng             string = "png"
	UnitNameKWH             string = "KWh"
	UnitNameKG              string = "kg"
	UnitNameLux             string = "lux"
	UnitNamePascal          string = "Pa"
	UnitNamePercent         string = "%"
	UnitNamePounds          string = "lbs"
	UnitNameSpeed           string = "m/s"
	UnitNamePSI             string = "psi"
	UnitNameSecond          string = "s"
	UnitNameVolt            string = "V"
	UnitNameWatt            string = "W"
)

TODO: Match with UN/CEFACT unitname codes as defined in:

https://www.unece.org/cefact.html
location codes: https://www.unece.org/cefact/locode/service/location.html

UnitNameXyz defines constants with input and output unitname names.

View Source
const (
	WoTAtType       = "@type"
	WoTAtContext    = "@context"
	WoTAnyURI       = "https://www.w3.org/2019/wot/thing/v1"
	WoTActions      = "actions"
	WoTCreated      = "created"
	WoTDescription  = "description"
	WoTDescriptions = "descriptions"
	WoTEvents       = "events"
	WoTForms        = "forms"
	WoTID           = "id"
	WoTLinks        = "links"
	WoTModified     = "modified"
	WoTProperties   = "properties"
	WoTSecurity     = "security"
	WoTSupport      = "support"
	WoTTitle        = "title"
	WoTTitles       = "titles"
	WoTVersion      = "version"
)

Core vocabulary definitions See https://www.w3.org/TR/2020/WD-wot-thing-description11-20201124/#sec-core-vocabulary-definition Thing, dataschema Vocabulary

View Source
const (
	WoTConst            = "const"
	WoTDataType         = "type"
	WoTDataTypeAnyURI   = "anyURI" // simple type
	WoTDataTypeArray    = "array"
	WoTDataTypeBool     = "boolean"  // simple type
	WoTDataTypeDateTime = "dateTime" // ISO8601: YYYY-MM-DDTHH:MM:SS.sss[-TZ|+TZ|z]

	WoTDataTypeInteger     = "integer"     // simple type
	WoTDataTypeUnsignedInt = "unsignedInt" // simple type
	WoTDataTypeNumber      = "number"
	WoTDataTypeObject      = "object"
	WoTDataTypeString      = "string" // simple type
	// WoTDouble              = "double" // min, max of number are doubles
	WoTEnum      = "enum"
	WoTFormat    = "format"
	WoTHref      = "href"
	WoTInput     = "input"
	WoTMaximum   = "maximum"
	WoTMaxItems  = "maxItems"
	WoTMaxLength = "maxLength"
	WoTMinimum   = "minimum"
	WoTMinItems  = "minItems"
	WoTMinLength = "minLength"
	WoTOperation = "op"
	WoTOutput    = "output"
	WoTReadOnly  = "readOnly"
	WoTRequired  = "required"
	WoTWriteOnly = "writeOnly"
	WoTUnit      = "unit"
)

additional data schema vocab

View Source
const (
	WoTNoSecurityScheme     = "NoSecurityScheme"
	WoTBasicSecurityScheme  = "BasicSecurityScheme"
	WoTDigestSecurityScheme = "DigestSecurityScheme"
	WoTAPIKeySecurityScheme = "APIKeySecurityScheme"
	WoTBearerSecurityScheme = "BearerSecurityScheme"
	WoTPSKSecurityScheme    = "PSKSecurityScheme"
	WoTOAuth2SecurityScheme = "OAuth2SecurityScheme"
)

additional security schemas Intended for use by Hub services. WoST devices don't need them as they don't run a server

View Source
const TimeFormat = "2006-01-02T15:04:05.000-0700"

TimeFormat using standard ISO8601

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceType

type DeviceType string

DeviceType identifying the purpose of the device

const (
	DeviceTypeAlarm          DeviceType = "alarm"          // an alarm emitter
	DeviceTypeAVControl      DeviceType = "avControl"      // Audio/Video controller
	DeviceTypeAVReceiver     DeviceType = "avReceiver"     // Node is a (not so) smart radio/receiver/amp (eg, denon)
	DeviceTypeBeacon         DeviceType = "beacon"         // device is a location beacon
	DeviceTypeButton         DeviceType = "button"         // device is a physical button device with one or more buttons
	DeviceTypeAdapter        DeviceType = "adapter"        // software adapter or service, eg virtual device
	DeviceTypePhone          DeviceType = "phone"          // device is a phone
	DeviceTypeCamera         DeviceType = "camera"         // Node with camera
	DeviceTypeComputer       DeviceType = "computer"       // General purpose computer
	DeviceTypeDimmer         DeviceType = "dimmer"         // light dimmer
	DeviceTypeGateway        DeviceType = "gateway"        // Node is a gateway for other nodes (onewire, zwave, etc)
	DeviceTypeKeypad         DeviceType = "keypad"         // Entry key pad
	DeviceTypeLock           DeviceType = "lock"           // Electronic door lock
	DeviceTypeMultisensor    DeviceType = "multisensor"    // Node with multiple sensors
	DeviceTypeNetRepeater    DeviceType = "netRepeater"    // Node is a zwave or other network repeater
	DeviceTypeNetRouter      DeviceType = "netRouter"      // Node is a network router
	DeviceTypeNetSwitch      DeviceType = "netSwitch"      // Node is a network switch
	DeviceTypeNetWifiAP      DeviceType = "wifiAP"         // Node is a wifi access point
	DeviceTypeOnOffSwitch    DeviceType = "onOffSwitch"    // Node is a physical on/off switch
	DeviceTypePowerMeter     DeviceType = "powerMeter"     // Node is a power meter
	DeviceTypeSensor         DeviceType = "sensor"         // Node is a single sensor (volt,...)
	DeviceTypeService        DeviceType = "service"        // Node provides a service
	DeviceTypeSmartlight     DeviceType = "smartlight"     // Node is a smart light, eg philips hue
	DeviceTypeThermometer    DeviceType = "thermometer"    // Node is a temperature meter
	DeviceTypeThermostat     DeviceType = "thermostat"     // Node is a thermostat control unit
	DeviceTypeTV             DeviceType = "tv"             // Node is a (not so) smart TV
	DeviceTypeUnknown        DeviceType = "unknown"        // type not identified
	DeviceTypeWallpaper      DeviceType = "wallpaper"      // Node is a wallpaper montage of multiple images
	DeviceTypeWaterValve     DeviceType = "waterValve"     // Water valve control unit
	DeviceTypeWeatherService DeviceType = "weatherService" // Node is a service providing current and forecasted weather
	DeviceTypeWeatherStation DeviceType = "weatherStation" // Node is a weatherstation device
	DeviceTypeWeighScale     DeviceType = "weighScale"     // Node is an electronic weight scale
)

Various Types of devices.

type ThingPropType

type ThingPropType string

ThingPropType with types of property that are defined

const (
	// PropertyTypeAttr is a readonly attribute describing the Thing
	PropertyTypeAttr ThingPropType = "wost:attr"
	// PropertyTypeConfig is a writable configuration
	PropertyTypeConfig ThingPropType = "wost:configuration"
	// PropertyTypeState is a readonly internal state
	PropertyTypeState ThingPropType = "wost:state"
	// PropertyTypeInput is an input (use in Actions)
	PropertyTypeInput ThingPropType = "wost:input"
	// PropertyTypeOutput is an output
	PropertyTypeOutput ThingPropType = "wost:output"
)

Since property types is not part of the WoT vocabulary they are defined as part of the WoST vocabulary. Used in "@type" for TD Properties.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL