Open Messaging Interface (O-MI), an Open Group Internet of Things (IoT) Standard – O-MI and XML Schema

 

All O-MI messages (both requests and responses) have an outermost element named “omiEnvelope”. The omiEnvelope defines the version of the O-MI used and the TTL of the message.

The rest of this appendix has been generated from the XML schema “omi.xsd”. The code generation options “Attributes” and “Source code” have been omitted.

Schema omi.xsd

Schema Location:

C:\Users\kary\OpenGroup\Open Messaging Interface\omi.xsd

attributeFormDefault:

Unqualified

elementFormDefault:

Qualified

targetNamespace:

omi.xsd

 

Elements

Complex Types

Simple Types

msg

cancelRequest

schemaID

omiEnvelope

idType

 

 

nodesType

 

 

readRequest

 

 

requestBaseType

 

 

requestResultType

 

 

responseListType

 

 

returnType

 

 

writeRequest

 

element msg

Diagram for element msg

namespace

omi.xsd

used by

complexTypes: requestBaseType requestResultType

element omiEnvelope

Diagram for element omiEnvelope

namespace

omi.xsd

properties

content: complex

children

read write response cancel

used by

complexType: requestResultType

annotation

documentation: Root element of Open Messaging Interface

attribute omiEnvelope/@version

type

restriction of xs:string

properties

use: required

annotation

documentation: Open Messaging Interface schema version that the message complies with

attribute omiEnvelope/@ttl

type

restriction of xs:double

properties

use: required

facets

kind: minInclusive

value: –1

annotation: –1

annotation

documentation: Time-to-live in seconds. “–1” signifies “forever”.

element omiEnvelope/read

Diagram for element omiEnvelope/read

namespace

omi.xsd

type

readRequest

properties

content: complex

children

nodeList requestID msg

element omiEnvelope/write

Diagram for element omiEnvelope/write

namespace

omi.xsd

type

writeRequest

properties

content: complex

children

nodeList requestID msg

element omiEnvelope/response

Diagram for element omiEnvelope/response

namespace

omi.xsd

type

responseListType

properties

content: complex

children

result

element omiEnvelope/cancel

Diagram for element omiEnvelope/cancel

namespace

omi.xsd

type

cancelRequest

properties

content: complex

children

nodeList requestID

complexType cancelRequest

Diagram for complexType cancelRequest

namespace

omi.xsd

children

nodeList requestID

used by

element: omiEnvelope/cancel

annotation

documentation: Cancel request type.

element cancelRequest/nodeList

Diagram for element cancelRequest/nodeList

namespace

omi.xsd

type

nodesType

facets

minOcc: 0

maxOcc: 1

content: complex

children

node

element cancelRequest/requested

Diagram for element cancelRequest/requested

namespace

omi.xsd

type

idType

properties

minOcc: 1

maxOcc: unbounded

content: complex

complexType idType

Diagram for complexType idType

namespace

omi.xsd

type

extension of xs:string

properties

Base: xs:string

used by

Elements: requestResultType/requestID cancelRequest/requestID

annotation

Documentation: Some kind of identifier with optional “format” attribute for indicating what kind of identifier is used.

attribute idType/@format

type

xs:string

properties

use: optional

annotation

documentation: Use for indicating what kind of identifier.

complexType nodesType

Diagram for complexType nodesType

namespace

omi.xsd

children

node

used by

elements: requestBaseType/nodeList requestResultType/nodeList cancelRequest/nodeList

annotation

documentation: The nodesType is used anywhere in the schema where lists of nodes can appear.

attribute nodesType/@type

type

xs:string

properties

use: optional

annotation

documentation: String indicating what format is being used for “node” addresses. By default a URL.

element nodesType/node

Diagram for element nodesType/node

namespace

omi.xsd

type

xs:anyURI

properties

minOcc: 1

maxOcc: unbounded

content: simple

annotation

documentation: Defines the URL/URI of an O-MI node. The node may be located using other means than this URL field, like discovery and routing functionality.

complexType readRequest

Diagram for complexType readRequest

namespace

omi.xsd

type

extension of requestBaseType

properties

base: requestBaseType

children

nodeList requestID msg

used by

element: omiEnvelope/read

annotation

documentation: Read request type.

attribute readRequest/@interval

type

restriction of xs:double

properties

use: optional

facets

kind: minInclusive

value: –2

annotation

annotation

documentation: If an “interval” attribute is included, it indicates that this is a subscription request that uses the given interval. Values 0, –1, and –2 have special significance.

attribute readRequest/@oldest

type

restriction of xs:int

properties

use: optional

facets

kind: minInclusive

value: 1

annotation

annotation

documentation: Retrieve the oldest available number of historical data available.

attribute readRequest/@begin

type

xs:dateTime

properties

use: optional

annotation

documentation: Retrieve data from this begin date.

attribute readRequest/@end

type

xs:dateTime

properties

use: optional

annotation

documentation: Retrieve data until this end date.

attribute readRequest/@newest

type

restriction of xs:int

properties

use: optional

facets

kind: minInclusive

value: 1

annotation

annotation

documentation: Retrieve the newest available number of historical data available.

complexType requestBaseType

Diagram for complexType requestBaseType

namespace

omi.xsd

children

nodeList requestID msg

used by

complexTypes: readRequest writeRequest

annotation

documentation: Base type for “read” and “write” requests.

attribute requestBaseType/@callback

type

xs:anyURI

properties

use: optional

attribute requestBaseType/@msgformat

type

schemaID

properties

use: optional

annotation

documentation: Text string indicating the format of the payload in “msg”; e.g., “csv”, “obix”, or similar. For an XML schema, this SHOULD correspond to the value of the schema’s “id” attribute, if present.

attribute requestBaseType/@targetType

type

restriction of xs:string

properties

use: optional

default: node

facets

kind: enumeration enumeration

value: device node

annotation

annotation

documentation: Currently “node” or “device”. Using “device” indicates that if the message “target object” is some kind of device connected to a node, then try to get the requested value from the “device”.

element requestBaseType/nodeList

Diagram for element requestBaseType/nodeList

namespace

omi.xsd

type

nodesType

properties

minOcc: 0

maxOcc: 1

content: complex

children

node

element requestBaseType/requested

Diagram for element requestBaseType/requested

namespace

omi.xsd

properties

minOcc: 0

maxOcc: unbounded

annotation

documentation: “requested” is only included when “polling” for data that corresponds to an earlier subscription that returned the corresponding ID.

complexType requestResultType

Diagram for complexType requestResultType

namespace

omi.xsd

children

return requestID msg nodeList omiEnvelope

used by

element: responseListType/result

annotation

documentation: Result of a request.

attribute requestResultType/@msgformat

type

schemaID

properties

use: optional

annotation

documentation: Text string indicating the format of the payload in “msg”; e.g., “csv”, “obix”, or similar.

attribute requestResultType/@targetType

type

restriction of xs:string

properties

use: optional

default: node

facets

kind: enumeration enumeration

value: device node

annotation

annotation

documentation: Currently “node” or “device”. Value “device” indicates that the response comes directly from the “target object”. Value “node” is intended to be used for indicating that even though the initial request was for “device”, the returned value is the last known one by this node due to the unavailability of the “device” online.

element requestResultType/return

Diagram for element requestResultType/return

namespace

omi.xsd

type

returnType

properties

content: complex

element requestResultType/requested

Diagram for element requestResultType/requested

namespace

omi.xsd

type

idType

properties

minOcc: 0

maxOcc: 1

content: complex

element requestResultType/nodeList

Diagram for element requestResultType/nodeList

namespace

omi.xsd

type

nodesType

properties

minOcc: 0

maxOcc: 1

content: complex

children

node

complexType responseListType

Diagram for complexType responseListType

namespace

omi.xsd

children

result

used by

element: omiEnvelope/response

annotation

documentation: List of results.

element responseListType/result

Diagram for element responseListType/result

namespace

omi.xsd

type

requestResultType

properties

minOcc: 1

maxOcc: unbounded

content: complex

children

return requestID msg nodeList omiEnvelope

complexType returnType

Diagram for complexType returnType

namespace

omi.xsd

type

extension of xs:string

properties

base: xs:string

used b

element: requestResultType/return

annotation

documentation: Return status of request. Use HTTP codes/descriptions when applicable.

attribute returnType/@returnCode

type

restriction of xs:token

properties

use: required

facets

kind: pattern

value: 2[0-9]{2}|4[0-9]{2}|5[0-9]{2}|6[0-9]{2}

annotation

annotation

documentation: Use HTTP codes when applicable.

attribute returnType/@description

type

xs:string

properties

use: optional

complexType writeRequest

Diagram for complexType writeRequest

namespace

omi.xsd

type

extension of requestBaseType

properties

base: requestBaseType

children

nodeList requestID msg

used by

element: omiEnvelope/write

annotation

documentation: Write request type.

simpleType schemaID

namespace

omi.xsd

type

xs:string

properties

base: xs:string

used by

attributes: requestBaseType/@msgformat
requestResultType/@msgformat

annotation

documentation: Some “predefined” identifier for the format/semantics of “value”; e.g., “csv”, “obix.xsd”.