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

Build the “composite“ life stages ontology directly in Uberon #3443

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ composite-metazoan.*
composite-metazoan-basic.*
composite-vertebrate.*
composite-vertebrate-basic.*
composite-lifestages.*
collected-metazoan.*
collected-lifestages.*
ext.json
ext.obo
ext.owl
Expand Down
36 changes: 29 additions & 7 deletions src/ontology/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ----------------------------------------
# Makefile for uberon
# Generated using ontology-development-kit
# ODK Version: v1.5.2
# ODK Version: v1.5.4
# ----------------------------------------
# IMPORTANT: DO NOT EDIT THIS FILE. To override default make goals, use uberon.Makefile instead

Expand All @@ -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= 60e47a069bd32a71a48c480dcf88b75d116c5eef7d1f9a55073500ff79968b28
CONFIG_HASH= 2280340b1810b2a972296e0c511d5e87711793855300136263ac0b8801de9cf3


# ----------------------------------------
Expand Down Expand Up @@ -47,7 +47,7 @@ REPORT_PROFILE_OPTS = --profile $(ROBOT_PROFILE)
OBO_FORMAT_OPTIONS =
SPARQL_VALIDATION_CHECKS = equivalent-classes owldef-self-reference illegal-annotation-property taxon-range orcid-contributor obsolete-replaced_by xrefs-mesh-pattern label-synonym-polysemy id-format
SPARQL_EXPORTS = basic-report
ODK_VERSION_MAKEFILE = v1.5.2
ODK_VERSION_MAKEFILE = v1.5.4

TODAY ?= $(shell date +%Y-%m-%d)
OBODATE ?= $(shell date +'%d:%m:%Y %H:%M')
Expand All @@ -65,13 +65,13 @@ PATTERN_RELEASE_FILES= $(PATTERNDIR)/definitions.owl $(PATTERNDIR)/pattern.
MAPPINGDIR= ../mappings
MAPPING_TESTER= sssom validate
SSSOMPY= sssom
MAPPINGS= fbbt cl biomappings uberon-local uberon import-corrections
MAPPINGS= fbbt cl sslso biomappings uberon-local uberon import-corrections
MAPPING_RELEASE_FILES= $(foreach n,$(MAPPINGS), $(MAPPINGDIR)/$(n).sssom.tsv)


FORMATS = $(sort owl obo json owl)
FORMATS_INCL_TSV = $(sort $(FORMATS) tsv)
RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-full $(ONT)-simple $(ONT)-basic collected-metazoan composite-metazoan composite-metazoan-basic composite-vertebrate composite-vertebrate-basic common-anatomy )
RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-full $(ONT)-simple $(ONT)-basic collected-metazoan composite-metazoan composite-metazoan-basic composite-vertebrate composite-vertebrate-basic collected-lifestages composite-lifestages common-anatomy )

ifeq ($(ODK_DEBUG),yes)
ODK_DEBUG_FILE = debug.log
Expand Down Expand Up @@ -154,7 +154,7 @@ $(ROBOT_PLUGINS_DIRECTORY)/%.jar:
# Specific rules for supplementary plugins defined in configuration

$(ROBOT_PLUGINS_DIRECTORY)/uberon.jar:
curl -L -o $@ https://github.com/gouttegd/uberon-robot-plugin/releases/download/uberon-robot-plugin-0.3.1/uberon.jar
curl -L -o $@ https://github.com/gouttegd/uberon-robot-plugin/releases/download/uberon-robot-plugin-0.3.2/uberon.jar


# ----------------------------------------
Expand Down Expand Up @@ -202,7 +202,7 @@ all_subsets: $(SUBSET_FILES)
# ----------------------------------------


MAPPINGS = fbbt cl biomappings uberon-local uberon import-corrections
MAPPINGS = fbbt cl sslso biomappings uberon-local uberon import-corrections

MAPPING_FILES = $(patsubst %, $(MAPPINGDIR)/%.sssom.tsv, $(MAPPINGS))

Expand Down Expand Up @@ -756,6 +756,10 @@ $(MAPPINGDIR)/fbbt.sssom.tsv:
$(MAPPINGDIR)/cl.sssom.tsv:
test -f $@

# This mappingset is manually curated, so we only check that the file actually exists.
$(MAPPINGDIR)/sslso.sssom.tsv:
test -f $@

# This mappingset is manually curated, so we only check that the file actually exists.
$(MAPPINGDIR)/biomappings.sssom.tsv:
test -f $@
Expand Down Expand Up @@ -836,6 +840,18 @@ composite-vertebrate-basic.json: composite-vertebrate-basic.owl
$(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
convert --check false -f json -o [email protected] &&\
mv [email protected] $@
collected-lifestages.obo: collected-lifestages.owl
$(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o [email protected] && grep -v ^owl-axioms [email protected] > $@ && rm [email protected]
collected-lifestages.json: collected-lifestages.owl
$(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
convert --check false -f json -o [email protected] &&\
mv [email protected] $@
composite-lifestages.obo: composite-lifestages.owl
$(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o [email protected] && grep -v ^owl-axioms [email protected] > $@ && rm [email protected]
composite-lifestages.json: composite-lifestages.owl
$(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
convert --check false -f json -o [email protected] &&\
mv [email protected] $@
common-anatomy.obo: common-anatomy.owl
$(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o [email protected] && grep -v ^owl-axioms [email protected] > $@ && rm [email protected]
common-anatomy.json: common-anatomy.owl
Expand Down Expand Up @@ -932,6 +948,12 @@ composite-vertebrate.owl:
composite-vertebrate-basic.owl:
echo "ERROR: You have configured a custom release artefact ($@); this release artefact needs to be define in uberon.Makefile!" && false

collected-lifestages.owl:
echo "ERROR: You have configured a custom release artefact ($@); this release artefact needs to be define in uberon.Makefile!" && false

composite-lifestages.owl:
echo "ERROR: You have configured a custom release artefact ($@); this release artefact needs to be define in uberon.Makefile!" && false

common-anatomy.owl:
echo "ERROR: You have configured a custom release artefact ($@); this release artefact needs to be define in uberon.Makefile!" && false
# ----------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions src/ontology/bridge/bridges.dispatch
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,6 @@ dc-contributor: Melissa Haendel

[zfs-uberon]
file: uberon-bridge-to-zfs.owl

[sslso-uberon]
file: uberon-bridge-to-sslso.owl
125 changes: 125 additions & 0 deletions src/ontology/bridge/bridges.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# SSSOM is OBO-agnostic and doesn't know about the implicit OBO prefix
# rule (PFX -> http://purl.obolibrary.org/obo/PFX_); *all* prefixes must
# be explicitly declared.
prefix AEO: <http://purl.obolibrary.org/obo/AEO_>
prefix BFO: <http://purl.obolibrary.org/obo/BFO_>
prefix BSPO: <http://purl.obolibrary.org/obo/BSPO_>
prefix CARO: <http://purl.obolibrary.org/obo/CARO_>
prefix CL: <http://purl.obolibrary.org/obo/CL_>
prefix GO: <http://purl.obolibrary.org/obo/GO_>
prefix IAO: <http://purl.obolibrary.org/obo/IAO_>
prefix NCBITaxon: <http://purl.obolibrary.org/obo/NCBITaxon_>
prefix NCIT: <http://purl.obolibrary.org/obo/NCIT_>
prefix OG: <http://purl.obolibrary.org/obo/OG_>
prefix OGES: <http://purl.obolibrary.org/obo/OGES_>
prefix OIO: <http://www.geneontology.org/formats/oboInOwl#>
prefix RO: <http://purl.obolibrary.org/obo/RO_>
prefix SCTID: <http://purl.obolibrary.org/obo/SCTID_>
prefix UBERON: <http://purl.obolibrary.org/obo/UBERON_>
%INSERT-TAX-SPECIFIC-PREFIXES

# Uberon may not contain declarations for all the taxa we bridge to, so
# to be on the safe side we declare all of them preventively.
%INSERT-TAX-SPECIFIC-DIRECTIVES

# The relation to use in the existential restrictions between Uberon/CL
# terms and their taxon-specific equivalents: part_of (BFO:0000050) for
# most cases, except for life stage terms where we use occurs_in
# (BFO:0000066) instead.
set_var("TAXREL", BFO:0000050);
is_a(%{object_id}, UBERON:0000104) -> set_var("TAXREL", BFO:0000066);
is_a(%{object_id}, UBERON:0000105) -> set_var("TAXREL", BFO:0000066);

# Make sure UBERON and CL classes are on the object side.
subject==UBERON:* || subject==CL:* -> invert();

# Ignore any mapping to something else than UBERON or CL.
!(object==UBERON:* || object==CL:*) -> stop();

# Ignore any mapping to an inexistent or obsolete UBERON/CL class.
!exists(%{object_id}) -> stop();

# Do not allow a same foreign term to be mapped with more than one UBERON/CL class.
!cardinality==*:1 -> stop();

# Ignore any mapping with a predicate other than those four.
!(predicate==skos:exactMatch
|| predicate==skos:narrowMatch
|| predicate==skos:broadMatch
|| predicate==semapv:crossSpeciesExactMatch) -> stop();

# Generate cross-reference annotations (for backward compatibility).
[xrefs] predicate==* -> annotate(%{object_id}, OIO:hasDbXref, "%{subject_id|short}");

# Bridging axiom-generating rules.
# The highly repetitive nature of those rules stems from the fact that
# we need separate rules for each foreign ontology and for both Uberon
# and CL, if we want to be able to send the corresponding axioms to
# separate bridge files.

# Taxon-neutral bridges.
[aeo-uberon] subject==AEO:* object==UBERON:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (AEO)");
predicate==skos:exactMatch -> create_axiom("%subject_id EquivalentTo: %object_id");
}
[aeo-cl] subject==AEO:* object==CL:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (AEO)");
predicate==skos:exactMatch -> create_axiom("%subject_id EquivalentTo: %object_id");
}

[bfo-uberon] subject==BFO:* object==UBERON:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (BFO)");
predicate==skos:narrowMatch -> create_axiom("%object_id SubClassOf: %subject_id");
}
[bfo-cl] subject==BFO:* object==CL:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (BFO)");
predicate==skos:narrowMatch -> create_axiom("%object_id SubClassOf: %subject_id");
}

[caro-uberon] subject==CARO:* object==UBERON:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (CARO)");
predicate==skos:exactMatch -> create_axiom("%subject_id EquivalentTo: %object_id");
}
[caro-cl] subject==CARO:* object==CL:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (CARO)");
predicate==skos:exactMatch -> create_axiom("%subject_id EquivalentTo: %object_id");
}

[go-uberon] subject==GO:* object==UBERON:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (GO)");
predicate==skos:exactMatch -> create_axiom("%subject_id EquivalentTo: %object_id");
}
[go-cl] subject==GO:* object==CL:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (GO)");
predicate==skos:exactMatch -> create_axiom("%subject_id EquivalentTo: %object_id");
}

[ncit-uberon] subject==NCIT:* object==UBERON:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (NCIT)");
predicate==skos:broadMatch -> create_axiom("%subject_id SubClassOf: %object_id");
}
[ncit-cl] subject==NCIT:* object==CL:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (NCIT)");
predicate==skos:broadMatch -> create_axiom("%subject_id SubClassOf: %object_id");
}

[oges-uberon] subject==OGES:* object==UBERON:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (OGES)");
predicate==skos:broadMatch -> create_axiom("%subject_id SubClassOf: %object_id");
}
[ncit-cl] subject==OGES:* object==CL:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (OGES)");
predicate==skos:broadMatch -> create_axiom("%subject_id SubClassOf: %object_id");
}

[sctid-uberon] subject==SCTID:* object==UBERON:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (SCTID)");
predicate==skos:broadMatch -> create_axiom("%subject_id SubClassOf: %object_id");
}
[sctid-cl] subject==SCTID:* object==CL:* {
predicate==* -> annotate(%{subject_id}, IAO:0000589, "%{object_label} (SCTID)");
predicate==skos:broadMatch -> create_axiom("%subject_id SubClassOf: %object_id");
}

# Taxon-specific bridges.
%INSERT-TAX-SPECIFIC-BRIDGES
112 changes: 0 additions & 112 deletions src/ontology/bridge/bridges.rules.m4

This file was deleted.

Loading
Loading