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

Flb/update excel parser accroding to thermodynamics example #336

Merged

Conversation

francescalb
Copy link
Collaborator

@francescalb francescalb commented Dec 22, 2021

Description:

Fixes are needed to make the excelparser more robust:

  • remove trailing and leading white spaces in prefLabels and parents
  • convert all concept data to str columns (and disregard values that are "nan")
  • force making an ontology by skipping all errors if desired
  • imported ontologies are now imported from a separate speradsheet
  • improved warnings when there are errors in prefLabels or parents
  • added option of defining 'exptected' when adding data. This means that if a concept is missing a field that is expected a warning will be printed.
  • if skos and dcterms are missing, elucidation and examples will be written as comment, and altLabels as labels.
  • Updated test with lines in the input xls with errors/mistakes that the parser should tackle.

Type of change:

  • Bug fix.
  • New feature.
  • Documentation 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 30 commits November 26, 2021 09:54
Much of what is in this file should go into the excel2onto tool.
removed rows with missing value in prefLabel
Convert prefLabel to string
Co-authored-by: Jesper Friis <jesper-friis@users.noreply.github.com>
Co-authored-by: Jesper Friis <jesper-friis@users.noreply.github.com>
Co-authored-by: Jesper Friis <jesper-friis@users.noreply.github.com>
data  argument can either be metadata (pd.DataFrame)
or a row for a concept (pd.Series)
francescalb and others added 13 commits January 4, 2022 16:48
cannot be added due to errors in prefLabel: prefLabels with spaces,
concepts that already exist (These are diregarded - it might be good to
add an option for these in the future if it should be allowed to change
or add to concepts), concepts where prefLabel is completely missing.
Concepts missing elucidation OK.
Leading and trailing spaces are removed.
If force: add elucidation as rdfs.comment, add altLAbel as rdfs.label,
add example as rdfs.comment
…mple' of github.com:emmo-repo/EMMO-python into flb/update-excel-parser-accroding-to-thermodynamics_example
ontopy/excelparser.py Outdated Show resolved Hide resolved
@francescalb francescalb marked this pull request as ready for review January 5, 2022 09:13
Copy link
Collaborator

@CasperWA CasperWA left a comment

Choose a reason for hiding this comment

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

Nothing big. I'll return this as a comment review and approve one you've gone over the comments.

ontopy/excelparser.py Outdated Show resolved Hide resolved
ontopy/excelparser.py Outdated Show resolved Hide resolved
ontopy/excelparser.py Outdated Show resolved Hide resolved
ontopy/excelparser.py Outdated Show resolved Hide resolved
ontopy/excelparser.py Show resolved Hide resolved
tests/test_excelparser.py Outdated Show resolved Hide resolved
tests/test_excelparser.py Outdated Show resolved Hide resolved
tests/test_excelparser.py Outdated Show resolved Hide resolved
tools/excel2onto Outdated Show resolved Hide resolved
tools/excel2onto Show resolved Hide resolved
@francescalb francescalb merged commit 2964d0f into master Jan 7, 2022
@CasperWA CasperWA deleted the flb/update-excel-parser-accroding-to-thermodynamics_example branch March 2, 2022 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants