Open stmbaier opened 9 months ago
I think this is right, it isn't being handled correctly.
One way to fix this in the metaschema would be to introduce some new enum
types. This would introduce @type
, @id
and @vocab
into the vocabulary.
eg
type: enum
name: JsonldPredicateIdEnum
symbols:
- "sld:@type"
type: enum
name: JsonldPredicateTypeEnum
symbols:
- "sld:@id"
- "sld:@vocab"
And then
- name: JsonldPredicate
type: record
doc: |
Attached to a record field to define how the parent record field is handled for
URI resolution and JSON-LD context generation.
fields:
- name: _id
type: ["null", JsonldPredicateIdEnum, string]
jsonldPredicate:
_id: sld:_id
_type: "@id"
identity: true
doc: |
The predicate URI that this field corresponds to.
Corresponds to JSON-LD `@id` directive.
- name: _type
type: ["null", JsonldPredicateTypeEnum, string]
In the CWL schema definition files (like
CommandLineTool.yml
,Process.yml
, etc.) multiple times fields are declared as having the predicate IDrdf:type
like so:For CWL files, which are instances of the CWL schema, this works totally fine and leads to the desired instance-of relation in RDF, e.g.
class: CommandLineTool
in CWL YAML gets transformed toa cwl:CommandLineTool
in RDF.But if the CWL schema itself is transformed to RDF with SALAD and the
metaschema.yml
the ID ofJsonldPredicate
object of the field is tranformed tosld:_id <file:///LOCAL/PATH/TO/CWL-SCHEMA-DIRECTORY/@type>
, which is clearly ill-formed and should instead also lead tordf:type
. According to the SALAD schema definition the_id
ofJsonldPredicate
is resolved according to vocabulary resolution, which starts with link resolution. And as the link resolution rules do not state any special cases for URIs starting with@
the interpretation as relative reference seems legit and leads to the ill-formed predicate IRI. So in my eyes the CWL schema files must not use'@type'
for_id
ofJsonldPredicates
, but instead should userdf:type
(+ rdf namespace definition).Is this analysis correct and its a bug or have I missed anything from the definitions?