In the context file, use @id as the @type for any term where the range is a class.
For example, for createBy, which its range is Agent class, its entry in context file should look like this:
"createdBy": {
"@id": "https://spdx.org/rdf/3.1/terms/Core/createdBy",
"@type": "@id"
},
Currently we set the type as @vocab, but Agent is not a vocabulary.
Propose to change these lines:
|
elif (o, RDF.type, OWL.Class) in g: |
|
return { |
|
"@id": subject, |
|
"@type": "@vocab", |
|
} |
to:
elif (o, RDF.type, OWL.Class) in g:
return {
"@id": subject,
"@type": "@id",
}
o here is not a vocabulary, because line 268, and it is a class, because line 276:
|
for _, _, o in g.triples((subject, RDFS.range, None)): |
|
if o in vocab_classes: |
|
return { |
|
"@id": subject, |
|
"@type": "@vocab", |
|
"@context": { |
|
"@vocab": o + "/", |
|
}, |
|
} |
|
elif (o, RDF.type, OWL.Class) in g: |
|
return { |
|
"@id": subject, |
|
"@type": "@vocab", |
|
} |
Ref: spdx/spdx-3-model#1167
In the context file, use
@idas the@typefor any term where the range is a class.For example, for
createBy, which its range isAgentclass, its entry in context file should look like this:Currently we set the type as
@vocab, butAgentis not a vocabulary.Propose to change these lines:
spec-parser/spec_parser/rdf.py
Lines 276 to 280 in fb5800c
to:
ohere is not a vocabulary, because line 268, and it is a class, because line 276:spec-parser/spec_parser/rdf.py
Lines 267 to 280 in fb5800c
Ref: spdx/spdx-3-model#1167