From 6c5d215361e4b49eeb1d05b7a300f6a90b14909c Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Wed, 7 Aug 2024 11:32:48 -0600 Subject: [PATCH] only add the BSH property shape if it is a Brick property --- generate_brick.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/generate_brick.py b/generate_brick.py index 6ee9314d..8e0a599c 100755 --- a/generate_brick.py +++ b/generate_brick.py @@ -650,11 +650,12 @@ def define_relationships(definitions, superprop=None, graph=G): assert isinstance(subproperties_def, dict) define_relationships(subproperties_def, prop, graph=graph) - # generate a SHACL Property Shape for this relationship - qname = graph.namespace_manager.qname(prop) - propshape = BSH[f"{qname.replace(':','_')}Shape"] - graph.add((propshape, A, SH.PropertyShape)) - graph.add((propshape, SH.path, prop)) + # generate a SHACL Property Shape for this relationship if it is a Brick property + if prop.startswith(BRICK): + qname = graph.namespace_manager.qname(prop) + propshape = BSH[f"{qname.replace(':','_')}Shape"] + graph.add((propshape, A, SH.PropertyShape)) + graph.add((propshape, SH.path, prop)) if "range" in propdefn.keys(): range_defn = propdefn.pop("range") if isinstance(range_defn, (tuple, list)):