Skip to content

Commit

Permalink
Merge pull request #4 from OpenEnergyPlatform/feature-tidy-iao-import
Browse files Browse the repository at this point in the history
tidy oeo imports
  • Loading branch information
stap-m authored Dec 1, 2023
2 parents 02a45e1 + b1cd5d4 commit 8b231a9
Show file tree
Hide file tree
Showing 7 changed files with 3,811 additions and 38 deletions.
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

0 comments on commit 8b231a9

Please sign in to comment.