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

Update latest ODK (1.4.3) #3833

Merged
merged 1 commit into from
Oct 22, 2023
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 .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.3.1
container: obolibrary/odkfull:v1.4.3
strategy:
max-parallel: 1
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
edit_file:
runs-on: ubuntu-latest
container: obolibrary/odklite:v1.3.1
container: obolibrary/odklite:v1.4.3
steps:
- uses: actions/checkout@v2
# Checks-out main branch under "main" directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
ontology_qc:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.3.1
container: obolibrary/odkfull:v1.4.3

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
176 changes: 117 additions & 59 deletions src/ontology/Makefile

Large diffs are not rendered by default.

51 changes: 48 additions & 3 deletions src/ontology/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,36 @@
# The assumption is that you are working in the src/ontology folder;
# we therefore map the whole repo (../..) to a docker volume.
#
# To use singularity instead of docker, please issue
# export USE_SINGULARITY=<any-value>
# before running this script.
#
# See README-editors.md for more details.

IMAGE=${IMAGE:-odkfull}
ODK_JAVA_OPTS=-Xmx8G
if [ -f run.sh.conf ]; then
. ./run.sh.conf
fi

# Look for a GitHub token
if [ -n "$GH_TOKEN" ]; then
:
elif [ -f ../../.github/token.txt ]; then
GH_TOKEN=$(cat ../../.github/token.txt)
elif [ -f $XDG_CONFIG_HOME/ontology-development-kit/github/token ]; then
GH_TOKEN=$(cat $XDG_CONFIG_HOME/ontology-development-kit/github/token)
elif [ -f "$HOME/Library/Application Support/ontology-development-kit/github/token" ]; then
GH_TOKEN=$(cat "$HOME/Library/Application Support/ontology-development-kit/github/token")
fi

ODK_IMAGE=${ODK_IMAGE:-odkfull}
TAG_IN_IMAGE=$(echo $ODK_IMAGE | awk -F':' '{ print $2 }')
if [ -n "$TAG_IN_IMAGE" ]; then
# Override ODK_TAG env var if IMAGE already includes a tag
ODK_TAG=$TAG_IN_IMAGE
ODK_IMAGE=$(echo $ODK_IMAGE | awk -F':' '{ print $1 }')
fi
ODK_TAG=${ODK_TAG:-latest}
ODK_JAVA_OPTS=${ODK_JAVA_OPTS:--Xmx8G}
ODK_DEBUG=${ODK_DEBUG:-no}

TIMECMD=
Expand All @@ -23,7 +49,26 @@ if [ x$ODK_DEBUG = xyes ]; then
TIMECMD="/usr/bin/time -f ### DEBUG STATS ###\nElapsed time: %E\nPeak memory: %M kb"
fi

docker run -v $PWD/../../:/work -w /work/src/ontology -e ROBOT_JAVA_ARGS="$ODK_JAVA_OPTS" -e JAVA_OPTS="$ODK_JAVA_OPTS" --rm -ti obolibrary/$IMAGE $TIMECMD "$@"
VOLUME_BIND=$PWD/../../:/work
WORK_DIR=/work/src/ontology

if [ -n "$ODK_BINDS" ]; then
VOLUME_BIND="$VOLUME_BIND,$ODK_BINDS"
fi

if [ -n "$USE_SINGULARITY" ]; then

singularity exec --cleanenv $ODK_SINGULARITY_OPTIONS \
--env "ROBOT_JAVA_ARGS=$ODK_JAVA_OPTS,JAVA_OPTS=$ODK_JAVA_OPTS" \
--bind $VOLUME_BIND \
-W $WORK_DIR \
docker://obolibrary/$ODK_IMAGE:$ODK_TAG $TIMECMD "$@"
else
BIND_OPTIONS="-v $(echo $VOLUME_BIND | sed 's/,/ -v /')"
docker run $ODK_DOCKER_OPTIONS $BIND_OPTIONS -w $WORK_DIR \
-e ROBOT_JAVA_ARGS="$ODK_JAVA_OPTS" -e JAVA_OPTS="$ODK_JAVA_OPTS" \
--rm -ti obolibrary/$ODK_IMAGE:$ODK_TAG $TIMECMD "$@"
fi

case "$@" in
*update_repo*|*release*)
Expand Down
1 change: 0 additions & 1 deletion src/sparql/edges.sparql
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
prefix obo: <http://purl.obolibrary.org/obo/>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Expand Down
10 changes: 10 additions & 0 deletions src/sparql/illegal-date-violation.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?term ?property ?value WHERE
{
VALUES ?property {dct:date dct:issued dct:created}
?term ?property ?value .
FILTER (datatype(?value) != xsd:date || !regex(str(?value), '^\\d{4}-\\d\\d-\\d\\d$'))
}

2 changes: 1 addition & 1 deletion src/sparql/inject-subset-declaration.ru
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ INSERT { ?y rdfs:subPropertyOf <http://www.geneontology.org/formats/oboInOwl#Sub
WHERE {
?x <http://www.geneontology.org/formats/oboInOwl#inSubset> ?y .
FILTER(isIRI(?y))
FILTER(regex(str(?y),"^(http://purl.obolibrary.org/obo/)") || regex(str(?y),"^(http://www.ebi.ac.uk/efo/)") || regex(str(?y),"^(https://w3id.org/biolink/)"))
FILTER(regex(str(?y),"^(http://purl.obolibrary.org/obo/)") || regex(str(?y),"^(http://www.ebi.ac.uk/efo/)") || regex(str(?y),"^(https://w3id.org/biolink/)") || regex(str(?y),"^(http://purl.obolibrary.org/obo)"))
}
2 changes: 1 addition & 1 deletion src/sparql/inject-synonymtype-declaration.ru
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ INSERT { ?y rdfs:subPropertyOf <http://www.geneontology.org/formats/oboInOwl#Syn
WHERE {
?x <http://www.geneontology.org/formats/oboInOwl#hasSynonymType> ?y .
FILTER(isIRI(?y))
FILTER(regex(str(?y),"^(http://purl.obolibrary.org/obo/)") || regex(str(?y),"^(http://www.ebi.ac.uk/efo/)") || regex(str(?y),"^(https://w3id.org/biolink/)"))
FILTER(regex(str(?y),"^(http://purl.obolibrary.org/obo/)") || regex(str(?y),"^(http://www.ebi.ac.uk/efo/)") || regex(str(?y),"^(https://w3id.org/biolink/)") || regex(str(?y),"^(http://purl.obolibrary.org/obo)"))
}
2 changes: 1 addition & 1 deletion src/sparql/iri-range-advanced-violation.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ WHERE {
oboInOwl:inSubset
dcterms:contributor }
?term ?property ?value .
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
FILTER (!isIRI(?value))
}

2 changes: 1 addition & 1 deletion src/sparql/iri-range-violation.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WHERE {
oboInOwl:inSubset
dcterms:contributor }
?term ?property ?value .
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
FILTER (!isIRI(?value))
}

2 changes: 1 addition & 1 deletion src/sparql/label-with-iri-violation.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ SELECT ?term ?value
WHERE {
?term rdfs:label ?value .
FILTER (REGEX(?value, "http[s]?[:]"))
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
}

2 changes: 1 addition & 1 deletion src/sparql/mp_terms.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ WHERE {
{ ?s1 ?p1 ?term . }
UNION
{ ?term ?p2 ?o2 . }
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
}
12 changes: 12 additions & 0 deletions src/sparql/multiple-replaced_by-violation.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PREFIX replaced_by: <http://purl.obolibrary.org/obo/IAO_0100001>

SELECT DISTINCT ?entity ?property ?value WHERE {
VALUES ?property {
replaced_by:
}
?entity ?property ?value1 .
?entity ?property ?value2 .
FILTER(?value1!=?value2)
BIND(CONCAT(str(?value1), CONCAT("|", str(?value2))) as ?value)
}

2 changes: 1 addition & 1 deletion src/sparql/owldef-self-reference-violation.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ SELECT ?term WHERE {
{ ?term owl:equivalentClass [ owl:intersectionOf [ rdf:rest*/rdf:first ?term ] ] }
UNION
{ ?term owl:equivalentClass [ owl:intersectionOf [ rdf:rest*/rdf:first [ owl:someValuesFrom ?term ] ] ] }
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
}

2 changes: 1 addition & 1 deletion src/sparql/redundant-subClassOf-violation.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ SELECT ?term ?xl ?y ?yl ?z ?zl WHERE {
?term rdfs:subClassOf ?z .
?z rdfs:label ?zl .

FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
}

1 change: 0 additions & 1 deletion src/sparql/simple-seed.sparql
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix obo: <http://purl.obolibrary.org/obo/>

SELECT DISTINCT ?cls WHERE
{
Expand Down
1 change: 0 additions & 1 deletion src/sparql/subsets-labeled.sparql
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
prefix oio: <http://www.geneontology.org/formats/oboInOwl#>
prefix def: <http://purl.obolibrary.org/obo/IAO_0000115>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix inSubset: <http://www.geneontology.org/formats/oboInOwl#inSubset>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
Expand Down
2 changes: 1 addition & 1 deletion src/sparql/taxon-range-violation.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ WHERE {
VALUES ?property { never_in_taxon: present_in_taxon: }
?term ?property ?taxon .
FILTER (!isIRI(?taxon) || !STRSTARTS(STR(?taxon), "http://purl.obolibrary.org/obo/NCBITaxon_"))
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/MP_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit[#]") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp/") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/mp-edit/")))
}

9 changes: 9 additions & 0 deletions src/sparql/term-tracker-uri-violation.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX term_tracker_item: <http://purl.obolibrary.org/obo/IAO_0000233>

SELECT ?term ?term_tracker ?term_tracker_type WHERE {
?term term_tracker_item: ?term_tracker .
FILTER(DATATYPE(?term_tracker) != xsd:anyURI)
BIND(DATATYPE(?term_tracker) as ?term_tracker_type)
}

Loading