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 ENVO import script #9 #13

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions oeo-imports/envo/envo-n-hierarchy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
http://purl.obolibrary.org/obo/ENVO_01000254 # environmental system
3 changes: 3 additions & 0 deletions oeo-imports/envo/envo-w-hierarchy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
http://purl.obolibrary.org/obo/ENVO_02500000 # environmental system process
http://purl.obolibrary.org/obo/ENVO_01000629 # climate change
http://purl.obolibrary.org/obo/ENVO_02500004 # greenhouse effect
20 changes: 20 additions & 0 deletions oeo-imports/envo/extract-envo-module.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Note: For consistent results run with ROBOT v1.91 or higher
# Download the ENVO release from 2023-13-02
curl -L https://raw.githubusercontent.com/EnvironmentOntology/envo/v2023-02-13/envo.owl > envo-full-download.owl
# Extract the terms we want with hierarchy until the upper term "entity" (IAO_0000030).
# -- tbd in oeo-import-edits
# Classification: tbd in oeo-import-edits
robot merge --input envo-full-download.owl extract --method MIREOT --lower-terms envo-w-hierarchy.txt --intermediates all --upper-term http://purl.obolibrary.org/obo/BFO_0000001 --output envo-extracted-w-hierarchy.owl
# Extract the terms we want without hierarchy
robot merge --input envo-full-download.owl extract --method MIREOT --lower-terms envo-n-hierarchy.txt --upper-term owl:topObjectProperty --intermediates none --output envo-extracted-n-hierarchy.owl
# Create Extracted module and annotate with new ontology information
robot merge --input envo-extracted-w-hierarchy.owl --input envo-extracted-n-hierarchy.owl annotate --ontology-iri http://openenergy-platform.org/ontology/oeo/imports/envo-extracted.owl --version-iri http://openenergy-platform.org/ontology/oeo/dev/imports/envo-extracted.owl --output envo-extracted.owl
# Annotates the output module with a commentary to the origin of the content
robot annotate --input envo-extracted.owl --annotation rdfs:comment "This file contains externally imported content from the The Environment Ontology (ENVO) for import into the Open Energy Ontology (OEO). It is automatically extracted using ROBOT from the list of selected terms (envo-extract-w-hierarchy.txt, envo-extract-n-hierarchy.txt) located in the OEO-tools repository." --output envo-extracted.owl
# Annotates each axiom with the ontology IRI, using prov:wasDerivedFrom
robot annotate --input envo-extracted.owl --annotate-derived-from true --annotate-defined-by true --output envo-extracted.owl
## Annotate with new ontology information
#robot annotate --input envo-extracted.owl --ontology-iri http://openenergy-platform.org/ontology/oeo/imports/envo-extracted.owl --version-iri http://openenergy-platform.org/ontology/oeo/dev/imports/envo-extracted.owl --output envo-extracted.owl
rm envo-full-download.owl
rm envo-extracted-w-hierarchy.owl
rm envo-extracted-n-hierarchy.owl