Skip to content

Commit 8823aaa

Browse files
author
Peter Amstutz
committed
Adjust ref scopes
1 parent 3431e18 commit 8823aaa

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

schema_salad/metaschema/metaschema.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ $graph:
286286
_id: sld:type
287287
_type: "@vocab"
288288
typeDSL: true
289-
refScope: 0
289+
refScope: 2
290290
doc: |
291291
The field type
292292
@@ -318,7 +318,7 @@ $graph:
318318
_id: "sld:type"
319319
_type: "@vocab"
320320
typeDSL: true
321-
refScope: 0
321+
refScope: 2
322322
- name: "fields"
323323
type: RecordField[]?
324324
jsonldPredicate: "sld:fields"
@@ -346,7 +346,7 @@ $graph:
346346
jsonldPredicate:
347347
_id: "sld:extends"
348348
_type: "@id"
349-
refScope: 0
349+
refScope: 1
350350
doc: |
351351
Indicates that this record inherits fields from one or more base records.
352352
@@ -377,7 +377,7 @@ $graph:
377377
_id: "sld:type"
378378
_type: "@vocab"
379379
typeDSL: true
380-
refScope: 0
380+
refScope: 2
381381
- name: "symbols"
382382
type: string[]
383383
jsonldPredicate:
@@ -401,7 +401,7 @@ $graph:
401401
jsonldPredicate:
402402
_id: "sld:extends"
403403
_type: "@id"
404-
refScope: 0
404+
refScope: 1
405405
doc: |
406406
Indicates that this enum inherits symbols from a base enum.
407407
@@ -420,7 +420,7 @@ $graph:
420420
_id: "sld:type"
421421
_type: "@vocab"
422422
typeDSL: true
423-
refScope: 0
423+
refScope: 2
424424
- name: items
425425
type:
426426
- PrimitiveType
@@ -438,7 +438,7 @@ $graph:
438438
jsonldPredicate:
439439
_id: "sld:items"
440440
_type: "@vocab"
441-
refScope: 0
441+
refScope: 2
442442
doc: "Defines the type of the array elements."
443443

444444

@@ -461,4 +461,4 @@ $graph:
461461
_id: "sld:type"
462462
_type: "@vocab"
463463
typeDSL: true
464-
refScope: 0
464+
refScope: 2

schema_salad/schema.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def get_metaschema():
9494
"extends": {
9595
"@id": "https://w3id.org/cwl/salad#extends",
9696
"@type": "@id",
97-
"refScope": 0
97+
"refScope": 1
9898
},
9999
"fields": "sld:fields",
100100
"float": "http://www.w3.org/2001/XMLSchema#float",
@@ -103,7 +103,7 @@ def get_metaschema():
103103
"items": {
104104
"@id": "https://w3id.org/cwl/salad#items",
105105
"@type": "@vocab",
106-
"refScope": 0
106+
"refScope": 2
107107
},
108108
"jsonldPredicate": "sld:jsonldPredicate",
109109
"long": "http://www.w3.org/2001/XMLSchema#long",
@@ -135,8 +135,8 @@ def get_metaschema():
135135
"type": {
136136
"@id": "https://w3id.org/cwl/salad#type",
137137
"@type": "@vocab",
138-
"typeDSL": True,
139-
"refScope": 0
138+
"refScope": 2,
139+
"typeDSL": True
140140
},
141141
"typeDSL": "https://w3id.org/cwl/salad#JsonldPredicate/typeDSL",
142142
"xsd": "http://www.w3.org/2001/XMLSchema#"

tests/test_examples.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ def test_scoped_ref(self):
172172
{'inputs': [{
173173
'id': 'http://example2.com/#inp',
174174
'type': 'string'
175+
}, {
176+
'id': 'http://example2.com/#inp2',
177+
'type': 'string'
175178
}],
176179
'outputs': [{
177180
'id': 'http://example2.com/#out',
@@ -186,7 +189,10 @@ def test_scoped_ref(self):
186189
'source': 'http://example2.com/#inp'
187190
}, {
188191
'id': 'http://example2.com/#step1/inp2',
189-
'source': 'http://example2.com/#inp'
192+
'source': 'http://example2.com/#inp2'
193+
}, {
194+
'id': 'http://example2.com/#step1/inp3',
195+
'source': ['http://example2.com/#inp', 'http://example2.com/#inp2']
190196
}],
191197
"out": ["http://example2.com/#step1/out"],
192198
}, {

0 commit comments

Comments
 (0)