From 7b436b9e73753ca58ab52c66e02cd37f84852054 Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Fri, 22 Mar 2024 17:03:05 -0600 Subject: [PATCH] Force Element to be an IRI Elements must have a fully qualified IRI; blank nodes are not allowed to add the NodeKind constraint to the class --- spec_parser/rdf.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec_parser/rdf.py b/spec_parser/rdf.py index 15fe4fe..664232d 100644 --- a/spec_parser/rdf.py +++ b/spec_parser/rdf.py @@ -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":