-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from BIG-MAP/dev
update directory structure and imports
- Loading branch information
Showing
46 changed files
with
17,960 additions
and
11,406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,119 @@ | ||
name: "Sphinx: Render docs" | ||
name: "docs" | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
pull_request: | ||
branches: | ||
- '*' # To ensure it runs on all PRs | ||
|
||
env: | ||
GIT_USER_NAME: BattINFO Developers | ||
GIT_USER_EMAIL: "[email protected]" | ||
|
||
jobs: | ||
|
||
updatepages: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -U setuptools wheel | ||
pip install -r requirements_docs.txt | ||
pip install --upgrade pip | ||
pip install -r docs/requirements.txt | ||
- name: Render documentation from ttl | ||
run: python sphinx/ttl_to_rst.py | ||
run: python docs/scripts/ttl_to_rst.py | ||
|
||
- name: Create context directory | ||
run: sudo mkdir -p context | ||
|
||
- name: Create context file from ttl | ||
run: python docs/scripts/ttl_to_context.py | ||
|
||
- name: Build HTML | ||
uses: ammaraskar/sphinx-action@master | ||
with: | ||
docs-folder: "sphinx/" | ||
docs-folder: "docs/" | ||
pre-build-command: "apt-get update -y; apt-get install -y pandoc" | ||
|
||
# Still upload built documentation as an artifact if not deploying | ||
# This is to provide the opportunity to download the built documentation | ||
- name: Check if HTML context directory exists | ||
run: | | ||
if [ ! -d "docs/_build/html/context/" ]; then | ||
sudo mkdir -p docs/_build/html/context/ | ||
fi | ||
if [ ! -d "docs/_build/html/assets/" ]; then | ||
sudo mkdir -p docs/_build/html/assets/ | ||
fi | ||
if [ ! -d "docs/_build/html/versions/" ]; then | ||
sudo mkdir -p docs/_build/html/versions/ | ||
fi | ||
- name: Copy assets directory to HTML directory | ||
run: sudo cp -r docs/assets/* docs/_build/html/assets/ | ||
|
||
- name: Copy context file to HTML directory | ||
run: sudo cp context/context.json docs/_build/html/context/ | ||
|
||
- name: Commit changes | ||
run: | | ||
git config --local user.email "${{ env.GIT_USER_EMAIL }}" | ||
git config --local user.name "${{ env.GIT_USER_NAME }}" | ||
git add context/context.json | ||
git diff --staged --quiet || git commit -m "Update context.json file" | ||
- name: Pull latest changes | ||
if: github.event_name == 'push' # Only pull changes during push events | ||
run: git pull origin master --rebase | ||
|
||
- name: Push changes | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' # Only push during push events on master | ||
run: git push origin HEAD:master | ||
|
||
- name: Fetch all tags and create version directories | ||
run: | | ||
git fetch --tags | ||
git tag | while read TAG; do | ||
sudo mkdir -p "docs/_build/html/versions/$TAG" | ||
python docs/scripts/apply_foops_recommendations.py battinfo.ttl battinfo-foops.ttl | ||
sudo cp "battinfo-foops.ttl" "docs/_build/html/versions/$TAG/battinfo.ttl" | ||
sudo cp "battinfo-inferred.ttl" "docs/_build/html/versions/$TAG/" | ||
if [ -d "context" ]; then | ||
sudo mkdir -p "docs/_build/html/versions/$TAG/context" | ||
sudo cp "context/context.json" "docs/_build/html/versions/$TAG/context" | ||
fi | ||
done | ||
- name: Copy TTL files to HTML directory | ||
run: | | ||
python docs/scripts/apply_foops_recommendations.py battinfo.ttl battinfo-foops.ttl | ||
sudo cp "battinfo-foops.ttl" "docs/_build/html/battinfo.ttl" | ||
sudo cp "battinfo-inferred.ttl" "docs/_build/html/battinfo-inferred.ttl" | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: documentationHTML | ||
path: sphinx/_build/html/ | ||
|
||
# Only deploy if pushing to 'master' | ||
path: docs/_build/html/ | ||
|
||
- name: Deploy | ||
if: github.ref == 'refs/heads/master' && github.event_name == 'push' # Only deploy during push events on master | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: github.ref == 'refs/heads/master' && github.event_name == 'push' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: sphinx/_build/html | ||
publish_dir: docs/_build/html |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,41 +8,42 @@ | |
@prefix skos: <http://www.w3.org/2004/02/skos/core#> . | ||
@prefix dcterms: <http://purl.org/dc/terms/> . | ||
@prefix annotations: <https://w3id.org/emmo/top/annotations#> . | ||
@prefix electrochemistry: <https://big-map.github.io/BattINFO/ontology/electrochemistry#> . | ||
@base <https://big-map.github.io/BattINFO/ontology/BattINFO> . | ||
@prefix echem: <https://w3id.org/emmo/domain/electrochemistry#> . | ||
@prefix batt: <https://w3id.org/emmo/domain/battery#> . | ||
@base <https://w3id.org/battinfo> . | ||
|
||
<https://big-map.github.io/BattINFO/ontology/BattINFO> rdf:type owl:Ontology ; | ||
owl:versionIRI <https://big-map.github.io/BattINFO/ontology/BattINFO/0.7.0/battinfo> ; | ||
owl:imports <https://w3id.org/emmo/domain/battery/0.8.0-beta/battery> ; | ||
dcterms:abstract """A battery interface domain ontology based on EMMO. | ||
<https://w3id.org/battinfo> rdf:type owl:Ontology ; | ||
owl:versionIRI <https://w3id.org/battinfo/0.8.0-beta/battinfo> ; | ||
owl:imports <https://w3id.org/emmo/domain/battery/0.13.0-beta/battery> ; | ||
dcterms:abstract """A battery interface domain ontology based on EMMO. | ||
This file is intended to be empty and merely collecting the other ontologies. | ||
Released under the Creative Commons license Attribution 4.0 International (CC BY 4.0)."""@en ; | ||
dcterms:contributor "Anna Szczesna"@en , | ||
"Denmark Technical University (DTU), DK"@en , | ||
"Deyana Stoytcheva"@en , | ||
"EPFL, CH"@en , | ||
"Fraunhofer ISC, DE"@en , | ||
"ICMAB, ES"@en , | ||
"Marek Marcinek"@en , | ||
"Martin Uhrin"@en , | ||
"Miran Gaberscek"@en , | ||
"National Institute of Chemistry, SI"@en , | ||
"Rosa Palacin"@en , | ||
"Simon Stier"@en , | ||
"Warsaw University of Technology, PL"@en ; | ||
dcterms:creator "Casper Welzel Andersen"@en , | ||
"Eibar Flores"@en , | ||
"Francesca Lønstad Bleken"@en , | ||
"Jesper Friis"@en , | ||
"SINTEF, NO"@en , | ||
"Simon Clark"@en ; | ||
dcterms:license "https://creativecommons.org/licenses/by/4.0/legalcode" ; | ||
dcterms:title "Battery Interface Ontology (BattINFO)"@en ; | ||
rdfs:comment """Contacts: | ||
dcterms:contributor "Anna Szczesna"@en , | ||
"Denmark Technical University (DTU), DK"@en , | ||
"Deyana Stoytcheva"@en , | ||
"EPFL, CH"@en , | ||
"Fraunhofer ISC, DE"@en , | ||
"ICMAB, ES"@en , | ||
"Marek Marcinek"@en , | ||
"Martin Uhrin"@en , | ||
"Miran Gaberscek"@en , | ||
"National Institute of Chemistry, SI"@en , | ||
"Rosa Palacin"@en , | ||
"Simon Stier"@en , | ||
"Warsaw University of Technology, PL"@en ; | ||
dcterms:creator "Casper Welzel Andersen"@en , | ||
"Eibar Flores"@en , | ||
"Francesca Lønstad Bleken"@en , | ||
"Jesper Friis"@en , | ||
"SINTEF, NO"@en , | ||
"Simon Clark"@en ; | ||
dcterms:license "https://creativecommons.org/licenses/by/4.0/legalcode" ; | ||
dcterms:title "Battery Interface Ontology (BattINFO)"@en ; | ||
rdfs:comment """Contacts: | ||
Simon Clark | ||
SINTEF Industry | ||
email: [email protected]"""@en ; | ||
owl:versionInfo "0.7.0" . | ||
owl:versionInfo "0.8.0" . | ||
|
||
################################################################# | ||
# Annotation properties | ||
|
Oops, something went wrong.