From 5515f17510dd846d88ef0f33f4a5be9068fe8991 Mon Sep 17 00:00:00 2001 From: Philippe Rocca-Serra Date: Thu, 18 Jul 2024 08:51:25 +0100 Subject: [PATCH] Initial commit --- .github/workflows/dashboard.yaml | 37 +++++++++++++++++++++++++++ .gitignore | 1 + Makefile | 11 ++++++++ README.md | 30 ++++++++++++++++++++++ _config.yml | 1 + dashboard-config.yml | 44 ++++++++++++++++++++++++++++++++ index.md | 5 ++++ odk.sh | 22 ++++++++++++++++ run-dash.sh | 10 ++++++++ sparql/missing_xrefs.sparql | 27 ++++++++++++++++++++ 10 files changed, 188 insertions(+) create mode 100644 .github/workflows/dashboard.yaml create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.md create mode 100644 _config.yml create mode 100644 dashboard-config.yml create mode 100644 index.md create mode 100644 odk.sh create mode 100644 run-dash.sh create mode 100644 sparql/missing_xrefs.sparql diff --git a/.github/workflows/dashboard.yaml b/.github/workflows/dashboard.yaml new file mode 100644 index 0000000..c67c6f4 --- /dev/null +++ b/.github/workflows/dashboard.yaml @@ -0,0 +1,37 @@ +name: Run Dashboard +on: + workflow_dispatch: + push: + branches: [ main ] + paths: + - 'dashboard-config.yml' + - 'Makefile' + schedule: + # This will run at 05:48 on first day of the month in every month from January through December. + - cron: "48 5 1 1-12 *" +jobs: + dashboard: + runs-on: ubuntu-latest + container: obolibrary/odkfull:v1.3.1 + strategy: + max-parallel: 1 + steps: + - name: Checkout main branch + uses: actions/checkout@v3 + - name: work around permission issue + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + - name: Clean directories + run: rm -rf dashboard ontologies && mkdir -p dashboard ontologies + - name: Prepare run + run: cp dashboard-config.yml /tools/OBO-Dashboard/dashboard-config.yml && cp -r sparql/ /tools/OBO-Dashboard/sparql + - name: Run dashboard + run: obodash -C dashboard-config.yml + - name: Copy results + run: cp -r /tools/OBO-Dashboard/dashboard/* dashboard/ && cp -r /tools/OBO-Dashboard/build/ontologies/* ontologies/ + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + with: + commit-message: Update dashboard run + title: 'Update dashboard run' + body: | + Updates the Custom OBO Dashboard \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b6c95f8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +ontologies \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1efc1f1 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +dashboard/ ontologies/: + mkdir -p $@ + +.PRECIOUS: dependencies +dependencies: + #pip install networkx==2.6.2 + echo "No dependencies needed." + +.PRECIOUS: run_dashboard +run_dashboard: | dependencies dashboard/ ontologies/ + obodash -C dashboard-config.yml \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..9bd14b5 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# Template repository to create Custom OBO Foundry Dashboard + +Custom configuration at `dashboard-config.yml` + +```yaml +... +ontologies: + custom: + - id: Ontology id + mirror_from: Link to the OWL file in your repository. + title: Ontology's title + contact: + email: + label: + orcid: + github: + description: Ontology's description + domain: Ontology's domain + homepage: Ontology's page + products: + - id: + dependencies: + - id: + tracker: Link to ontology's issue tracker + license: + url: License's url + label: License's label + preferredPrefix: + base_ns: Base namespaces +``` diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..2f7efbe --- /dev/null +++ b/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-minimal \ No newline at end of file diff --git a/dashboard-config.yml b/dashboard-config.yml new file mode 100644 index 0000000..1e8989d --- /dev/null +++ b/dashboard-config.yml @@ -0,0 +1,44 @@ +title: "OBO Dashboard" +description: "Dashboard for checking ontology quality. Under construction." +obo_score_weights: + no_base: + impact_factor: 5 + max_impact: 5 + overall_error: + impact_factor: 5 + max_impact: 20 + overall_warning: + impact_factor: 0.5 + max_impact: 10 + overall_info: + impact_factor: 0.1 + max_impact: 5 + report_errors: + impact_factor: 0.05 + max_impact: 10 + report_warning: + impact_factor: 0.01 + max_impact: 5 + report_info: + impact_factor: 0.005 + max_impact: 3 + impact: + impact_factor: 1 + max_impact: 1 + dashboard: + impact_factor: 1 + max_impact: 1 +ontologies: + custom: + - id: tmp + mirror_from: "https://raw.githubusercontent.com/monarch-ebi-dev/robot_tests/master/custom-dashboard.owl" +prefer_base: True +profile: + baseprofile: "https://raw.githubusercontent.com/ontodev/robot/master/robot-core/src/main/resources/report_profile.txt" + custom: + - "WARN\tfile:./sparql/missing_xrefs.sparql" +report_truncation_limit: 600 +redownload_after_hours: 0 +environment: + ROBOT_JAR: /tools/robot.jar + ROBOT: robot diff --git a/index.md b/index.md new file mode 100644 index 0000000..b22da71 --- /dev/null +++ b/index.md @@ -0,0 +1,5 @@ +## Welcome to the Custom OBO Foundry Dashboard + + + +[Dashboard](dashboard/index.html) diff --git a/odk.sh b/odk.sh new file mode 100644 index 0000000..98ca89a --- /dev/null +++ b/odk.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# Wrapper script for docker. +# +# This is used primarily for wrapping the GNU Make workflow. +# Instead of typing "make TARGET", type "./run.sh make TARGET". +# This will run the make workflow within a docker container. +# +# The assumption is that you are working in the src/ontology folder; +# we therefore map the whole repo (../..) to a docker volume. +# +# See README-editors.md for more details. +#echo "WARNING USING ODK 1.2.30!" + +docker run -e ROBOT_JAVA_ARGS='-Xmx4G' -e JAVA_OPTS='-Xmx4G' \ + -v $PWD/dashboard:/tools/OBO-Dashboard/dashboard \ + -v $PWD/dashboard-config.yml:/tools/OBO-Dashboard/dashboard-config.yml \ + -v $PWD/Makefile:/work/Makefile \ + -v $PWD/ontologies:/tools/OBO-Dashboard/build/ontologies \ + -v $PWD/sparql:/tools/OBO-Dashboard/sparql \ + -w /work --rm -ti obolibrary/odkfull:v1.3.1 "$@" + +#echo "WARNING USING ODK 1.2.30!" \ No newline at end of file diff --git a/run-dash.sh b/run-dash.sh new file mode 100644 index 0000000..81b69d0 --- /dev/null +++ b/run-dash.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e + +OBODASH="sh odk.sh " + +rm -rf dashboard ontologies +mkdir -p dashboard ontologies +#$OBODASH refresh -B +$OBODASH make run_dashboard \ No newline at end of file diff --git a/sparql/missing_xrefs.sparql b/sparql/missing_xrefs.sparql new file mode 100644 index 0000000..04e4050 --- /dev/null +++ b/sparql/missing_xrefs.sparql @@ -0,0 +1,27 @@ +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX oboInOwl: + +SELECT DISTINCT ?entity ?property ?value WHERE { + VALUES ?property { oboInOwl:hasDbXref } + ?entity ?any ?o . + FILTER NOT EXISTS { ?entity ?property ?value } + FILTER NOT EXISTS { ?entity a owl:Ontology } + FILTER NOT EXISTS { ?entity owl:deprecated true } + FILTER NOT EXISTS { + ?entity rdfs:subPropertyOf oboInOwl:SubsetProperty . + } + FILTER EXISTS { + ?entity ?prop2 ?object . + FILTER (?prop2 != rdf:type) + FILTER (?prop2 != owl:equivalentClass) + FILTER (?prop2 != owl:disjointWith) + FILTER (?prop2 != owl:equivalentProperty) + FILTER (?prop2 != owl:sameAs) + FILTER (?prop2 != owl:differentFrom) + FILTER (?prop2 != owl:inverseOf) + } + FILTER (!isBlank(?entity)) +} +ORDER BY ?entity \ No newline at end of file