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 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
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
File renamed without changes.
32 changes: 15 additions & 17 deletions oeo-imports/iao/extract-iao-module.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# 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 "information content entity" (IAO_0000030).
# Warning: This removes the domain of IAO_0000136 -- tbd in oeo-import-edits
# Classification: tbd in oeo-import-edits
robot merge --input iao-full-download.owl extract --method MIREOT --lower-terms iao-w-hierarchy.txt --intermediates all --upper-term http://purl.obolibrary.org/obo/IAO_0000030 --output iao-extracted-w-hierarchy.owl
# Extract the terms we want without hierarchy
robot merge --input iao-full-download.owl extract --method MIREOT --lower-terms iao-n-hierarchy.txt --upper-term owl:topObjectProperty --intermediates none --output iao-extracted-n-hierarchy.owl
# Create Extracted module and annotate with new ontology information
robot merge --input iao-extracted-w-hierarchy.owl --input iao-extracted-n-hierarchy.owl annotate --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 iao-extracted.owl
# Annotates the output module with a commentary to the origin of the content
robot annotate --input 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 from the list of selected terms (iao-extract-w-hierarchy.txt, iao-extract-n-hierarchy.txt) located in the OEO-tools repository." --output 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
robot annotate --input iao-extracted.owl --annotate-derived-from true --annotate-defined-by true --output iao-extracted.owl
## Annotate with new ontology information
#robot annotate --input 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 iao-extracted.owl
rm iao-full-download.owl
rm iao-extracted-domain.owl
rm iao-module-temp.owl
rm iao-extracted-w-hierarchy.owl
rm iao-extracted-n-hierarchy.owl
Loading