We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing this:
SubObjectPropertyOf(:activity :influencer)
yields this axiom object:
SubObjectPropertyOf(subObjectPropertyExpression=SubObjectPropertyExpression(v=ObjectPropertyExpression(v=ObjectProperty(v=':activity'))), superObjectPropertyExpression=ObjectPropertyExpression(v=ObjectProperty(v=':influencer')), annotations=[])
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:
if isinstance(a, SubObjectPropertyOf): print(f'SUB: {a}') if isinstance(a.subObjectPropertyExpression, ObjectProperty): child = self.iri_to_name(a.subObjectPropertyExpression) if isinstance(a.superObjectPropertyExpression, ObjectProperty): parent = self.iri_to_name(a.superObjectPropertyExpression) 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 doesn't work as it seems I have to check various levels of .v objects?
.v
The text was updated successfully, but these errors were encountered:
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
Sorry, something went wrong.
Lets use this as one of the first tests for issue #42
No branches or pull requests
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?The text was updated successfully, but these errors were encountered: