Skip to content

Commit 0407370

Browse files
author
Peter Amstutz
committed
Allow idmaps for record fields.
1 parent 5d9a08e commit 0407370

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

schema_salad/metaschema/metaschema_base.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ $graph:
4343
type: record
4444
doc: A field of a record.
4545
fields:
46-
- name: name
46+
name:
4747
type: string
4848
jsonldPredicate: "@id"
4949
doc: |
5050
The name of the field
5151
52-
- name: doc
52+
doc:
5353
type: string?
5454
doc: |
5555
A documentation string for this field
5656
jsonldPredicate: "sld:doc"
5757

58-
- name: type
58+
type:
5959
type:
6060
- PrimitiveType
6161
- RecordSchema
@@ -81,7 +81,7 @@ $graph:
8181
- name: RecordSchema
8282
type: record
8383
fields:
84-
- name: type
84+
type:
8585
doc: "Must be `record`"
8686
type:
8787
name: Record_symbol
@@ -93,9 +93,12 @@ $graph:
9393
_type: "@vocab"
9494
typeDSL: true
9595
refScope: 2
96-
- name: "fields"
96+
fields:
9797
type: RecordField[]?
98-
jsonldPredicate: "sld:fields"
98+
jsonldPredicate:
99+
_id: sld:fields
100+
mapSubject: name
101+
mapPredicate: type
99102
doc: "Defines the fields of the record."
100103

101104

@@ -104,7 +107,7 @@ $graph:
104107
doc: |
105108
Define an enumerated type.
106109
fields:
107-
- name: type
110+
type:
108111
doc: "Must be `enum`"
109112
type:
110113
name: Enum_symbol
@@ -116,7 +119,7 @@ $graph:
116119
_type: "@vocab"
117120
typeDSL: true
118121
refScope: 2
119-
- name: "symbols"
122+
symbols:
120123
type: string[]
121124
jsonldPredicate:
122125
_id: "sld:symbols"
@@ -128,7 +131,7 @@ $graph:
128131
- name: ArraySchema
129132
type: record
130133
fields:
131-
- name: type
134+
type:
132135
doc: "Must be `array`"
133136
type:
134137
name: Array_symbol
@@ -140,7 +143,7 @@ $graph:
140143
_type: "@vocab"
141144
typeDSL: true
142145
refScope: 2
143-
- name: items
146+
items:
144147
type:
145148
- PrimitiveType
146149
- RecordSchema

schema_salad/schema.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ def get_metaschema():
9797
"@type": "@id",
9898
"refScope": 1
9999
},
100-
"fields": "sld:fields",
100+
"fields": {
101+
"@id": "sld:fields",
102+
"mapSubject": "name",
103+
"mapPredicate": "type"
104+
},
101105
"float": "http://www.w3.org/2001/XMLSchema#float",
102106
"identity": "https://w3id.org/cwl/salad#JsonldPredicate/identity",
103107
"int": "http://www.w3.org/2001/XMLSchema#int",

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
extras_require = {} # TODO: to be removed when the above is added
4242

4343
setup(name='schema-salad',
44-
version='1.12',
44+
version='1.13',
4545
description='Schema Annotations for Linked Avro Data (SALAD)',
4646
long_description=open(README).read(),
4747
author='Common workflow language working group',

0 commit comments

Comments
 (0)