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

tidy oeo imports #4

Merged
merged 18 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
22 changes: 22 additions & 0 deletions oeo-imports/iao/archive/extract-iao-module.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Note: For consistent results run with ROBOT v1.91 or higher
# Download the IAO release from 2022-11-07
curl -L https://raw.githubusercontent.com/information-artifact-ontology/IAO/v2022-11-07/iao.owl > iao-full-download.owl
# Extract the terms we want with hierarchy, This removes the domain of IAO_0000136
robot merge --input iao-full-download.owl extract --method MIREOT --lower-terms iao-w-hierarchy.txt --intermediates all --output iao-module-temp.owl
# Remove subclass axioms from BFO classes
robot remove --input iao-module-temp.owl --term BFO:0000001 --select "self descendants" --select "<http://purl.obolibrary.org/obo/BFO_*>" --axioms subclass --axioms annotation --signature true --exclude-term BFO:0000031 --preserve-structure false --output iao-module-temp.owl
# Extract domain of IAO_0000136
robot merge --input iao-full-download.owl filter --term http://purl.obolibrary.org/obo/IAO_0000136 --term rdfs:domain --term http://purl.obolibrary.org/obo/IAO_0000030 --select self --axioms all --signature false --output iao-extracted-domain.owl
# Extracted module
robot merge --input iao-module-temp.owl --input iao-extracted-domain.owl --output ../../ontology/imports/iao-extracted.owl
# Remove subproperty axioms
robot remove --input ../../ontology/imports/iao-extracted.owl --axioms subproperty --output ../../ontology/imports/iao-extracted.owl
# Annotates the output with a commentary to the origin of the content
robot annotate --input ../../ontology/imports/iao-extracted.owl --annotation rdfs:comment "This file contains externally imported content from the Information Artifact Ontology (IAO) for import into the Open Energy Ontology (OEO). It is automatically extracted using ROBOT." --output ../../ontology/imports/iao-extracted.owl
# Annotates each axiom with the ontology IRI, using prov:wasDerivedFrom
robot annotate --input ../../ontology/imports/iao-extracted.owl --annotate-derived-from true --annotate-defined-by true --output ../../ontology/imports/iao-extracted.owl
# Annotate with new ontology information
robot annotate --input ../../ontology/imports/iao-extracted.owl --ontology-iri http://openenergy-platform.org/ontology/oeo/imports/iao-extracted.owl --version-iri http://openenergy-platform.org/ontology/oeo/dev/imports/iao-extracted.owl --output ../../ontology/imports/iao-extracted.owl
rm iao-full-download.owl
rm iao-extracted-domain.owl
rm iao-module-temp.owl
24 changes: 8 additions & 16 deletions oeo-imports/iao/extract-iao-module.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
# Note: For consistent results run with ROBOT v1.91 or higher
# Download the IAO release from 2022-11-07
curl -L https://raw.githubusercontent.com/information-artifact-ontology/IAO/v2022-11-07/iao.owl > iao-full-download.owl
# Extract the terms we want with hierarchy, This removes the domain of IAO_0000136
robot merge --input iao-full-download.owl extract --method MIREOT --lower-terms iao-w-hierarchy.txt --intermediates all --output iao-module-temp.owl
# Remove subclass axioms from BFO classes
robot remove --input iao-module-temp.owl --term BFO:0000001 --select "self descendants" --select "<http://purl.obolibrary.org/obo/BFO_*>" --axioms subclass --axioms annotation --signature true --exclude-term BFO:0000031 --preserve-structure false --output iao-module-temp.owl
# Extract domain of IAO_0000136
robot merge --input iao-full-download.owl filter --term http://purl.obolibrary.org/obo/IAO_0000136 --term rdfs:domain --term http://purl.obolibrary.org/obo/IAO_0000030 --select self --axioms all --signature false --output iao-extracted-domain.owl
# Extracted module
robot merge --input iao-module-temp.owl --input iao-extracted-domain.owl --output ../../ontology/imports/iao-extracted.owl
# Remove subproperty axioms
robot remove --input ../../ontology/imports/iao-extracted.owl --axioms subproperty --output ../../ontology/imports/iao-extracted.owl
# Annotates the output with a commentary to the origin of the content
robot annotate --input ../../ontology/imports/iao-extracted.owl --annotation rdfs:comment "This file contains externally imported content from the Information Artifact Ontology (IAO) for import into the Open Energy Ontology (OEO). It is automatically extracted using ROBOT." --output ../../ontology/imports/iao-extracted.owl
# Extract the terms we want with hierarchy until the upper term "informatio content entity" (IAO_0000030).
stap-m marked this conversation as resolved.
Show resolved Hide resolved
# Warning: This removes the domain of IAO_0000136 -- tbd in oeo-import-edits
# Classification: tbd in oeo-import-edits
robot merge --input C:/Users/stappel/Documents/Ontologies/test_oeo_imports/iao-full-download.owl extract --method MIREOT --lower-terms C:/Users/stappel/Documents/Ontologies/test_oeo_imports/iao-w-hierarchy.txt --intermediates all --upper-term http://purl.obolibrary.org/obo/IAO_0000030 --output C:/Users/stappel/Documents/Ontologies/test_oeo_imports/iao-extracted.owl
stap-m marked this conversation as resolved.
Show resolved Hide resolved
# Annotates the output module with a commentary to the origin of the content
robot annotate --input C:/Users/stappel/Documents/Ontologies/test_oeo_imports/iao-extracted.owl --annotation rdfs:comment "This file contains externally imported content from the Information Artifact Ontology (IAO) for import into the Open Energy Ontology (OEO). It is automatically extracted using ROBOT." --output C:/Users/stappel/Documents/Ontologies/test_oeo_imports/iao-extracted.owl
stap-m marked this conversation as resolved.
Show resolved Hide resolved
# Annotates each axiom with the ontology IRI, using prov:wasDerivedFrom
robot annotate --input ../../ontology/imports/iao-extracted.owl --annotate-derived-from true --annotate-defined-by true --output ../../ontology/imports/iao-extracted.owl
robot annotate --input C:/Users/stappel/Documents/Ontologies/test_oeo_imports/iao-extracted.owl --annotate-derived-from true --annotate-defined-by true --output C:/Users/stappel/Documents/Ontologies/test_oeo_imports/iao-extracted.owl
stap-m marked this conversation as resolved.
Show resolved Hide resolved
# Annotate with new ontology information
robot annotate --input ../../ontology/imports/iao-extracted.owl --ontology-iri http://openenergy-platform.org/ontology/oeo/imports/iao-extracted.owl --version-iri http://openenergy-platform.org/ontology/oeo/dev/imports/iao-extracted.owl --output ../../ontology/imports/iao-extracted.owl
robot annotate --input C:/Users/stappel/Documents/Ontologies/test_oeo_imports/iao-extracted.owl --ontology-iri http://openenergy-platform.org/ontology/oeo/imports/iao-extracted.owl --version-iri http://openenergy-platform.org/ontology/oeo/dev/imports/iao-extracted.owl --output C:/Users/stappel/Documents/Ontologies/test_oeo_imports/iao-extracted.owl
stap-m marked this conversation as resolved.
Show resolved Hide resolved
rm iao-full-download.owl
rm iao-extracted-domain.owl
rm iao-module-temp.owl
30 changes: 16 additions & 14 deletions oeo-imports/iao/iao-w-hierarchy.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
http://purl.obolibrary.org/obo/IAO_0000136
http://purl.obolibrary.org/obo/IAO_0000010
http://purl.obolibrary.org/obo/IAO_0000025
http://purl.obolibrary.org/obo/IAO_0000028
http://purl.obolibrary.org/obo/IAO_0000030
http://purl.obolibrary.org/obo/IAO_0000033
http://purl.obolibrary.org/obo/IAO_0000064
http://purl.obolibrary.org/obo/IAO_0000088
http://purl.obolibrary.org/obo/IAO_0000100
http://purl.obolibrary.org/obo/IAO_0000104
http://purl.obolibrary.org/obo/IAO_0000300
http://purl.obolibrary.org/obo/IAO_0000310
http://purl.obolibrary.org/obo/IAO_0000590
http://purl.obolibrary.org/obo/IAO_0000233
http://purl.obolibrary.org/obo/IAO_0000136 # is about
http://purl.obolibrary.org/obo/IAO_0000010 # software
http://purl.obolibrary.org/obo/IAO_0000025 # programming language
http://purl.obolibrary.org/obo/IAO_0000028 # symbol
http://purl.obolibrary.org/obo/IAO_0000030 # information content entity
http://purl.obolibrary.org/obo/IAO_0000033 # directive information entity
http://purl.obolibrary.org/obo/IAO_0000064 # algorithm
http://purl.obolibrary.org/obo/IAO_0000088 # report
http://purl.obolibrary.org/obo/IAO_0000100 # data set
http://purl.obolibrary.org/obo/IAO_0000104 # plan specification
http://purl.obolibrary.org/obo/IAO_0000300 # textual entity
http://purl.obolibrary.org/obo/IAO_0000310 # document
http://purl.obolibrary.org/obo/IAO_0000590 # written name
http://purl.obolibrary.org/obo/IAO_0000233 # term tracker item

http://purl.obolibrary.org/obo/IAO_0006011 # may be identical to
14 changes: 7 additions & 7 deletions oeo-imports/omo/omo-w-hierarchy.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
http://purl.obolibrary.org/obo/IAO_0000027
http://purl.obolibrary.org/obo/IAO_0000112
http://purl.obolibrary.org/obo/IAO_0000115
http://purl.obolibrary.org/obo/IAO_0000116
http://purl.obolibrary.org/obo/IAO_0000118
http://purl.obolibrary.org/obo/IAO_0000119
http://purl.obolibrary.org/obo/IAO_0006011
http://purl.obolibrary.org/obo/IAO_0000027 # data item
http://purl.obolibrary.org/obo/IAO_0000112 # example of usage
http://purl.obolibrary.org/obo/IAO_0000115 # definition
http://purl.obolibrary.org/obo/IAO_0000116 # editor note
http://purl.obolibrary.org/obo/IAO_0000118 # alternative label
http://purl.obolibrary.org/obo/IAO_0000119 # definition source
http://purl.obolibrary.org/obo/IAO_0006011 # may be identical to