Skip to content

Commit

Permalink
Merge pull request #5 from robert-mieth/inherit-object-properties
Browse files Browse the repository at this point in the history
feat: inherit object properties from superclasses
  • Loading branch information
dachafra authored Oct 26, 2022
2 parents 1cfa08a + b783a06 commit dd9f07f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ def construct_mapping(template, onto):

template['mappings']['triplesMap' + class_name.capitalize()] = triplesmapTemplate
for c in list(onto.classes()):
superclasses = [c]
get_superclasses(c, onto, superclasses)
for triplesmap in dict(template['mappings']):
if template['mappings'][triplesmap]['po'][0][1] == c.iri.replace(c.namespace.base_iri, prefixes[c.namespace.base_iri] + ":"):
join_template = template['mappings']['triplesmap0']['po'][1]
generate_ref_object_maps(triplesmap, join_template, template, c, onto, prefixes)
for s in superclasses:
generate_ref_object_maps(triplesmap, join_template, template, s, onto, prefixes)

del template['mappings']['triplesmap0']

Expand Down

0 comments on commit dd9f07f

Please sign in to comment.