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

Prepare for ODK 1.5 #1794

Merged
merged 7 commits into from
Mar 4, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
ontology_qc:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container: obolibrary/odkfull
container: obolibrary/odkfull:v1.5

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Run ontology QC checks
env:
DEFAULT_BRANCH: master
run: cd src/ontology && make IMP=false PAT=false prepare_release -B
run: cd src/ontology && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false PAT=false MIR=false

170 changes: 119 additions & 51 deletions src/ontology/Makefile

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions src/ontology/fbbt-odk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ id: fbbt
title: "Drosophila Anatomy Ontology"
github_org: FlyBase
repo: drosophila-anatomy-ontology
git_main_branch: master
use_env_file_docker: True
report_fail_on: none
use_dosdps: TRUE
Expand All @@ -11,6 +12,10 @@ pattern_pipelines_group:
dosdp_tools_options: "--obo-prefixes=true --restrict-axioms-to=logical"
- id: all-axioms
dosdp_tools_options: "--obo-prefixes=true"
robot_plugins:
plugins:
- name: flybase
mirror_from: https://github.com/FlyBase/flybase-robot-plugin/releases/download/flybase-robot-plugin-0.1.1/flybase.jar
namespaces:
- http://purl.obolibrary.org/obo/FBbt_
- http://purl.obolibrary.org/obo/fbbt_
Expand Down Expand Up @@ -40,6 +45,10 @@ import_group:
use_base_merging: TRUE
exclude_iri_patterns:
- <http://purl.obolibrary.org/obo/UBERON_*>
annotation_properties:
- RO:0002582
- rdfs:label
- IAO:0000115
products:
- id: go
make_base: TRUE
Expand Down
9 changes: 1 addition & 8 deletions src/ontology/fbbt.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ $(REPORTDIR)/onto_metrics_calc.txt: $(ONT)-simple.obo install_flybase_scripts
$(SCRIPTSDIR)/onto_metrics_calc.pl 'fly_anatomy.ontology' $(ONT)-simple.obo > $@

$(REPORTDIR)/chado_load_check_simple.txt: install_flybase_scripts fly_anatomy.obo
apt-get install -y --no-install-recommends libbusiness-isbn-perl
$(SCRIPTSDIR)/chado_load_checks.pl fly_anatomy.obo > $@

$(REPORTDIR)/obo_qc_%.obo.txt:
Expand Down Expand Up @@ -133,13 +132,7 @@ $(ONT)-full.obo: $(ONT)-full.owl
# special placeholder string to substitute in definitions from external ontologies
# FBbt only uses DOT definitions - to use SUB, copy code and sparql from FBcv.

export ROBOT_PLUGINS_DIRECTORY = $(TMPDIR)/plugins

$(ROBOT_PLUGINS_DIRECTORY)/flybase.jar:
mkdir -p $(ROBOT_PLUGINS_DIRECTORY)
curl -L -o $@ https://github.com/FlyBase/flybase-robot-plugin/releases/download/flybase-robot-plugin-0.1.0/flybase.jar

$(EDIT_PREPROCESSED): $(SRC) $(ROBOT_PLUGINS_DIRECTORY)/flybase.jar
$(EDIT_PREPROCESSED): $(SRC) all_robot_plugins
$(ROBOT) flybase:rewrite-def -i $< --dot-definitions --filter-prefix FBbt -o $@


Expand Down
36 changes: 34 additions & 2 deletions src/ontology/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ elif [ -f "$HOME/Library/Application Support/ontology-development-kit/github/tok
GH_TOKEN=$(cat "$HOME/Library/Application Support/ontology-development-kit/github/token")
fi

# SSH agent socket
# On macOS, we cannot use $SSH_AUTH_SOCK directly,
# we need to use a "magic" socket instead.
case "$(uname)" in
Darwin)
ODK_SSH_AUTH_SOCKET=/run/host-services/ssh-auth.sock
;;
*)
ODK_SSH_AUTH_SOCKET=$SSH_AUTH_SOCK
;;
esac
ODK_SSH_BIND=
if [ -n "$ODK_SSH_AUTH_SOCKET" ]; then
ODK_SSH_BIND=",$ODK_SSH_AUTH_SOCKET:/run/host-services/ssh-auth.sock"
fi

ODK_IMAGE=${ODK_IMAGE:-odkfull}
TAG_IN_IMAGE=$(echo $ODK_IMAGE | awk -F':' '{ print $2 }')
if [ -n "$TAG_IN_IMAGE" ]; then
Expand All @@ -42,16 +58,28 @@ ODK_TAG=${ODK_TAG:-latest}
ODK_JAVA_OPTS=${ODK_JAVA_OPTS:--Xmx8G}
ODK_DEBUG=${ODK_DEBUG:-no}

ODK_USER_ID=${ODK_USER_ID:-$(id -u)}
ODK_GROUP_ID=${ODK_GROUP_ID:-$(id -g)}

# Convert OWLAPI_* environment variables to the OWLAPI as Java options
# See http://owlcs.github.io/owlapi/apidocs_4/org/semanticweb/owlapi/model/parameters/ConfigurationOptions.html
# for a list of allowed options
OWLAPI_OPTIONS_NAMESPACE=org.semanticweb.owlapi.model.parameters.ConfigurationOptions
for owlapi_var in $(env | sed -n s/^OWLAPI_//p) ; do
ODK_JAVA_OPTS="$ODK_JAVA_OPTS -D$OWLAPI_OPTIONS_NAMESPACE.${owlapi_var%=*}=${owlapi_var#*=}"
done

TIMECMD=
if [ x$ODK_DEBUG = xyes ]; then
# If you wish to change the format string, take care of using
# non-breaking spaces (U+00A0) instead of normal spaces, to
# prevent the shell from tokenizing the format string.
echo "Running ${IMAGE} with ${ODK_JAVA_OPTS} of memory for ROBOT and Java-based pipeline steps."
echo "Running obolibrary/${ODK_IMAGE}:${ODK_TAG} with '${ODK_JAVA_OPTS}' as options for ROBOT and other Java-based pipeline steps."
TIMECMD="/usr/bin/time -f ### DEBUG STATS ###\nElapsed time: %E\nPeak memory: %M kb"
fi
rm -f tmp/debug.log

VOLUME_BIND=$PWD/../../:/work
VOLUME_BIND=$PWD/../../:/work$ODK_SSH_BIND
WORK_DIR=/work/src/ontology

if [ -n "$ODK_BINDS" ]; then
Expand All @@ -66,6 +94,10 @@ cat <<EOF > run.sh.env
ROBOT_JAVA_ARGS=$ODK_JAVA_OPTS
JAVA_OPTS=$ODK_JAVA_OPTS
GH_TOKEN=$GH_TOKEN
SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock
ODK_USER_ID=$ODK_USER_ID
ODK_GROUP_ID=$ODK_GROUP_ID
ODK_DEBUG=$ODK_DEBUG
EOF

if [ -n "$USE_SINGULARITY" ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/ontology/travis.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Running the DPO release pipeline for TRAVIS
set -e

sh run.sh make IMP=false PAT=false prepare_release -B
sh run.sh make MIR=false IMP=false PAT=false prepare_release -B
4 changes: 4 additions & 0 deletions src/scripts/run-command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
ODK_DEBUG_FILE=${ODK_DEBUG_FILE:-debug.log}
echo "Command: sh $@" >> $ODK_DEBUG_FILE
/usr/bin/time -a -o $ODK_DEBUG_FILE -f "Elapsed time: %E\nPeak memory: %M kb" /bin/sh "$@"
5 changes: 3 additions & 2 deletions src/scripts/update_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ cp target/$OID/src/ontology/run.sh $SRCDIR/ontology/
cp -r target/$OID/src/sparql/* $SRCDIR/sparql/
mkdir -p $ROOTDIR/.github
mkdir -p $ROOTDIR/.github/workflows
cp -n target/$OID/.github/workflows/qc.yml $ROOTDIR/.github/workflows/qc.yml
cp target/$OID/.github/workflows/qc.yml $ROOTDIR/.github/workflows/qc.yml




echo "WARNING: These files should be manually migrated: mkdocs.yaml, .gitignore, src/ontology/catalog.xml (if you added a new import or component)"
echo "WARNING: Your QC workflows have not been updated automatically. Please update the ODK version number(s) in .github/workflows/qc.yml."

echo "Ontology repository update successfully completed."
11 changes: 11 additions & 0 deletions src/sparql/dc-properties-violation.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The purpose of this violation is to make sure people update
# from using the deprecated DC Elements 1.1 namespace (http://purl.org/dc/elements/1.1/)
# to using the recommended DC Terms namespace (http://purl.org/dc/terms/)
# See also discussion on https://github.com/oborel/obo-relations/pull/692

SELECT ?term ?predicate WHERE {
?term ?predicate ?value .
FILTER(STRSTARTS(STR(?predicate), "http://purl.org/dc/elements/1.1/"))
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/FBbt_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/fbbt_")))
}