Skip to content

Commit

Permalink
Fix GitHub workflow (#264)
Browse files Browse the repository at this point in the history
Fixed issues with the GitHub workflows, including:
- Updated GitHub Actions to the latest versions and use Python 3.11.
- Use turtle as the base file format to fix issues with rdfxml not
supporting IRIs starting with a letter.
- Fixed issues with the documentation generation 
- Added a new CI workflow for testing redirections (TODO: uncomment
failing tests and fix the redirections on w3id)
  • Loading branch information
jesper-friis authored Feb 13, 2024
2 parents 435bbfc + cb74ef5 commit 05cab0c
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Directory content

The format is simple - each line starts with a version
number. Optionally it may be followed by label indicating the
status. Use either "unstable" or "latest" or leave it out as
status. Use either "development" or "stable" or leave it out as
default.


Expand Down
36 changes: 25 additions & 11 deletions .github/expected_redirections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,44 @@
redirections:

# EMMO
https://w3id.org/emmo#EMMO_297999d6_c9e4_4262_9536_bd524d1c6e21: https://emmo-repo.github.io/emmo.ttl#EMMO_297999d6_c9e4_4262_9536_bd524d1c6e21 # ttl file because tests are not from a browser

https://w3id.org/emmo: https://emmo-repo.github.io/emmo.ttl # ttl file because tests are not from a browser
https://w3id.org/emmo/inferred: https://emmo-repo.github.io/emmo-inferred.ttl
https://w3id.org/emmo/dev: https://emmo-repo.github.io/development/emmo.ttl
https://w3id.org/emmo/dev-inferred: https://emmo-repo.github.io/development/emmo-inferred.ttl
https://w3id.org/emmo/1.0.0-beta4: https://emmo-repo.github.io/versions/1.0.0-beta4/emmo.ttl
https://w3id.org/emmo/1.0.0-beta4/inferred: https://emmo-repo.github.io/versions/1.0.0-beta4/emmo-inferred.ttl
https://w3id.org/emmo/1.0.0-beta5: https://emmo-repo.github.io/versions/1.0.0-beta5/emmo.ttl

https://w3id.org/emmo/: https://raw.githubusercontent.com/emmo-repo/EMMO/master/emmo.ttl
#https://w3id.org/emmo/: https://raw.githubusercontent.com/emmo-repo/EMMO/master/emmo.ttl
https://w3id.org/emmo/1.0.0-beta5/: https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta5/emmo.ttl
https://w3id.org/emmo/1.0.0-beta5/mereocausality: https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta5/mereocausality/mereocausality.ttl
https://w3id.org/emmo/1.0.0-beta5/perspectives: https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta5/perspectives/perspectives.ttl
https://w3id.org/emmo/1.0.0-beta5/multiperspective: https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta5/multiperspective/multiperspective.ttl
https://w3id.org/emmo/1.0.0-beta5/disciplines: https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta5/disciplines/disciplines.ttl
https://w3id.org/emmo/1.0.0-beta5/disciplines/units: https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta5/disciplines/disciplines/units.ttl
https://w3id.org/emmo/master: https://raw.githubusercontent.com/emmo-repo/EMMO/master/emmo.ttl
https://w3id.org/emmo/master/: https://raw.githubusercontent.com/emmo-repo/EMMO/master/emmo.ttl
https://w3id.org/emmo/1.0.0-beta5/disciplines/units: https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta5/disciplines/units/units.ttl
https://w3id.org/emmo/source: https://raw.githubusercontent.com/emmo-repo/EMMO/master/emmo.ttl
https://w3id.org/emmo/source/: https://raw.githubusercontent.com/emmo-repo/EMMO/master/emmo.ttl
https://w3id.org/emmo/perspectives/data: https://raw.githubusercontent.com/emmo-repo/EMMO/master/perspectives/data.ttl
https://w3id.org/emmo/perspectives/data/: https://raw.githubusercontent.com/emmo-repo/EMMO/master/perspectives/data.ttl
https://w3id.org/emmo/latest: https://raw.githubusercontent.com/emmo-repo/EMMO/master/emmo.ttl
https://w3id.org/emmo/latest/: https://raw.githubusercontent.com/emmo-repo/EMMO/master/emmo.ttl
#https://w3id.org/emmo/perspectives/data: https://raw.githubusercontent.com/emmo-repo/EMMO/master/perspectives/data.ttl
#https://w3id.org/emmo/perspectives/data/: https://raw.githubusercontent.com/emmo-repo/EMMO/master/perspectives/data.ttl
https://w3id.org/emmo/1.0.0-beta5/perspectives/data: https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta5/perspectives/data.ttl
https://w3id.org/emmo/1.0.0-beta5/perspectives/data/: https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta5/perspectives/data.ttl
#https://w3id.org/emmo/1.0.0-beta5/perspectives/data/: https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta5/perspectives/data.ttl


# Electrochemistry
#https://w3id.org/emmo/domain/electrochemistry#electrochemistry_b6319c74_d2ce_48c0_a75a_63156776b302: https://emmo-repo.github.io/domain-electrochemistry/electrochemistry.ttl#electrochemistry_b6319c74_d2ce_48c0_a75a_63156776b302

#https://w3id.org/emmo/domain/electrochemistry: https://emmo-repo.github.io/domain-electrochemistry/electrochemistry.ttl
https://w3id.org/emmo/domain/electrochemistry/: https://raw.githubusercontent.com/emmo-repo/domain-electrochemistry/master/electrochemistry.ttl


# Battery
https://w3id.org/emmo/domain/battery#battery_50b911f7_c903_4700_9764_c308d8a95470: https://emmo-repo.github.io/domain-battery.ttl
https://w3id.org/emmo/domain/battery: https://emmo-repo.github.io/domain-battery.ttl
#https://w3id.org/emmo/domain/battery#battery_50b911f7_c903_4700_9764_c308d8a95470: https://emmo-repo.github.io/domain-battery/battery.ttl

#https://w3id.org/emmo/domain/battery: https://emmo-repo.github.io/domain-battery.ttl
https://w3id.org/emmo/domain/battery/: https://raw.githubusercontent.com/emmo-repo/domain-battery/master/battery.ttl
https://w3id.org/emmo/domain/battery/source: https://raw.githubusercontent.com/emmo-repo/domain-battery/master/battery.ttl
https://w3id.org/emmo/domain/battery/source/: https://raw.githubusercontent.com/emmo-repo/domain-battery/master/battery.ttl
https://w3id.org/emmo/domain/battery/latest: https://raw.githubusercontent.com/emmo-repo/domain-battery/master/battery.ttl
https://w3id.org/emmo/domain/battery/latest/: https://raw.githubusercontent.com/emmo-repo/domain-battery/master/battery.ttl
20 changes: 12 additions & 8 deletions .github/pages-index.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<div class="header">
<img src="https://avatars1.githubusercontent.com/u/51194521?s=400&u=d9e0bbceb9a6e4901077e92b2426c8bca46b1009&v=4" class="logo" width="64" alt="EMMO">
<h1 class="logo">Elementary Multiperspective Material Ontology (EMMO)</h1>
<h1 class="logo">The Elementary Multiperspective Material Ontology (EMMO)</h1>
<img src="https://raw.githubusercontent.com/emmo-repo/emmo-repo.github.io/master/emmc.png" class="emmclogo" width="64" alt="EMMC">
</div>
The Elementary Multiperspective Material Ontology (EMMO) is the result of a multidisciplinary effort within the EMMC, aimed at the development of a standard representational ontology framework based on current materials modelling and characterization knowledge. Instead of starting from general upper level concepts, as done by other ontologies, the EMMO development started from the very bottom level, using the actual picture of the physical world coming from applied sciences, and in particular from physics and material sciences.
Expand All @@ -37,8 +37,8 @@ The EMMO has grown from the bottom (i.e. scientific application field) to the to
<tr>
<th></th>
<th></th>
<th colspan="2">Compacted<sup><a href="#fn1" id="ref1">1</a></sup> ontology</th>
<th colspan="2">Inferred ontology (compacted<sup><a href="#fn1">1</a></sup>)</th>
<th colspan="2">Compacted ontology<sup><a href="#fn1" id="ref1">1</a></sup></th>
<th colspan="2">Inferred ontology<sup><a href="#fn2" id="ref2">2</a></sup></th>
<th colspan="2">Documentation</th>
</tr>
<tr>
Expand All @@ -54,11 +54,15 @@ The EMMO has grown from the bottom (i.e. scientific application field) to the to
${versions}
</table>

<sup id="fn1"><a href="#ref1" title="Jump back to footnote 1.">1</a>.
With "compacted ontology", we here mean that all
the top and middle level modules are joint together into a single
file with no imports.
</sup>
<small>
<br>
<sup id="fn1"><a href="#ref1" title="Jump back to footnote 1.">1</a></sup>
<b>Compacted ontology</b> means that all modules have been squashed together into a single file with no imports.
Also, <code>rdfs:isDefinedBy</code> annotations referring to the original module IRI have been added.
<br>
<sup id="fn2"><a href="#ref2" title="Jump back to footnote 2.">2</a></sup>
<b>Inferred ontology</b> is reasoned and compacted.
</small>

</body>
</html>
2 changes: 0 additions & 2 deletions .github/scripts/makeindex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ while read version name; do
tdlink $d/emmo.ttl $version $l/emmo.ttl >> "$tmpfile"
tdlink $d/emmo-inferred.owl $version $l/emmo-inferred.owl >> "$tmpfile"
tdlink $d/emmo-inferred.ttl $version $l/emmo-inferred.ttl >> "$tmpfile"
tdlink $d/emmo-renamed.owl $version $l/emmo-renamed.owl >> "$tmpfile"
tdlink $d/emmo-renamed.ttl $version $l/emmo-renamed.ttl >> "$tmpfile"
tdlink $d/emmo.html $version $l/emmo.html >> "$tmpfile"
tdlink $d/emmo.pdf $version $l/emmo.pdf >> "$tmpfile"
echo " </tr>" >> "$tmpfile"
Expand Down
46 changes: 23 additions & 23 deletions .github/scripts/makeversions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
set -e

rootdir="$(git rev-parse --show-toplevel)"
remote=$(git remote -v | awk '{print $2; exit}')
remote=$(git remote -v | awk '/^origin/ {print $2; exit}')
ghdir="$rootdir/.github"
pagesdir="$ghdir/pages"
scriptsdir="$ghdir/scripts"
Expand Down Expand Up @@ -83,44 +83,44 @@ while read version name; do
else
echo "missing source in EMMO $version" >&2; exit 1
fi
ontoconvert "$src" "$d/emmo.owl" -s -a
ontoconvert "$src" "$d/emmo.ttl" -s -a
ontoconvert -saw "$src" "$d/emmo.owl"
ontoconvert -saw "$src" "$d/emmo.ttl"
fi

# Generate inferred ontology
if $remake || [ ! -f "$d/emmo-inferred.owl" ]; then
if $remake || [ ! -f "$d/emmo-inferred.ttl" ]; then
echo "Generate inferred ontology"
ontoconvert "$d/emmo.owl" "$d/emmo-inferred.owl" \
-i HermiT -b http://emmo.info/emmo-inferred
#ontoconvert -i HermiT -wsa "$d/emmo.ttl" "$d/emmo-inferred.ttl"
ontoconvert -w -i HermiT "$d/emmo.ttl" "$d/emmo-inferred.ttl"
fi
if $remake || [ ! -f "$d/emmo-inferred.ttl" ]; then
ontoconvert "$d/emmo-inferred.owl" "$d/emmo-inferred.ttl"
if $remake || [ ! -f "$d/emmo-inferred.owl" ]; then
ontoconvert -w "$d/emmo-inferred.ttl" "$d/emmo-inferred.owl"
fi

# Generate renamed ontology
if $remake || [ ! -f "$d/emmo-renamed.owl" ]; then
echo "Generate renamed ontology"
ontoconvert "$d/emmo-inferred.owl" "$d/emmo-renamed.owl" \
-s -a -R -b http://emmo.info/emmo-renamed || true
fi
if $remake || [ ! -f "$d/emmo-renamed.ttl" ]; then
ontoconvert "$d/emmo-inferred.owl" "$d/emmo-renamed.ttl" \
-s -a -R -b http://emmo.info/emmo-renamed || true
fi
#if $remake || [ ! -f "$d/emmo-renamed.owl" ]; then
# echo "Generate renamed ontology"
# ontoconvert "$d/emmo-inferred.ttl" "$d/emmo-renamed.owl" \
# -w -R -b http://emmo.info/emmo-renamed || true
#fi
#if $remake || [ ! -f "$d/emmo-renamed.ttl" ]; then
# ontoconvert "$d/emmo-inferred.ttl" "$d/emmo-renamed.ttl" \
# -w -R -b http://emmo.info/emmo-renamed || true
#fi

# Generate documentation
if $remake || [ ! -f "$d/emmo.html" ]; then
echo "Generate documentation"
"$scriptsdir/makedoc.sh" "$d/emmo-inferred.owl" $version "$d" \
"$scriptsdir/makedoc.sh" "$d/emmo-inferred.ttl" $version "$d" \
|| true
fi

# Create symlinks
# Create stable versions
cd "$pagesdir"
if [ ! -z "$name" ]; then
rm -f $name
ln -sf versions/$version $name
if [ "$name" = "stable" ]; then
cp $d/*.ttl $d/*.owl .
fi

done < "$ghdir/versions.txt"


Expand All @@ -130,5 +130,5 @@ if [ -d "$tmpdir" ]; then
fi


# Make sure that we exit with non-zero
# Make sure that we exit with zero on success
exit 0
2 changes: 1 addition & 1 deletion .github/versions.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1.0.0-beta5 development
1.0.0-beta4
1.0.0-beta4 stable
1.0.0-beta3
1.0.0-beta2
1.0.0-beta
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci_emmocheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ on: [push]
jobs:

build:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
python-version: [3.7]
python-version: [3.11]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install EMMO-python
- name: Install EMMOntoPy
run: |
pip install --upgrade pip
pip install EMMO
pip install EMMOntoPy
- name: Check EMMO
run: |
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/ci_redirectioncheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check redirections
on: [push]

jobs:

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install EMMOntoPy
run: |
pip install --upgrade pip
pip install EMMOntoPy
- name: Check redirections
run: |
redirectioncheck .github/expected_redirections.yaml
15 changes: 10 additions & 5 deletions .github/workflows/update_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,29 @@ on:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'
- update_pages
- fix-github-workflow

jobs:

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup git identity
run: |
git config --global user.email "emmo.github.action@github.com"
git config --global user.name "EMMO GitHub Action"
- name: Setup Python 3.7
uses: actions/setup-python@v1
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.11

- name: Debug info
run: |
echo "GITHUB_REF_NAME=${GITHUB_REF_NAME}"
- name: Install EMMO-python
run: |
Expand All @@ -44,7 +49,7 @@ jobs:
pip install semver
- name: Checkout GitHub Pages for EMMO-repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: emmo-repo/emmo-repo.github.io
path: ".github/pages"
Expand Down
4 changes: 2 additions & 2 deletions doc/emmodoc/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ branch of mereotopology.



%BRANCHDOC PhysicalDimension rankdir=RL
%% %BRANCHDOC PhysicalDimension rankdir=RL
%BRANCHDOC PhysicalQuantity
%BRANCHDOC StandardizedPhysicalQuantity
%BRANCHDOC CategorizedPhysicalQuantity
Expand All @@ -92,7 +92,7 @@ branch of mereotopology.
%BRANCHDOC Process


%BRANCHDOC Physicalistic
%% %BRANCHDOC Physicalistic
%BRANCHDOC ElementaryParticle
%BRANCHDOC Matter
%BRANCHDOC Fluid
Expand Down

0 comments on commit 05cab0c

Please sign in to comment.