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

add files for new uo import #1633

Merged
merged 6 commits into from
Sep 4, 2023
Merged

Conversation

h-spinde
Copy link
Contributor

@h-spinde h-spinde commented Aug 2, 2023

Summary of the discussion

As propsed in issue #1612 this updates the UO import process.
To this end I have created a script that automatically extracts everything listed in "uo-w-hierarchy.txt" (thus named in case other modules need to be imported without their hierarchy later on) and creates an owl-file (uo-extracted.owl) in the imports directory.
The current list of imported modules is composed of every UO class mentioned in any of the files under src/ontology.
This script also automatically updates the classes so that their definitions are displayed as "definition" (iao_0000115) instead of "rdfs:comment". To realise this, the Sed Stream Editor is utalised, which was accordingly added to "requirements.txt".

What this PR does not do:
Import the new uo-extracted.owl file into the ontology.
This can currently be done manually in Protege, but since imports have the form
Import: <http://openenergy-platform.org/ontology/oeo/dev/imports/module-to-be-imported.owl>
they can only be added to the oeo files once they have been uploaded to the appropriate site.

Type of change (CHANGELOG.md)

Added

  • New files for updated UO import process

Workflow checklist

PR-Assignee

Reviewer

  • 🐙 Follow the Reviewer Guide
  • 🐙 Provided feedback and show sufficient appreciation for the work done

@h-spinde h-spinde requested a review from stap-m August 2, 2023 10:33
@h-spinde h-spinde self-assigned this Aug 2, 2023
@h-spinde h-spinde marked this pull request as ready for review August 2, 2023 10:37
Copy link
Contributor

@stap-m stap-m left a comment

Choose a reason for hiding this comment

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

The rest looks good. Thanks!

@@ -0,0 +1,22 @@
# Download current UO release
Copy link
Contributor

Choose a reason for hiding this comment

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

Please document, which release exactly is imported. Ideally, here and in changelog.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to change the link as well (the one in the previous commit pointed to "whichever version is most current"), but now it should point at a specific version, which has been added to both the description and the change log

@stap-m stap-m requested a review from areleu August 3, 2023 07:33
@areleu
Copy link
Contributor

areleu commented Aug 4, 2023

I only ran in one problem where sed was not adding a new line when introducing the new namespace. I had to fix it manually. But it is probably because I am using a windows computer. Otherwise I can reproduce the results 100% from the script. How were we importing UO before? what happened to that file?

Edit: We can probably get rid of uo-module isn't it?

@h-spinde
Copy link
Contributor Author

h-spinde commented Aug 7, 2023

Yes, getting rid of the old import file (uo-module) should be fine.
I left it in since, currently, all files importing the uo are still using http://openenergy-platform.org/ontology/oeo/dev/imports/uo-module.owl since the new file can only be imported manually (as it does not have a url to import from yet), but as I understand it deleting the file here should not influence that.

@stap-m
Copy link
Contributor

stap-m commented Aug 9, 2023

I'd be fine to delete the old module once the new import is done. Are you palnning to do that in a separate PR @h-spinde ?

@h-spinde
Copy link
Contributor Author

I was planning to leave the file in for transparancy's sake (so that users can still see the contents of the current import in their local repo) and only remove it once all files use the new import, but if that's not a concern I can also add the deletion of this file to this pull request

@h-spinde
Copy link
Contributor Author

To summarise the current status of this pull request and future plans:

Currently, the old import file for the UO (uo-module.owl) is still being used. This is because imports have the form
Import: <http://openenergy-platform.org/ontology/oeo/dev/imports/uo-module.owl>
Accordingly, only files that can be found at [http://openenergy-platform.org/ontology/oeo/dev/imports] can be imported, and we still have to rely on the old file for now.
This pull request contains a script (extract-uo-module.sh) that generates a new file (uo-extracted.owl), which should be added to the site with the next release. This new file contains only the parts of the UO needed for the OEO, instead of importing the entire ontology.
Once the new file can be found at the according URL ([http://openenergy-platform.org/ontology/oeo/dev/imports/uo-extracted.owl]), a new pull request can be made to change the import in all files using the UO to the new file.
At that point, it will also be possible to delete the old import file.

CHANGELOG.md Outdated Show resolved Hide resolved
@h-spinde h-spinde merged commit b4f9fe1 into dev Sep 4, 2023
4 checks passed
@h-spinde h-spinde deleted the feature-1612-update-uo-import-process branch September 4, 2023 08:37
@stap-m stap-m mentioned this pull request Sep 5, 2023
4 tasks
@stap-m stap-m mentioned this pull request Oct 24, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants