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

Handle owlready2:python_names in genated triples in excelparser #795

Merged
merged 4 commits into from
Oct 29, 2024

Conversation

francescalb
Copy link
Collaborator

@francescalb francescalb commented Oct 29, 2024

Description

EMMOntoPy tests fail with owlready0.45 and higher.
I want to fix one owlready release at a time, since there seem to be different things that are
incompatible going up to v0.48.

In v 0.45 owlready2 introduced the python names defined with the predicate "http://www.lesfleursdunormal.fr/static/_downloads/owlready_ontology.owl#python_name"
in the ontology. These should not be part of the generated ontology and have therefore been removed
in the ontology generated with the excelparser.

Previously I had problems with this predicate also being used in the saved ontologies, but this seems not to be the case anymore.

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 Oct 29, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 72.61%. Comparing base (0f6c235) to head (e56b773).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
ontopy/excelparser.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #795      +/-   ##
==========================================
+ Coverage   72.54%   72.61%   +0.06%     
==========================================
  Files          18       18              
  Lines        3701     3706       +5     
==========================================
+ Hits         2685     2691       +6     
+ Misses       1016     1015       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@francescalb francescalb changed the title Removed owlready2:python_names in genated triples in excelparser Handkle owlready2:python_names in genated triples in excelparser and in saving of ontology Oct 29, 2024
@francescalb francescalb changed the title Handkle owlready2:python_names in genated triples in excelparser and in saving of ontology Handle owlready2:python_names in genated triples in excelparser Oct 29, 2024
Comment on lines 460 to 466
# Remove triples with predicate 'python_name' added by owlready2i>0.45
onto._del_data_triple_spod( # pylint: disable=protected-access
p=onto._abbreviate( # pylint: disable=protected-access
"http://www.lesfleursdunormal.fr/static/_downloads/"
"owlready_ontology.owl#python_name"
)
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

If create_ontology_from_pandas() is called with an input_ontology, then this will modify the input ontology. I suggest that you on line 314 replaces onto = input_ontology with onto = input_ontology.copy()` to ensure that we are not modifying the input ontology.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmmm, in that case we should not remove the triples with python_name coming from the input_ontology...

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.

See the comment. Otherwise, looks fine.

@francescalb francescalb merged commit d3f8e88 into master Oct 29, 2024
12 checks passed
@francescalb francescalb deleted the flb/owlready0.45 branch October 29, 2024 13:34
This was referenced Oct 29, 2024
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