Skip to content
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

Merged
merged 6 commits into from
Jan 2, 2024

Conversation

jesper-friis
Copy link
Collaborator

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

  • Bug fix.
  • New feature.
  • Documentation update.
  • Test update.

Checklist

This checklist can be used as a help for the reviewer.

  • Is the code easy to read and understand?
  • Are comments for humans to read, not computers to disregard?
  • Does a new feature has an accompanying new test (in the CI or unit testing schemes)?
  • Has the documentation been updated as necessary?
  • Does this close the issue?
  • Is the change limited to the issue?
  • Are errors handled for all outcomes?
  • Does the new feature provide new restrictions on dependencies, and if so is this documented?

Comments

Copy link

codecov bot commented Dec 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (directory_layout@6c9bd2b). Click here to learn what that means.

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.
📢 Have feedback on the report? Share it here.

@jesper-friis jesper-friis changed the base branch from master to directory_layout December 21, 2023 16:36
Comment on lines +1944 to +1951
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)

Copy link
Collaborator

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
Copy link
Collaborator

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>,
Copy link
Collaborator

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.

Copy link
Collaborator Author

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...

Copy link
Collaborator

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?

Comment on lines 128 to 133
print("----- only in onto -----")
print(onto.difference(ontology))

print("----- only in ontology -----")
print(ontology.difference(onto))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be remobed

Comment on lines 102 to 107

# if True:
# from pathlib import Path
#
# repo_dir = Path(__file__).resolve().parent.parent.parent

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removed

Comment on lines -146 to +158
assert updated_onto.Pattern.iri == onto.Pattern.iri
assert updated_onto.FinitePattern.iri == onto.FinitePattern.iri
Copy link
Collaborator

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)

Copy link
Collaborator Author

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.

Copy link
Collaborator

@francescalb francescalb left a 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.

@francescalb francescalb self-requested a review January 2, 2024 07:35
Copy link
Collaborator

@francescalb francescalb left a 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.

@jesper-friis jesper-friis merged commit 4496126 into directory_layout Jan 2, 2024
12 checks passed
@jesper-friis jesper-friis deleted the directory-layout-test_excelparser branch January 2, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants