-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
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:
spec-parser/spec_parser/rdf.py
Lines 276 to 280 in fb5800c
| 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:
spec-parser/spec_parser/rdf.py
Lines 267 to 280 in fb5800c
| 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", | |
| } |
Metadata
Metadata
Assignees
Labels
No labels