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

Corrected get_by_label to use only labels in the ontology #643

Merged
merged 17 commits into from
Aug 30, 2023

Conversation

francescalb
Copy link
Collaborator

@francescalb francescalb commented Aug 25, 2023

Description

get:by:label used to search wider than what ist was supposed to in the sense that is searched for prefLabels even when skos:prefLabel was not in the ontology.

Furthermore, documentation for get_by_label and get_by_label_all has been updated.

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

francescalb and others added 7 commits August 18, 2023 09:33
Note it workd forimported ontologies if the whole ontoogy is loaded
from outside. However, it the ontology is created directly in python it
is not able to access classes in imported ontologies with get_by_label.
Simplified implementation of label_annotations.
ontopy/ontology.py Outdated Show resolved Hide resolved
ontopy/ontology.py Outdated Show resolved Hide resolved
francescalb and others added 4 commits August 25, 2023 16:47
Cleaned up and added test for exact_match.

This is currently not working. So there is something wrong with that.
…-repo/EMMOntoPy into get_by_label_ni_imported_ontologies
@codecov
Copy link

codecov bot commented Aug 25, 2023

Codecov Report

Merging #643 (3539a22) into master (ec91a63) will increase coverage by 0.14%.
The diff coverage is 90.32%.

@@            Coverage Diff             @@
##           master     #643      +/-   ##
==========================================
+ Coverage   68.68%   68.82%   +0.14%     
==========================================
  Files          16       16              
  Lines        3292     3301       +9     
==========================================
+ Hits         2261     2272      +11     
+ Misses       1031     1029       -2     
Files Changed Coverage Δ
ontopy/ontology.py 76.18% <90.32%> (+0.72%) ⬆️

... and 1 file with indirect coverage changes

Detault to DEFAULT_LABEL_ANNOTATIONS module variable.
Label IRIs not in the ontology will need to be added to
ontologies in order to be accessible.
Default is None.
Copy link
Collaborator

Choose a reason for hiding this comment

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

None (default), is equivalent to set label_annotations to the DEFAULT_LABEL_ANNOTATIONS module variable.

Copy link
Collaborator

@jesper-friis jesper-friis left a comment

Choose a reason for hiding this comment

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

Great work! Added a suggestion for a small change in docstring.

ontopy/ontology.py Outdated Show resolved Hide resolved
@francescalb francescalb changed the title Get by label in imported ontologies Corrected get_by_label to use only labels in the ontology Aug 30, 2023
@francescalb francescalb merged commit 4c02290 into master Aug 30, 2023
12 checks passed
@francescalb francescalb deleted the get_by_label_ni_imported_ontologies branch August 30, 2023 07:30
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