Skip to content

Commit

Permalink
Merge pull request #16 from VirtualFlyBrain/base-imports
Browse files Browse the repository at this point in the history
Base imports
  • Loading branch information
Clare72 authored Oct 26, 2023
2 parents d4b2ce2 + 8456e04 commit 3caf213
Show file tree
Hide file tree
Showing 28 changed files with 8,671 additions and 20,760 deletions.
452 changes: 0 additions & 452 deletions imports/caro_import.owl

This file was deleted.

2,481 changes: 0 additions & 2,481 deletions imports/fbbt_import.owl

This file was deleted.

892 changes: 643 additions & 249 deletions src/ontology/imports/ro_import.owl → imports/merged_import.owl

Large diffs are not rendered by default.

153 changes: 0 additions & 153 deletions imports/obi_import.owl

This file was deleted.

55 changes: 30 additions & 25 deletions src/ontology/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ----------------------------------------
# Makefile for vfbext
# Generated using ontology-development-kit
# ODK Version: v1.4.1
# ODK Version: v1.4.3
# ----------------------------------------
# IMPORTANT: DO NOT EDIT THIS FILE. To override default make goals, use vfbext.Makefile instead

Expand Down Expand Up @@ -43,7 +43,7 @@ REPORT_PROFILE_OPTS =
OBO_FORMAT_OPTIONS =
SPARQL_VALIDATION_CHECKS = owldef-self-reference iri-range label-with-iri multiple-replaced_by
SPARQL_EXPORTS = basic-report class-count-by-prefix edges xrefs obsoletes synonyms
ODK_VERSION_MAKEFILE = v1.4.1
ODK_VERSION_MAKEFILE = v1.4.3

TODAY ?= $(shell date +%Y-%m-%d)
OBODATE ?= $(shell date +'%d:%m:%Y %H:%M')
Expand Down Expand Up @@ -110,7 +110,7 @@ all_main: $(MAIN_FILES)

IMPORTS = ro caro fbbt obi

IMPORT_ROOTS = $(patsubst %, $(IMPORTDIR)/%_import, $(IMPORTS))
IMPORT_ROOTS = $(IMPORTDIR)/merged_import
IMPORT_OWL_FILES = $(foreach n,$(IMPORT_ROOTS), $(n).owl)
IMPORT_FILES = $(IMPORT_OWL_FILES)

Expand Down Expand Up @@ -208,7 +208,7 @@ ASSETS = \
$(MAPPING_FILES)

RELEASE_ASSETS = \
$(MAIN_FILES) \
$(MAIN_FILES) $(IMPORT_FILES) \
$(SUBSET_FILES)

.PHONY: all_assets
Expand Down Expand Up @@ -306,30 +306,28 @@ $(IMPORTDIR)/%_terms_combined.txt: $(IMPORTSEED) $(IMPORTDIR)/%_terms.txt
if [ $(IMP) = true ]; then cat $^ | grep -v ^# | sort | uniq > $@; fi


ALL_TERMS_COMBINED = $(patsubst %, $(IMPORTDIR)/%_terms_combined.txt, $(IMPORTS))
$(IMPORTDIR)/merged_terms_combined.txt: $(ALL_TERMS_COMBINED)
if [ $(IMP) = true ]; then cat $^ | grep -v ^# | sort | uniq > $@; fi


$(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/%.owl $(IMPORTDIR)/%_terms_combined.txt
if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \
extract -T $(IMPORTDIR)/$*_terms_combined.txt --force true --copy-ontology-annotations true --individuals include --method BOT \
$(IMPORTDIR)/merged_import.owl: $(MIRRORDIR)/merged.owl $(IMPORTDIR)/merged_terms_combined.txt
if [ $(IMP) = true ]; then $(ROBOT) merge -i $< \
extract -T $(IMPORTDIR)/merged_terms_combined.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 \
$(ANNOTATE_CONVERT_FILE); fi

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

## Module for ontology: caro

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

$(IMPORTDIR)/obi_import.owl: $(MIRRORDIR)/obi.owl $(IMPORTDIR)/obi_terms_combined.txt
$(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/merged.owl $(IMPORTDIR)/%_terms_combined.txt
if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \
extract -T $(IMPORTDIR)/obi_terms_combined.txt --copy-ontology-annotations true --force true --method BOT \
remove --base-iri $(URIBASE)/OBI --axioms external --preserve-structure false --trim false \
query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru \
remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) -T $(IMPORTDIR)/obi_terms_combined.txt --select complement --select "classes individuals annotation-properties" \
extract -T $(IMPORTDIR)/$*_terms_combined.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 \
$(ANNOTATE_CONVERT_FILE); fi

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


.PHONY: refresh-imports
refresh-imports:
Expand Down Expand Up @@ -365,37 +363,44 @@ IMP_LARGE=true # Global parameter to bypass handling of large imports
.PHONY: mirror-ro
.PRECIOUS: $(MIRRORDIR)/ro.owl
mirror-ro: | $(TMPDIR)
if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/ro.owl --create-dirs -o $(MIRRORDIR)/ro.owl --retry 4 --max-time 200 &&\
$(ROBOT) convert -i $(MIRRORDIR)/ro.owl -o $@.tmp.owl &&\
mv $@.tmp.owl $(TMPDIR)/$@.owl; fi
if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/ro/ro-base.owl --create-dirs -o $(MIRRORDIR)/ro.owl --retry 4 --max-time 200 &&\
$(ROBOT) convert -i $(MIRRORDIR)/ro.owl -o $@.tmp.owl && mv $@.tmp.owl $(TMPDIR)/$@.owl; fi


## ONTOLOGY: caro
.PHONY: mirror-caro
.PRECIOUS: $(MIRRORDIR)/caro.owl
mirror-caro: | $(TMPDIR)
if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/caro.owl --create-dirs -o $(MIRRORDIR)/caro.owl --retry 4 --max-time 200 &&\
$(ROBOT) convert -i $(MIRRORDIR)/caro.owl -o $@.tmp.owl &&\
$(ROBOT) convert -i $(MIRRORDIR)/caro.owl -o $@.tmp.owl && \
$(ROBOT) remove -i $@.tmp.owl --base-iri http://purl.obolibrary.org/obo/CARO_ --axioms external --preserve-structure false --trim false -o $@.tmp.owl &&\
mv $@.tmp.owl $(TMPDIR)/$@.owl; fi


## ONTOLOGY: fbbt
.PHONY: mirror-fbbt
.PRECIOUS: $(MIRRORDIR)/fbbt.owl
mirror-fbbt: | $(TMPDIR)
if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/fbbt.owl --create-dirs -o $(MIRRORDIR)/fbbt.owl --retry 4 --max-time 200 &&\
$(ROBOT) convert -i $(MIRRORDIR)/fbbt.owl -o $@.tmp.owl &&\
mv $@.tmp.owl $(TMPDIR)/$@.owl; fi
if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/fbbt/fbbt-base.owl --create-dirs -o $(MIRRORDIR)/fbbt.owl --retry 4 --max-time 200 &&\
$(ROBOT) convert -i $(MIRRORDIR)/fbbt.owl -o $@.tmp.owl && mv $@.tmp.owl $(TMPDIR)/$@.owl; fi


## ONTOLOGY: obi
.PHONY: mirror-obi
.PRECIOUS: $(MIRRORDIR)/obi.owl
mirror-obi: | $(TMPDIR)
if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/obi.owl --create-dirs -o $(MIRRORDIR)/obi.owl --retry 4 --max-time 200 &&\
$(ROBOT) convert -i $(MIRRORDIR)/obi.owl -o $@.tmp.owl &&\
$(ROBOT) convert -i $(MIRRORDIR)/obi.owl -o $@.tmp.owl && \
$(ROBOT) remove -i $@.tmp.owl --base-iri http://purl.obolibrary.org/obo/OBI_ --axioms external --preserve-structure false --trim false -o $@.tmp.owl &&\
mv $@.tmp.owl $(TMPDIR)/$@.owl; fi

ALL_MIRRORS = $(patsubst %, $(MIRRORDIR)/%.owl, $(IMPORTS))
MERGE_MIRRORS = true

$(MIRRORDIR)/merged.owl: $(ALL_MIRRORS)
if [ $(IMP) = true ] && [ $(MERGE_MIRRORS) = true ]; then $(ROBOT) merge $(patsubst %, -i %, $^) -o $@; fi
.PRECIOUS: $(MIRRORDIR)/merged.owl


$(MIRRORDIR)/%.owl: mirror-% | $(MIRRORDIR)
if [ $(IMP) = true ] && [ $(MIR) = true ] && [ -f $(TMPDIR)/mirror-$*.owl ]; then if cmp -s $(TMPDIR)/mirror-$*.owl $@ ; then echo "Mirror identical, ignoring."; else echo "Mirrors different, updating." &&\
Expand Down
6 changes: 1 addition & 5 deletions src/ontology/catalog-v001.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog prefer="public" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/vfbext/imports/ro_import.owl" uri="imports/ro_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/vfbext/imports/caro_import.owl" uri="imports/caro_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/vfbext/imports/fbbt_import.owl" uri="imports/fbbt_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/vfbext/imports/obi_import.owl" uri="imports/obi_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/vfbext/patterns/definitions.owl" uri="../patterns/definitions.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/vfbext/imports/merged_import.owl" uri="imports/merged_import.owl"/>
<group id="Folder Repository, directory=, recursive=false, Auto-Update=false, version=2" prefer="public" xml:base=""/>
</catalog>
Loading

0 comments on commit 3caf213

Please sign in to comment.