Skip to content

Commit

Permalink
Force Element to be an IRI
Browse files Browse the repository at this point in the history
Elements must have a fully qualified IRI; blank nodes are not allowed to
add the NodeKind constraint to the class
  • Loading branch information
JPEWdev committed Apr 2, 2024
1 parent 4fecbf1 commit 7b436b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec_parser/rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ def gen_rdf_ontology(model):
pns = "" if parent.startswith("/") else f"/{c.ns.name}/"
p = model.classes[pns+parent]
g.add((node, RDFS.subClassOf, URIRef(p.iri)))

# Element is hard coded to require an IRI
if fqname == "/Core/Element":
g.add((node, SH.nodeKind, SH.IRI))

for p in c.properties:
fqprop = c.properties[p]["fqname"]
if fqprop == "/Core/spdxId":
Expand Down

0 comments on commit 7b436b9

Please sign in to comment.