Open cmungall opened 3 years ago
I figured out how to do it:
if isinstance(a, SubObjectPropertyOf):
sub = a.subObjectPropertyExpression.v
if isinstance(sub, ObjectPropertyExpression) and isinstance(sub.v, ObjectProperty):
child = self.iri_to_name(sub.v)
sup = a.superObjectPropertyExpression.v
if isinstance(sup, ObjectPropertyExpression) and isinstance(sup.v, ObjectProperty):
parent = self.iri_to_name(sup.v)
print(f'{child} < {parent}')
slot_isamap[child].add(parent)
else:
logging.error(f"cannot handle anon parent properties for {a}")
else:
print(f"cannot handle anon child properties for {a}")
but this seems a little complex
Lets use this as one of the first tests for issue #42
Parsing this:
yields this axiom object:
This is kinda awkward to work with. All I want to do is reconstruct a basic property hierarchy, as shown here:
(this is prov)
My code is already quite complex:
but this doesn't work as it seems I have to check various levels of
.v
objects?