Skip to content

Commit 8b231a9

Browse files
authored
Merge pull request #4 from OpenEnergyPlatform/feature-tidy-iao-import
tidy oeo imports
2 parents 02a45e1 + b1cd5d4 commit 8b231a9

File tree

7 files changed

+3811
-38
lines changed

7 files changed

+3811
-38
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Note: For consistent results run with ROBOT v1.91 or higher
2+
# Download the IAO release from 2022-11-07
3+
curl -L https://raw.githubusercontent.com/information-artifact-ontology/IAO/v2022-11-07/iao.owl > iao-full-download.owl
4+
# Extract the terms we want with hierarchy, This removes the domain of IAO_0000136
5+
robot merge --input iao-full-download.owl extract --method MIREOT --lower-terms iao-w-hierarchy.txt --intermediates all --output iao-module-temp.owl
6+
# Remove subclass axioms from BFO classes
7+
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
8+
# Extract domain of IAO_0000136
9+
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
10+
# Extracted module
11+
robot merge --input iao-module-temp.owl --input iao-extracted-domain.owl --output ../../ontology/imports/iao-extracted.owl
12+
# Remove subproperty axioms
13+
robot remove --input ../../ontology/imports/iao-extracted.owl --axioms subproperty --output ../../ontology/imports/iao-extracted.owl
14+
# Annotates the output with a commentary to the origin of the content
15+
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
16+
# Annotates each axiom with the ontology IRI, using prov:wasDerivedFrom
17+
robot annotate --input ../../ontology/imports/iao-extracted.owl --annotate-derived-from true --annotate-defined-by true --output ../../ontology/imports/iao-extracted.owl
18+
# Annotate with new ontology information
19+
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
20+
rm iao-full-download.owl
21+
rm iao-extracted-domain.owl
22+
rm iao-module-temp.owl
File renamed without changes.

oeo-imports/iao/extract-iao-module.sh

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
# Note: For consistent results run with ROBOT v1.91 or higher
22
# Download the IAO release from 2022-11-07
33
curl -L https://raw.githubusercontent.com/information-artifact-ontology/IAO/v2022-11-07/iao.owl > iao-full-download.owl
4-
# Extract the terms we want with hierarchy, This removes the domain of IAO_0000136
5-
robot merge --input iao-full-download.owl extract --method MIREOT --lower-terms iao-w-hierarchy.txt --intermediates all --output iao-module-temp.owl
6-
# Remove subclass axioms from BFO classes
7-
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
8-
# Extract domain of IAO_0000136
9-
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
10-
# Extracted module
11-
robot merge --input iao-module-temp.owl --input iao-extracted-domain.owl --output ../../ontology/imports/iao-extracted.owl
12-
# Remove subproperty axioms
13-
robot remove --input ../../ontology/imports/iao-extracted.owl --axioms subproperty --output ../../ontology/imports/iao-extracted.owl
14-
# Annotates the output with a commentary to the origin of the content
15-
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
4+
# Extract the terms we want with hierarchy until the upper term "information content entity" (IAO_0000030).
5+
# Warning: This removes the domain of IAO_0000136 -- tbd in oeo-import-edits
6+
# Classification: tbd in oeo-import-edits
7+
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
8+
# Extract the terms we want without hierarchy
9+
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
10+
# Create Extracted module and annotate with new ontology information
11+
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
12+
# Annotates the output module with a commentary to the origin of the content
13+
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
1614
# Annotates each axiom with the ontology IRI, using prov:wasDerivedFrom
17-
robot annotate --input ../../ontology/imports/iao-extracted.owl --annotate-derived-from true --annotate-defined-by true --output ../../ontology/imports/iao-extracted.owl
18-
# Annotate with new ontology information
19-
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
15+
robot annotate --input iao-extracted.owl --annotate-derived-from true --annotate-defined-by true --output iao-extracted.owl
16+
## Annotate with new ontology information
17+
#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
2018
rm iao-full-download.owl
21-
rm iao-extracted-domain.owl
22-
rm iao-module-temp.owl
19+
rm iao-extracted-w-hierarchy.owl
20+
rm iao-extracted-n-hierarchy.owl

0 commit comments

Comments
 (0)