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

COB Revised #288

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
2,913 changes: 175 additions & 2,738 deletions cob-base.owl

Large diffs are not rendered by default.

1,456 changes: 0 additions & 1,456 deletions cob-full.owl

This file was deleted.

1,329 changes: 1,329 additions & 0 deletions cob-root.owl

Large diffs are not rendered by default.

1,073 changes: 444 additions & 629 deletions cob.owl

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions docs/odk-workflows/RepositoryFileStructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ These are the current imports in COB

| Import | URL | Type |
| ------ | --- | ---- |
| ro | http://purl.obolibrary.org/obo/ro.owl | custom |
| omo | http://purl.obolibrary.org/obo/omo.owl | mirror |

## 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 All @@ -26,9 +24,4 @@ Components, in contrast to imports, are considered full members of the ontology.
2. A part of the ontology is managed in ROBOT templates
3. The expressivity of the component is higher than the format of the edit file. For example, people still choose to manage their ontology in OBO format (they should not) missing out on a lot of owl features. They may choose to manage logic that is beyond OBO in a specific OWL component.

These are the components in COB

| Filename | URL |
| -------- | --- |
| cob-annotations.owl | None |
| cob-to-external.owl | None |
76 changes: 4 additions & 72 deletions src/ontology/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# 6. [Run everything (COB products and release pipeline)](all)

# Fingerprint of the configuration file when this Makefile was last generated
CONFIG_HASH= 5daef41d99e802417bd9ad0f378f72168e2d30f0488f5b2423330cbc561ec834
CONFIG_HASH= 0cb0824fc712dd1bbe3e3067c8a9d6d4212a769da65f9ec96e0020e31e2cafb9


# ----------------------------------------
Expand Down Expand Up @@ -62,13 +62,13 @@ OBODATE ?= $(shell date +'%d:%m:%Y %H:%M')
VERSION= $(TODAY)
ANNOTATE_ONTOLOGY_VERSION = annotate -V $(ONTBASE)/releases/$(VERSION)/$@ --annotation owl:versionInfo $(VERSION)
ANNOTATE_CONVERT_FILE = annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) convert -f ofn --output [email protected] && mv [email protected] $@
OTHER_SRC = $(COMPONENTSDIR)/cob-annotations.owl $(COMPONENTSDIR)/cob-to-external.owl
OTHER_SRC =
ONTOLOGYTERMS = $(TMPDIR)/ontologyterms.txt
EDIT_PREPROCESSED = $(TMPDIR)/$(ONT)-preprocess.owl

FORMATS = $(sort owl owl)
FORMATS_INCL_TSV = $(sort $(FORMATS) tsv)
RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-full cob-base-reasoned cob-examples-reasoned cob-native )
RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-root )

ifeq ($(ODK_DEBUG),yes)
ODK_DEBUG_FILE = debug.log
Expand Down Expand Up @@ -168,7 +168,7 @@ all_main: $(MAIN_FILES)
# ----------------------------------------


IMPORTS = ro omo
IMPORTS =

IMPORT_ROOTS = $(patsubst %, $(IMPORTDIR)/%_import, $(IMPORTS))
IMPORT_OWL_FILES = $(foreach n,$(IMPORT_ROOTS), $(n).owl)
Expand Down Expand Up @@ -375,16 +375,6 @@ $(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/%.owl $(IMPORTDIR)/%_terms_combined.txt

.PRECIOUS: $(IMPORTDIR)/%_import.owl

## Module for ontology: ro

$(IMPORTDIR)/ro_import.owl: $(MIRRORDIR)/ro.owl
echo "ERROR: You have configured your default module type to be custom; this behavior needs to be overwritten in cob.Makefile!" && false
## Module for ontology: omo

$(IMPORTDIR)/omo_import.owl: $(MIRRORDIR)/omo.owl $(IMPORTDIR)/omo_terms_combined.txt
if [ $(IMP) = true ]; then $(ROBOT) merge -i $< query --update ../sparql/preprocess-module.ru --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \
$(ANNOTATE_CONVERT_FILE); fi


.PHONY: refresh-imports
refresh-imports:
Expand All @@ -406,39 +396,6 @@ refresh-%:
no-mirror-refresh-%:
$(MAKE) IMP=true IMP_LARGE=true MIR=false PAT=false $(IMPORTDIR)/$*_import.owl -B


# ----------------------------------------
# Components
# ----------------------------------------
# Some ontologies contain external and internal components. A component is included in the ontology in its entirety.

COMP=true # Global parameter to bypass component generation

.PHONY: all_components
all_components: $(OTHER_SRC)

.PHONY: recreate-components
recreate-components:
$(MAKE) COMP=true IMP=false MIR=true PAT=true IMP_LARGE=false all_components -B

.PHONY: no-mirror-recreate-components
no-mirror-recreate-components:
$(MAKE) COMP=true IMP=false MIR=false PAT=true IMP_LARGE=false all_components -B

.PHONY: recreate-%
recreate-%:
$(MAKE) COMP=true IMP=false IMP_LARGE=false MIR=true PAT=true $(COMPONENTSDIR)/$*.owl -B

.PHONY: no-mirror-recreate-%
no-mirror-recreate-%:
$(MAKE) COMP=true IMP=false IMP_LARGE=false MIR=false PAT=true $(COMPONENTSDIR)/$*.owl -B

$(COMPONENTSDIR)/%.owl: | $(COMPONENTSDIR)
test -f $@ || touch $@
.PRECIOUS: $(COMPONENTSDIR)/%.owl



# ----------------------------------------
# Mirroring upstream ontologies
# ----------------------------------------
Expand All @@ -450,22 +407,6 @@ IMP_LARGE=true # Global parameter to bypass handling of large imports
ifeq ($(strip $(MIR)),true)


## ONTOLOGY: ro
.PHONY: mirror-ro
.PRECIOUS: $(MIRRORDIR)/ro.owl
mirror-ro: | $(TMPDIR)
curl -L $(OBOBASE)/ro.owl --create-dirs -o $(TMPDIR)/ro-download.owl --retry 4 --max-time 200 && \
$(ROBOT) convert -i $(TMPDIR)/ro-download.owl -o $(TMPDIR)/[email protected]


## ONTOLOGY: omo
.PHONY: mirror-omo
.PRECIOUS: $(MIRRORDIR)/omo.owl
mirror-omo: | $(TMPDIR)
curl -L $(OBOBASE)/omo.owl --create-dirs -o $(TMPDIR)/omo-download.owl --retry 4 --max-time 200 && \
$(ROBOT) convert -i $(TMPDIR)/omo-download.owl -o $(TMPDIR)/[email protected]


$(MIRRORDIR)/%.owl: mirror-% | $(MIRRORDIR)
if [ -f $(TMPDIR)/mirror-$*.owl ]; then if cmp -s $(TMPDIR)/mirror-$*.owl $@ ; then echo "Mirror identical, ignoring."; else echo "Mirrors different, updating." &&\
cp $(TMPDIR)/mirror-$*.owl $@; fi; fi
Expand Down Expand Up @@ -549,15 +490,6 @@ $(ONT)-full.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES)
relax \
reduce -r ELK \
$(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) --output [email protected] && mv [email protected] $@

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

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

cob-native.owl:
echo "ERROR: You have configured a custom release artefact ($@); this release artefact needs to be define in cob.Makefile!" && false
# ----------------------------------------
# Debugging Tools
# ----------------------------------------
Expand Down
Loading
Loading