-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
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
WIP: Fix issues with changed IRIs effecting test_excelparser #697
WIP: Fix issues with changed IRIs effecting test_excelparser #697
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## directory_layout #697 +/- ##
===================================================
Coverage ? 71.46%
===================================================
Files ? 16
Lines ? 3385
Branches ? 0
===================================================
Hits ? 2419
Misses ? 966
Partials ? 0 ☔ View full report in Codecov by Sentry. |
def difference(self, other: owlready2.Ontology) -> set: | ||
"""Return a set of triples that are in this, but not in the | ||
`other` ontology.""" | ||
# pylint: disable=invalid-name | ||
s1 = set(self.get_unabbreviated_triples(blank="_:b")) | ||
s2 = set(other.get_unabbreviated_triples(blank="_:b")) | ||
return s1.difference(s2) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
@@ -2008,31 +2016,31 @@ def _unabbreviate( | |||
|
|||
|
|||
def _get_unabbreviated_triples( | |||
self, subject=None, predicate=None, obj=None, blank=None | |||
onto, subject=None, predicate=None, obj=None, blank=None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted!
owl:imports <http://emmo.info/emmo-inferred>, | ||
owl:imports <http://emmo.info/emmo>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand why. We import beta-4 which should not have changed as development is now happening in beta5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is due to backward corrections of ontology IRIs on GitHub Pages. Probably a bad decision, but now it is done and should not be reverted again...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried to compare the files visually, but can't spot the change. Can you explain?
print("----- only in onto -----") | ||
print(onto.difference(ontology)) | ||
|
||
print("----- only in ontology -----") | ||
print(ontology.difference(onto)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be remobed
|
||
# if True: | ||
# from pathlib import Path | ||
# | ||
# repo_dir = Path(__file__).resolve().parent.parent.parent | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be removed
assert updated_onto.Pattern.iri == onto.Pattern.iri | ||
assert updated_onto.FinitePattern.iri == onto.FinitePattern.iri |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check both Pattern (in the imported ontology) and FinitePattern (newly created)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pattern doesn't exists in 1.0.0-beta5, which is the one we have here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the difference function. Please see comments, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, but check that pylint passes.
Description
Fix issues with changed IRIs effecting test_excelparser.
Added
difference()
method to Ontology for easier debugging. I think it is worth keeping.Note that this branch is branched out from the directory-layout in PR #696.
Type of change
Checklist
This checklist can be used as a help for the reviewer.
Comments