Skip to content

Commit

Permalink
only add the BSH property shape if it is a Brick property
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro committed Aug 7, 2024
1 parent 761b4e6 commit 6c5d215
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions generate_brick.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand Down

0 comments on commit 6c5d215

Please sign in to comment.