Skip to content

Commit f56f6f7

Browse files
committed
Flesh out datainfo/dataty/references
1 parent 46cca6a commit f56f6f7

File tree

1 file changed

+90
-23
lines changed

1 file changed

+90
-23
lines changed

rfcs/RFC-002-schemata.rst

Lines changed: 90 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -71,82 +71,88 @@ A repository defines a collection of entities, such as "SECoP 1.0" or "Rock-IT
7171
SECoP extensions".
7272

7373
``files``
74-
Other YAML file paths, relative to this file, in which the entities making
75-
up the repository can be found.
74+
A list of other YAML file paths, relative to this file, in which the entities
75+
making up the repository can be found.
7676
``systems``, ``interfaces``, ``features``, ``parameters``, ``commands``, ``datainfo``
77-
Lists of references to entities that are part of the repository.
77+
Lists of references_ to entities that are part of the repository.
7878
``properties``
79-
Dictionary of lists of references to properties in the repository, keyed
79+
Dictionary of lists of references_ to properties in the repository, keyed
8080
by the entity they can appear on: ``SECNode``, ``System``, ``Module``,
8181
``Parameter``, ``Command``
8282

8383
**For interface classes and features:**
8484

8585
``base``
86-
The base interface/feature this one is derived from. TODO how do references look
86+
Reference to the base interface/feature this one is derived from.
8787
``properties``
88-
The properties that are required on this entity.
88+
References_ to the properties that are required/allowed on this entity
89+
(depending on their "optional" setting).
8990
``parameters``, ``commands``
90-
The accessibles that are required on this entity.
91+
References_ to the accessibles that are required/allowed on this entity.
9192

9293
**For parameters:**
9394

9495
``readonly``
95-
If the parameter should be readonly.
96+
Boolean, if the parameter should be readonly.
9697
``datainfo``
97-
Explanation of the parameter's datainfo. (TODO how to specify)
98+
Specification of the parameter's datainfo_.
9899
``properties``
99-
The properties that are possible on this entity.
100+
References_ to the properties that are possible on this entity.
100101
``optional``
101-
If the parameter is optional when added in interfaces/features.
102+
Boolean, if the parameter is by default optional when added in
103+
interfaces/features.
102104

103105
**For commands:**
104106

105107
``argument``
106-
The list of argument datainfos, or "none". TODO
108+
The list of argument datainfo_\s, or "none".
107109
``result``
108-
The return value datainfo, or "none". TODO
110+
The return value datainfo_, or "none".
109111
``properties``
110-
The properties that are possible on this entity.
112+
References_ to the properties that are possible on this entity.
111113
``optional``
112-
If the command is optional when added in interfaces/features.
114+
Boolean, if the command is by default optional when added in
115+
interfaces/features.
113116

114117
**For properties:**
115118

116119
``dataty``
117-
Specification of the property's JSON data type. TODO how to specify
120+
Specification of the property's `JSON type`_.
118121
``optional``
119-
If the property is optional.
122+
Boolean, if the property is by default optional.
120123

121124
**For datainfos:**
122125

123126
``dataty``
124-
Explanation of the datainfo's JSON (transport) data type.
127+
Specification of the datainfo's `JSON type`_ (i.e. transport layer).
125128
``members``
126129
A dictionary of members of the datainfo specification. Each member can have
127130
the following properties:
128131

129132
``dataty``
130-
Specification of the datainfo property's JSON data type.
133+
Specification of the datainfo property's `JSON type`_.
131134
``optional``
132-
If the property is optional.
135+
Boolean, if the property is optional.
133136
``default``
134137
A default value.
135138

136139
**For systems:**
137140

138141
``base``
139-
The base system this one is derived from.
142+
Reference to the base system this one is derived from.
140143
``modules``
141144
A dictionary of module names and their definitions. Each item is
142-
either a reference to an interface/feature definition or a full
143-
inline interface definition.
145+
either a reference to an existing interface/feature definition or a
146+
full inline interface definition.
144147

145148
When a new entity is proposed, the ``version`` starts at 0. A version of 0
146149
does not give a stability guarantee, unlike versions larger than 0. If an
147150
entity is accepted and introduced into the specification, the version is
148151
defined as 1. Changes to the interface afterwards bump the version number.
149152

153+
Example
154+
-------
155+
150156
As an example, a YAML description for some standard entities would look like
151157
this:
152158

@@ -289,6 +295,65 @@ issue 78:
289295
description: Must be set to "resistance".
290296
291297
298+
References
299+
----------
300+
301+
A reference to another entity is one of two things:
302+
303+
- A string, which specifies the entity name and version separated by a colon,
304+
such as ``"Readable:1"``.
305+
306+
- A dictionary that inlines the entity, with a ``definition`` key that
307+
references an existing entity as ``name:version`` and adds/overrides other
308+
keys, most commonly the ``description`` to make it more specific.
309+
310+
See the example above for how to use this.
311+
312+
313+
Datainfo
314+
--------
315+
316+
``datainfo`` entries are dictionaries with a key ``type`` (the name of the
317+
datainfo entity) and all members of the respective datainfo.
318+
319+
320+
JSON type
321+
---------
322+
323+
In ``dataty`` entries, you can specify the JSON type:
324+
325+
- Bool: ``dataty: bool``
326+
- String: ``dataty: string``
327+
- Number: ``dataty: number``
328+
- Integer: ``dataty: int``
329+
330+
- Array (JSON array)::
331+
332+
dataty:
333+
type: array
334+
members: <dataty> # the dataty of array members
335+
336+
- Tuple (JSON array)::
337+
338+
dataty:
339+
type: tuple
340+
members: [<dataty>, ...] # list of datatys
341+
342+
- Struct (JSON object)::
343+
344+
dataty:
345+
type: struct
346+
members:
347+
membername: <dataty>
348+
...
349+
optional: [...] # list of optional member names
350+
351+
Special cases:
352+
353+
- Any datainfo: ``dataty: datainfo``
354+
- Same type as the parent accessible: ``dataty: parent``
355+
356+
292357
Examples
293358
========
294359

@@ -298,6 +363,8 @@ against the declared set of YAML specs.
298363

299364
https://forge.frm2.tum.de/review/plugins/gitiles/secop/check
300365

366+
This is supposed to be moved to the main SECoP GitHub presence once agreed.
367+
301368

302369
Disadvantages, Alternatives
303370
===========================

0 commit comments

Comments
 (0)