2
2
3
3
Author:
4
4
5
- * Peter Amstutz <peter.amstutz@curoverse .com >, Curoverse
5
+ * Peter Amstutz < pamstutz@veritasgenetics .com> , Veritas Genetics
6
6
7
7
Contributors:
8
8
@@ -70,25 +70,29 @@ and RDF schema, and production of RDF triples by applying the JSON-LD
70
70
context. The schema language also provides for robust support of inline
71
71
documentation.
72
72
73
- ## Introduction to v1.0
73
+ ## Introduction to v1.1
74
74
75
- This is the second version of of the Schema Salad specification. It is
76
- developed concurrently with v1.0 of the Common Workflow Language for use in
75
+ This is the third version of of the Schema Salad specification. It is
76
+ developed concurrently with v1.1 of the Common Workflow Language for use in
77
77
specifying the Common Workflow Language, however Schema Salad is intended to be
78
- useful to a broader audience. Compared to the draft-1 schema salad
78
+ useful to a broader audience. Compared to the v1.0 schema salad
79
79
specification, the following changes have been made:
80
80
81
- * Use of [ mapSubject and mapPredicate] ( #Identifier_maps ) to transform maps to lists of records.
82
- * Resolution of the [ domain Specific Language for types] ( #Domain_Specific_Language_for_types )
83
- * Consolidation of the formal [ schema into section 5] ( #Schema ) .
81
+ * Support for ` default ` values on record fields to specify default values
82
+ * Add subscoped fields (fields which introduce a new inner scope for identifiers)
83
+ * Add the * inVocab* flag (default true) to indicate if a type is added to the vocabulary of well known terms or must be prefixed
84
+ * Add * secondaryFilesDSL* micro DSL (domain specific language) to convert text strings to a secondaryFiles record type used in CWL
85
+ * The ` $mixin ` feature has been removed from the specification, as it
86
+ is poorly documented, not included in conformance testing,
87
+ and not widely supported.
84
88
85
89
## References to Other Specifications
86
90
87
91
** Javascript Object Notation (JSON)** : http://json.org
88
92
89
93
** JSON Linked Data (JSON-LD)** : http://json-ld.org
90
94
91
- ** YAML** : http ://yaml.org
95
+ ** YAML** : https ://yaml.org/spec/1.2/spec.html
92
96
93
97
** Avro** : https://avro.apache.org/docs/current/spec.html
94
98
@@ -157,11 +161,19 @@ by a document schema, where each term maps to absolute URI.
157
161
158
162
## Syntax
159
163
160
- Conforming Salad documents are serialized and loaded using YAML syntax and
161
- UTF-8 text encoding. Salad documents are written using the JSON-compatible
162
- subset of YAML. Features of YAML such as headers and type tags that are
163
- not found in the standard JSON data model must not be used in conforming
164
- Salad documents. It is a fatal error if the document is not valid YAML.
164
+ Conforming Salad v1.1 documents are serialized and loaded using a
165
+ subset of YAML 1.2 syntax and UTF-8 text encoding. Salad documents
166
+ are written using the [ JSON-compatible subset of YAML described in
167
+ section 10.2] ( https://yaml.org/spec/1.2/spec.html#id2803231 ) . The
168
+ following features of YAML must not be used in conforming Salad
169
+ documents:
170
+
171
+ * Use of explicit node tags with leading ` ! ` or ` !! `
172
+ * Use of anchors with leading ` & ` and aliases with leading ` * `
173
+ * %YAML directives
174
+ * %TAG directives
175
+
176
+ It is a fatal error if the document is not valid YAML.
165
177
166
178
A Salad document must consist only of either a single root object or an
167
179
array of objects.
@@ -223,9 +235,9 @@ document schema. A schema may consist of:
223
235
* Any number of documentation objects which allow in-line documentation of the schema.
224
236
225
237
The schema for defining a salad schema (the metaschema) is described in
226
- detail in " Schema validation" .
238
+ detail in the [ Schema] ( #Schema ) section .
227
239
228
- ### Record field annotations
240
+ ## Record field annotations
229
241
230
242
In a document schema, record field definitions may include the field
231
243
` jsonldPredicate ` , which may be either a string or object. Implementations
@@ -237,11 +249,11 @@ rules:
237
249
238
250
* If the value of ` jsonldPredicate ` is an object, and contains that
239
251
object contains the field ` _type ` with the value ` @id ` , the field is a
240
- link field.
252
+ link field subject to [ link validation ] ( #Link_validation ) .
241
253
242
- * If the value of ` jsonldPredicate ` is an object, and contains that
243
- object contains the field ` _type ` with the value ` @vocab ` , the field is a
244
- vocabulary field, which is a subtype of link field .
254
+ * If the value of ` jsonldPredicate ` is an object which contains the
255
+ field ` _type ` with the value ` @vocab ` , the field value is subject to
256
+ [ vocabulary resolution ] ( #Vocabulary_resolution ) .
245
257
246
258
## Document traversal
247
259
@@ -250,6 +262,39 @@ validation, the document must be traversed starting from the fields or
250
262
array items of the root object or array and recursively visiting each child
251
263
item which contains an object or arrays.
252
264
265
+ ## Short names
266
+
267
+ The "short name" of an fully qualified identifier is the portion of
268
+ the identifier following the final slash ` / ` of either the fragment
269
+ identifier following ` # ` or the path portion, if there is no fragment.
270
+ Some examples:
271
+
272
+ * the short name of ` http://example.com/foo ` is ` foo `
273
+ * the short name of ` http://example.com/#bar ` is ` bar `
274
+ * the short name of ` http://example.com/foo/bar ` is ` bar `
275
+ * the short name of ` http://example.com/foo#bar ` is ` bar `
276
+ * the short name of ` http://example.com/#foo/bar ` is ` bar `
277
+ * the short name of ` http://example.com/foo#bar/baz ` is ` baz `
278
+
279
+ ## Inheritance and specialization
280
+
281
+ A record definition may inherit from one or more record definitions
282
+ with the ` extends ` field. This copies the fields defined in the
283
+ parent record(s) as the base for the new record. A record definition
284
+ may ` specialize ` type declarations of the fields inherited from the
285
+ base record. For each field inherited from the base record, any
286
+ instance of the type in ` specializeFrom ` is replaced with the type in
287
+ ` specializeTo ` . The type in ` specializeTo ` should extend from the
288
+ type in ` specializeFrom ` .
289
+
290
+ A record definition may be ` abstract ` . This means the record
291
+ definition is not used for validation on its own, but may be extended
292
+ by other definitions. If an abstract type appears in a field
293
+ definition, it is logically replaced with a union of all concrete
294
+ subtypes of the abstract type. In other words, the field value does
295
+ not validate as the abstract type, but must validate as some concrete
296
+ type that inherits from the abstract type.
297
+
253
298
# Document preprocessing
254
299
255
300
After processing the explicit context (if any), document preprocessing
0 commit comments