Skip to content

Commit

Permalink
Fixed generation of documentation and redirectionscheck
Browse files Browse the repository at this point in the history
  • Loading branch information
jesper-friis committed Feb 12, 2024
1 parent 89eb7c7 commit 3400287
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 31 deletions.
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
5 changes: 2 additions & 3 deletions .github/pages-index.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ ${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.
"Compacted ontology" means that all the top and middle level modules
are joint together into a single file with no imports.
</sup>

</body>
Expand Down
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
26 changes: 13 additions & 13 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,35 +83,35 @@ 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
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.owl" "$d/emmo-renamed.ttl" \
-s -a -R -b http://emmo.info/emmo-renamed || true
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

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 conventions
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
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 3400287

Please sign in to comment.