type Limit = | Nolimit | Inclusive { value : Double } | Exclusive { value : Double } | InclusiveLong { value : Long } | ExclusiveLong { value : Long } type Range = { lower : Limit, upper : Limit } type Component = { name : String, type : DataType } type DataTypeDefinition = { name : String, type : DataType } type DataType = | BooleanType {} | ByteType { unit : Optional(String), range : Optional(Range) } | IntegerType { unit : Optional(String), range : Optional(Range) } | LongType { unit : Optional(String), range : Optional(Range) } | FloatType { unit : Optional(String), range : Optional(Range) } | DoubleType { unit : Optional(String), range : Optional(Range) } | StringType { pattern : Optional(String), mimeType : Optional(String), length : Optional(String) } | RecordType referable { referable : Boolean, components : Component[] } | ArrayType { componentType : DataType, length : Optional(Range) } | MapType { keyType : DataType, valueType : DataType } | OptionalType { componentType : DataType } | UnionType UnionType | VariantType {} type UnionType = { components : Component[] } type UUID = { mostSigBits : Long, leastSigBits : Long } type Void = {} type URI = String type LocalizedText = Map(String, String) type Interface = { methodDefinitions : Map(MethodTypeDefinition, {}) } type InterfaceDefinition = { name : String, type : Interface } type MethodType = { requestType : DataType, responseType : DataType, errorType : UnionType } type MethodTypeDefinition = { name : String, type : MethodType } type Handshake = | Version0 type Version0 = { recvMsgLimit : Integer, sendMsgLimit : Integer, methods : MethodTypeDefinition[] } type Message = | RequestHeader RequestHeader | ResponseHeader ResponseHeader | ExecutionError_ ExecutionError_ | Exception_ Exception_ | InvalidMethodError InvalidMethodError | ResponseTooLarge ResponseTooLarge type RequestHeader = { requestId : Integer, methodId : Integer } type ResponseHeader = { requestId : Integer } type ExecutionError_ = { requestId : Integer } type InvalidMethodError = { requestId : Integer } type Exception_ = { requestId : Integer, message : String } type ResponseTooLarge = { requestId : Integer } type AccessorReference = | ArrayIndexReference { childReference : Optional(AccessorReference), index : Integer } | KeyReference { childReference : Optional(AccessorReference), key : Variant } | OptionalValueReference { childReference : Optional(AccessorReference) } | FieldIndexReference { childReference : Optional(AccessorReference), index : Integer } | FieldNameReference { childReference : Optional(AccessorReference), fieldName : String } | TagReference { childReference : Optional(AccessorReference) } | TagIndexReference { childReference : Optional(AccessorReference), tag : Integer } | TagNameReference { childReference : Optional(AccessorReference), tag : String } | VariantValueReference { childReference : Optional(AccessorReference) } | LabelReference { childReference : Optional(AccessorReference), label : String } type Event = | ArrayElementAdded { reference : Optional( AccessorReference ), index : Integer, value : Optional( Variant ) } | ArrayElementRemoved { reference : Optional( AccessorReference ), index : Integer } | MapEntryAdded { reference : Optional( AccessorReference ), key : Variant, value : Optional( Variant ) } | MapEntryRemoved { reference : Optional( AccessorReference ), key : Variant } | UnionValueAssigned { reference : Optional( AccessorReference ), tag : Integer, newValue : Optional( Variant ) } | OptionalValueAssigned { reference : Optional( AccessorReference ), newValue : Optional( Variant ) } | OptionalValueRemoved { reference : Optional( AccessorReference ) } | ValueAssigned { reference : Optional( AccessorReference ), newValue : Optional( Variant ) } | InvalidatedEvent { reference : Optional( AccessorReference ) } type ChangeSet = { events : Event[] } type InterestSet = | BooleanInterestSet { notification : Boolean, value : Boolean } | ByteInterestSet { notification : Boolean, value : Boolean } | IntegerInterestSet { notification : Boolean, value : Boolean } | LongInterestSet { notification : Boolean, value : Boolean } | FloatInterestSet { notification : Boolean, value : Boolean } | DoubleInterestSet { notification : Boolean, value : Boolean } | StringInterestSet { notification : Boolean, value : Boolean } | RecordInterestSet { notification : Boolean, notifications : Boolean[], value : Boolean, values : Boolean[] } | ArrayInterestSet { notification : Boolean, notifications : Integer[], value : Boolean, values : Integer[] } | MapInterestSet { notification : Boolean, notifications : Variant[], value : Boolean, values : Variant[], componentInterest : InterestSet, componentInterests : Map( Variant, InterestSet ) } | OptionalInterestSet { notification : Boolean, value : Boolean, componentInterest : InterestSet } | UnionInterestSet { notification : Boolean, value : Boolean, componentInterests : InterestSet[] } | VariantInterestSet { notification : Boolean, value : Boolean, componentInterest : InterestSet, completeComponent : Boolean } type Datasource = { nodes : Map(Variant, Node) } type Node = { id : Variant, labels : LocalizedText, children : Variant[], value : Optional(Variant) } type Instant = { seconds : Long, nanoSeconds : Integer(range=[0..999999999]) } type Duration = { seconds : Long, nanoSeconds : Integer(range=[0..999999999]) } type LocalDate = { year : Integer, monthOfYear : Integer(range=[1..12]), dayOfMonth : Integer(range=[1..31]) } type LocalTime = { hourOfDay : Integer(range=[0..23]), minuteOfHour : Integer(range=[0..59]), secondOfMinute : Integer(range=[0..59]), nanoOfSecond : Integer(range=[0..999999999]) } type LocalDateTime = { year : Integer, monthOfYear : Integer(range=[1..12]), dayOfMonth : Integer(range=[1..31]), hourOfDay : Integer(range=[0..23]), minuteOfHour : Integer(range=[0..59]), secondOfMinute : Integer(range=[0..59]), nanoOfSecond : Integer(range=[0..999999999]) } type ZonedDateTime = { date : LocalDate, time : LocalTime, zone : TimeZone } type TimeZone = { zoneId : String } // A result of a data capturing session type RecordingSession = { // An optional Datasource URL datasource : Optional( String ), // Events that occured in the data source during sampling, a map of Event Id to Event events: Map( Integer, Event ), // A collection of events that are promoted to milestones, a map of Milestone Id to Event Id milestones : Map( Integer, Integer ), // All records, a map of NodeId to Recording(T, V) recordings : Map( Variant, Variant ) } type SubscriptionParameters = { nodeId : Variant, deadband : Optional( Variant ), interval : Optional( Variant ) } type SamplingConfiguration = { // Capture events, if true events are captured captureEvents : Boolean, // Subscribed Variables subscriptions : SubscriptionParameters[] } type Event = { // Session unique identifier id : Integer, // Timevalue, a number type e.g. Double(unit="s"), or a date type (See #Time_Types) time : Variant, // Title title : Optional(String), // Message message : String, // NodeId of the sender object, optional source : Optional(Variant), // Event Type: alarm, action, error, info, debug type : String, // System Text, generated by the source system, eg. ”YD11D001 started” systemText : Optional(String), // Comments comments : Comment[], // Other Metadata metadata : Map(String, String) } type Comment = { user : Optional(String), message : String }