-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsdf-instance-messages.cddl
More file actions
123 lines (99 loc) · 2.98 KB
/
Copy pathsdf-instance-messages.cddl
File metadata and controls
123 lines (99 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
start = sdf-instance-message-syntax
sdf-instance-message-syntax = {
; info will be required in most process policies
? info: sdfinfo
namespace: named<text>
? defaultNamespace: text
? sdfInstanceOf: sdf-instance-of
? sdfInstance: sdf-instance
}
sdfinfo = {
? title: text
? description: text
? version: text
? copyright: text
? license: text
? messageId: text
; Identifier used to connect this instance message to a previous
; one:
; Allows this instance message to only contain values that have
; actually changed, turning it into a "Delta" or a "Patch",
; depending on the purpose of the message.
? previousMessageId: text
? timestamp: modified-date-time
? modified: modified-date-time
? features: [
]
optional-comment
}
sdf-instance-of = {
model: text
? patchMethod: text ; default is merge-patch
optional-comment
}
optional-comment = (
? $comment: text ; source code comments only, no semantics
)
; Shortcut for a map that gives names to instances of X
; (has keys of type text and values of type X)
named<X> = { * text => X }
commonqualities = (
optional-comment
)
; For describing the state of instances at a given point in time
;
; An sdfInstance can refer to either an sdfThing or an sdfObject.
; Structurally, it is mostly equivalent to that of an sdfThing
; with the additiona of a thingId quality.
sdf-instance = (
? thingId: text
thingqualities
)
objectqualities = {
commonqualities
cpaedataqualities
}
thingqualities = {
sdfThing: named<thingqualities>
sdfObject: named<objectqualities>
commonqualities
cpaedataqualities
}
cpaedataqualities = (
? sdfContext: named<allowed-types>
; Models the current state of the instance's properties
? sdfProperty: named<allowed-types>
; Models the current state of the instance's action affordances
;
; DISCUSS: How should the state of actions be modeled?
? sdfAction: named<any>
; Models an history for every event affordance
? sdfEvent: named<eventhistory>
)
eventhistory = [* eventqualities]
eventqualities = {
outputValue: allowed-types
timestamp: modified-date-time
}
allowed-types = number / text / bool / null
/ [* number] / [* text] / [* bool]
/ {* text => any}
modified-date-time = text .abnf modified-dt-abnf
modified-dt-abnf = "modified-dt" .det rfc3339z
; RFC 3339 sans time-numoffset, slightly condensed
rfc3339z = '
date-fullyear = 4DIGIT
date-month = 2DIGIT ; 01-12
date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on
; month/year
time-hour = 2DIGIT ; 00-23
time-minute = 2DIGIT ; 00-59
time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap sec
; rules
time-secfrac = "." 1*DIGIT
DIGIT = %x30-39 ; 0-9
partial-time = time-hour ":" time-minute ":" time-second
[time-secfrac]
full-date = date-fullyear "-" date-month "-" date-mday
modified-dt = full-date ["T" partial-time "Z"]
'