Skip to content
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
2 changes: 1 addition & 1 deletion docs/odk-workflows/RepositoryFileStructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ These are the current imports in NMRCV
| omo | http://purl.obolibrary.org/obo/omo.owl | mirror |
| iao | http://purl.obolibrary.org/obo/iao.owl | None |
| obi | http://purl.obolibrary.org/obo/obi.owl | custom |
| chebi | http://purl.obolibrary.org/obo/chebi.owl | None |
| chebi | http://purl.obolibrary.org/obo/chebi.owl | custom |

## Components
Components, in contrast to imports, are considered full members of the ontology. This means that any axiom in a component is also included in the ontology base - which means it is considered _native_ to the ontology. While this sounds complicated, consider this: conceptually, no component should be part of more than one ontology. If that seems to be the case, we are most likely talking about an import. Components are often not needed for ontologies, but there are some use cases:
Expand Down
9 changes: 3 additions & 6 deletions src/ontology/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# More information: https://github.com/INCATools/ontology-development-kit/

# Fingerprint of the configuration file when this Makefile was last generated
CONFIG_HASH= 1ba644404ead28f12b159a84d638daf10791c394ce2f9060998152d134df9dcc
CONFIG_HASH= fd98f62cea8e98a347fcdcf420367f85a1508e39fd0bcd97b7b3b1b954831e0b


# ----------------------------------------
Expand Down Expand Up @@ -382,11 +382,8 @@ $(IMPORTDIR)/obi_import.owl: $(MIRRORDIR)/obi.owl
echo "ERROR: You have configured your default module type to be custom; this behavior needs to be overwritten in nmrCV.Makefile!" && false
## Module for ontology: chebi

$(IMPORTDIR)/chebi_import.owl: $(MIRRORDIR)/chebi.owl $(IMPORTDIR)/chebi_terms_combined.txt
if [ $(IMP) = true ] && [ $(IMP_LARGE) = true ]; then $(ROBOT) extract -i $< -T $(IMPORTDIR)/chebi_terms_combined.txt --force true --copy-ontology-annotations true --individuals include --method BOT \
query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \
$(ANNOTATE_CONVERT_FILE); fi

$(IMPORTDIR)/chebi_import.owl: $(MIRRORDIR)/chebi.owl
echo "ERROR: You have configured your default module type to be custom; this behavior needs to be overwritten in nmrCV.Makefile!" && false

.PHONY: refresh-imports
refresh-imports:
Expand Down
10,825 changes: 228 additions & 10,597 deletions src/ontology/imports/chebi_import.owl

Large diffs are not rendered by default.

29 changes: 27 additions & 2 deletions src/ontology/imports/chebi_terms.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# needed root terms
CHEBI:33250 # atom
CHEBI:33252 # atomic nucleus
CHEBI:59999 # 'chemical substance'
CHEBI:23367 # 'molecular entity'
CHEBI:36357 # polyatomic entity
CHEBI:33579 # main group molecular entity
CHEBI:24835 # inorganic molecular entity
CHEBI:33259 # elemental molecular entity
CHEBI:33497 # transition element molecular entity
CHEBI:35568 # mancude ring
CHEBI:24870 # ion

# object relations for needed axioms
BFO:0000051 # 'has part'
RO:0000087 # 'has role'

# needed roles
CHEBI:51086 # 'chemical role'
CHEBI:197449 # NMR solvent
CHEBI:228364 # NMR chemical shift reference compound
CHEBI:67137 # NMR shift reagent

CHEBI:139358 # isotopically modified compound
CHEBI:76107 # deuterated compound

CHEBI:156265 # methanol-d4
CHEBI:193038 # acetonitrile-d3
CHEBI:193039 # benzene-d6
Expand All @@ -24,7 +50,6 @@ CHEBI:41981 # dideuterium oxide
CHEBI:48236 # trichlorofluoromethane
CHEBI:78217 # acetone d6
CHEBI:85365 # deuterated chloroform
CHEBI:197449 # NMR solvent
CHEBI:36810 # (trifluoromethyl)benzene
CHEBI:38585 # 1,4-difluorobenzene
CHEBI:47032 # 1,4-dioxane
Expand Down Expand Up @@ -112,7 +137,7 @@ CHEBI:176578 # cobalt-59 atom
# TODO: add gallium atom isotopes
CHEBI:52758 # germanium-73 atom
CHEBI:176584 # arsenic-75 atom
CHEBI:52457 # CHEBI:52457
CHEBI:52457 # selenium-77 atom
CHEBI:52743 # bromine-79 atom
# TODO: add bromine atom isotopes
# TODO: add krypton atom isotopes
Expand Down
38 changes: 20 additions & 18 deletions src/ontology/nmrCV-edit.owl
Original file line number Diff line number Diff line change
Expand Up @@ -3868,10 +3868,11 @@ AnnotationAssertion(dce:source <http://nmrML.org/nmrCV#NMR:1000329> "http://www.
AnnotationAssertion(rdfs:label <http://nmrML.org/nmrCV#NMR:1000329> "AB multiplet pattern"@en)
SubClassOf(<http://nmrML.org/nmrCV#NMR:1000329> <http://nmrML.org/nmrCV#NMR:1400305>)

# Class: <http://nmrML.org/nmrCV#NMR:1000330> (NMR solvent)
# Class: <http://nmrML.org/nmrCV#NMR:1000330> (NMR solvent (molecular entity))

AnnotationAssertion(obo:IAO_0000111 <http://nmrML.org/nmrCV#NMR:1000330> "NMR solvent"@en)
AnnotationAssertion(obo:IAO_0000115 <http://nmrML.org/nmrCV#NMR:1000330> "A molecular entity that is used as a solvent in nuclear magnetic resonance (NMR) spectroscopy"@en)
AnnotationAssertion(rdfs:label <http://nmrML.org/nmrCV#NMR:1000330> "NMR solvent"@en)
AnnotationAssertion(Annotation(skos:editorialNote "We needed to add material entity in the label to avoid clashes with the similary labeled role class in CHEBI."@en) rdfs:label <http://nmrML.org/nmrCV#NMR:1000330> "NMR solvent (molecular entity)"@en)
EquivalentClasses(<http://nmrML.org/nmrCV#NMR:1000330> ObjectIntersectionOf(obo:CHEBI_23367 ObjectSomeValuesFrom(obo:RO_0000087 obo:CHEBI_197449)))
SubClassOf(Annotation(oboInOwl:is_inferred "true") <http://nmrML.org/nmrCV#NMR:1000330> obo:CHEBI_23367)

Expand Down Expand Up @@ -6743,10 +6744,6 @@ SubClassOf(<http://nmrML.org/nmrCV#NMR:1400320> <http://nmrML.org/nmrCV#NMR:1400
AnnotationAssertion(rdfs:label <http://nmrML.org/nmrCV#NMR:1400321> "Bruker WIN NMR format")
SubClassOf(<http://nmrML.org/nmrCV#NMR:1400321> <http://nmrML.org/nmrCV#NMR:1400285>)

# Class: obo:BFO_0000023 (role)

EquivalentClasses(obo:BFO_0000023 obo:CHEBI_50906)

# Class: obo:CHEBI_156265 (methanol-d4)

SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_156265 <http://nmrML.org/nmrCV#NMR:1000330>)
Expand Down Expand Up @@ -6880,13 +6877,9 @@ SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_229457 <http://nmrM

SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_229458 <http://nmrML.org/nmrCV#NMR:1400033>)

# Class: obo:CHEBI_24431 (chemical entity)

SubClassOf(obo:CHEBI_24431 obo:BFO_0000040)
# Class: obo:CHEBI_23367 (molecular entity)

# Class: obo:CHEBI_24432 (biological role)

SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_24432 obo:BFO_0000023)
SubClassOf(obo:CHEBI_23367 obo:BFO_0000040)

# Class: obo:CHEBI_26078 (phosphoric acid)

Expand Down Expand Up @@ -6934,7 +6927,15 @@ SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_33093 <http://nmrML

# Class: obo:CHEBI_33232 (application)

SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_33232 obo:BFO_0000023)
SubClassOf(obo:CHEBI_33232 obo:BFO_0000023)

# Class: obo:CHEBI_33250 (atom)

SubClassOf(obo:CHEBI_33250 obo:BFO_0000040)

# Class: obo:CHEBI_33252 (atomic nucleus)

SubClassOf(obo:CHEBI_33252 obo:BFO_0000040)

# Class: obo:CHEBI_33681 (helium(0))

Expand Down Expand Up @@ -6973,6 +6974,7 @@ SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_39429 <http://nmrML
# Class: obo:CHEBI_41981 (dideuterium oxide)

SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_41981 <http://nmrML.org/nmrCV#NMR:1000330>)
SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_41981 <http://nmrML.org/nmrCV#NMR:1400033>)

# Class: obo:CHEBI_45892 (trifluoroacetic acid)

Expand All @@ -6999,13 +7001,9 @@ SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_47032 <http://nmrML
SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_48236 <http://nmrML.org/nmrCV#NMR:1000330>)
SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_48236 <http://nmrML.org/nmrCV#NMR:1400033>)

# Class: obo:CHEBI_50906 (role)

SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_50906 obo:BFO_0000017)

# Class: obo:CHEBI_51086 (chemical role)

SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_51086 obo:BFO_0000023)
SubClassOf(obo:CHEBI_51086 obo:BFO_0000023)

# Class: obo:CHEBI_5115 (monofluorobenzene)

Expand All @@ -7019,6 +7017,10 @@ SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_55317 <http://nmrML

SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_59606 <http://nmrML.org/nmrCV#NMR:1400033>)

# Class: obo:CHEBI_59999 (chemical substance)

SubClassOf(obo:CHEBI_59999 obo:BFO_0000040)

# Class: obo:CHEBI_63005 (sodium nitrate)

SubClassOf(Annotation(oboInOwl:is_inferred "true") obo:CHEBI_63005 <http://nmrML.org/nmrCV#NMR:1400033>)
Expand Down
2 changes: 2 additions & 0 deletions src/ontology/nmrCV-odk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ import_group:
- id: chebi
is_large: true
use_gzipped: true
# Using ROBOT filter in chmo.Makefile because the default ODK ROBOT extract method pulls in too much from CHEBI.
module_type: custom

30 changes: 29 additions & 1 deletion src/ontology/nmrCV.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,32 @@ $(IMPORTDIR)/obi_import.owl: $(MIRRORDIR)/obi.owl $(IMPORTDIR)/obi_terms.txt
extract -T $(IMPORTDIR)/obi_terms.txt --force true --copy-ontology-annotations true --individuals exclude --method BOT \
query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \
remove -T $(IMPORTDIR)/obi_remove_list.txt --select "self descendants instances" --signature true \
$(ANNOTATE_CONVERT_FILE); fi
$(ANNOTATE_CONVERT_FILE); fi


## Module for ontology: chebi

# We use ROBOT filter instead of the default ODK ROBOT extract method because the latter pulls in too much from ChEBI.
# Using ROBOT filter like this allows us to only import the terms we need under their very general CHEBI 'root' parents.
# This ROBOT filter approach entails, that not all axioms of the imported terms are imported as well,
# e.g. currently only 'part of' and 'has role' relations between the terms specified in the chebi_import.txt are
# imported.
# If other axioms are needed in the future the nmrCV editors need to make sure to include the needed object properties
# and classes used in these, which is quite a time consuming task, but needed, as ROBOT extract pulls in too much
# and the CHEBI module would otherwise be too big to load.
# Since we also define classes based on the roles borne by some CHEBI terms, e.g. a 'chemical shift reference compound'
# is equivalent to "'molecular entity' and ('has role' some ''NMR chemical shift reference compound [role]')"
# we additionally run a reasoning step to materialize the subclassOf axioms needed to group these CHEBI terms under
# the classes we define.

$(IMPORTDIR)/chebi_import.owl: $(MIRRORDIR)/chebi.owl $(IMPORTDIR)/chebi_terms_combined.txt
if [ $(IMP) = true ] && [ $(IMP_LARGE) = true ]; then $(ROBOT) \
filter -i $< -T $(IMPORTDIR)/chebi_terms_combined.txt --signature false --select "annotations self" \
--exclude-term http://purl.obolibrary.org/obo/CHEBI_24431 \
--exclude-term http://purl.obolibrary.org/obo/CHEBI_24432 \
--exclude-term http://purl.obolibrary.org/obo/CHEBI_50906 \
query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru \
--update ../sparql/postprocess-module.ru \
$(ANNOTATE_CONVERT_FILE); fi
$(ROBOT) reason --reasoner ELK -i $(SRC) --exclude-duplicate-axioms true --exclude-tautologies all --equivalent-classes-allowed asserted-only \
--annotate-inferred-axioms true --axiom-generators "SubClass" convert -f ofn --output $(SRC)