Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jsimonclark committed Feb 8, 2024
2 parents 0e32b94 + 8da00c0 commit ad3434f
Show file tree
Hide file tree
Showing 18 changed files with 1,366 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "Sphinx: Render docs"

on:
push:
branches:
- 'main'

env:
GIT_USER_NAME: BattINFO Developers
GIT_USER_EMAIL: "BattINFO@big-map.org"

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@v4 #Uses python install action from here: https://github.com/marketplace?type=actions
with:
python-version: '3.10' # Replace with the desired Python version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install Markdown==3.4.3 rdflib==6.3.2 # Add any other dependencies if needed
- name: Render documentation from ttl
run: python sphinx/ttl_to_rst.py

- name: Build HTML
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "sphinx/"
pre-build-command: "apt-get update -y; apt-get install -y pandoc"

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: documentationHTML
path: sphinx/_build/html/

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: sphinx/_build/html


65 changes: 65 additions & 0 deletions .github/workflows/doc.yml~
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: "Sphinx: Render docs"

on:
push:
branches:
- 'master'

env:
GIT_USER_NAME: BattINFO Developers
GIT_USER_EMAIL: "BattINFO@big-map.org"

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@v4 #Uses python install action from here: https://github.com/marketplace?type=actions
with:
python-version: '3.10' # Replace with the desired Python version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install Markdown==3.4.3 rdflib==6.3.2 # Add any other dependencies if needed

- name: Render documentation from ttl
run: python sphinx/ttl_to_rst.py

- name: Build HTML
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "sphinx/"

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: documentationHTML
path: sphinx/_build/html/

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: sphinx/_build/html

- name: Commit updated documentation
run: |
cd ${GITHUB_WORKSPACE}
git config --global user.email "${GIT_USER_EMAIL}"
git config --global user.name "${GIT_USER_NAME}"
git config pull.rebase false
git add .
git commit --allow-empty -m "Automatic update of github pages"
git push origin master

1 change: 1 addition & 0 deletions chemicalsubstance.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@base <https://w3id.org/emmo/domain/chemicalsubstance/chemicalsubstance> .

<https://w3id.org/emmo/domain/chemicalsubstance/chemicalsubstance> rdf:type owl:Ontology ;

owl:versionIRI <https://w3id.org/emmo/domain/chemicalsubstance/0.3.0-beta/chemicalsubstance> ;
owl:imports <http://emmo.info/emmo/1.0.0-beta5> ;
dcterms:abstract "This ontology provides terms for chemical substances that can be referenced and re-used other resources."@en ;
Expand Down
1 change: 1 addition & 0 deletions sphinx/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_build
20 changes: 20 additions & 0 deletions sphinx/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= -v
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
47 changes: 47 additions & 0 deletions sphinx/README.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#+TITLE: Documentation generation for BattInfo
* Requirements
** sphinx
installation instruction described [[https://www.sphinx-doc.org/en/master/usage/installation.html][here]]
#+begin_src
pip install sphinx
#+end_src
** install sphinx pydata theme
https://pydata-sphinx-theme.readthedocs.io/en/latest/index.html
#+begin_src
pip install pydata-sphinx-theme
#+end_src
** globabsubs extension
#+begin_src
pip install sphinxcontrib-globalsubs
#+end_src
** autosectionlabel
- part of default distribution
- We use ~autosectionlabel_prefix_document = True~ which means that the internal link must be prefixed by the file
name and a semi-column, see [[https://www.sphinx-doc.org/en/master/usage/extensions/autosectionlabel.html][here]].

* Workflow for editing

In the ~Documentation~ directory, run from terminal
#+BEGIN_SRC sh
make html
#+END_SRC

The command generates all the files for a static website and writes them in ~Documentation/_build/html~

All the files in this directory must then be copied to the ~BattInfo-doc~ [[https://github.com/BattMoTeam/BattMo-doc][repo]]. From there, make a *force* push. We do
not keep track of the history of the ouput files (html), but we of course keep track of the documentation source, directly in the
main repo ~BattInfo~.

The deployment of the webpage can be followed from the [[https://github.com/BattMoTeam/BattMo-doc/actions][github pages section]]

The result can be view at

https://battmoteam.github.io/Battinfo-doc/

* Interesting Manuals
** sphinx manual
https://www.sphinx-doc.org/en/master/contents.html
** reStucturedText (rst) format
https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
* Configuration file
- ~conf.py~ see https://www.sphinx-doc.org/en/master/usage/configuration.html
34 changes: 34 additions & 0 deletions sphinx/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
td.element-table-key, td.element-table-value {
vertical-align: top;
}

td.element-table-key {
text-align: right;
padding-right: 2mm;
width: 20%;
}

span.element-table-key {
font-weight: bold;
}

table.element-table {
width: 100%;
text-align: left;
}

html table.element-table tr:nth-child(odd) td{
background-color: Gainsboro;
}

table.element-table tr:nth-child(even) td{
background-color: GhostWhite;
}

html[data-theme=dark] table.element-table tr:nth-child(odd) td{
background-color: black;
}

html[data-theme=dark] table.element-table tr:nth-child(even) td{
background-color: black;
}
107 changes: 107 additions & 0 deletions sphinx/about.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
.. toctree::
:hidden:

example_person_jsonld_nb.ipynb


Chemical Substance Domain Ontology
==================================

Overview
--------

The Chemical Substance Domain Ontology is a specialized ontology
designed to provide persistent machine-readable identifiers for chemical
substances within the broader context of the Elementary Multiperspective
Materials Ontology (EMMO). It plays a crucial role in enhancing the
semantic representation of chemical entities and their relationships
within materials science and related domains.

Integration with EMMO
~~~~~~~~~~~~~~~~~~~~~

The primary purpose of the Chemical Substance Domain Ontology is to
seamlessly integrate chemical substances into the EMMO ontology
ecosystem. EMMO serves as the top-level ontology for materials science
and modeling, providing a standardized framework for describing
materials, processes, and phenomena. By establishing a domain ontology
for chemical substances, we bridge the gap between materials modeling
and chemistry, ensuring consistent and interoperable knowledge
representation.

Persistent Identifiers
~~~~~~~~~~~~~~~~~~~~~~

This ontology assigns persistent machine-readable identifiers to
chemical substances. These identifiers are essential for accurate
referencing and linking of chemical data, ensuring data consistency, and
facilitating data exchange and interoperability among various tools and
systems. It includes annotations to other sources of information
including `PubChem <https://pubchem.ncbi.nlm.nih.gov/>`__ and
`Wikidata <https://www.wikidata.org/>`__.

Standardized Nomenclature
~~~~~~~~~~~~~~~~~~~~~~~~~

The ontology includes standardized nomenclature for chemical substances,
relying on `IUPAC <https://iupac.org/what-we-do/nomenclature/>`__
recommendations for naming coneventions. IUPAC is the
universally-recognized authority on chemical nomenclature and
terminology. This consistency in naming conventions enhances
collaboration and data sharing.

Key Features
------------

- Seamless integration with the EMMO ontology.
- Provides persistent machine-readable identifiers for chemical
substances.
- Standardized nomenclature for chemical entities.
- Facilitates data exchange and interoperability within the EMMO
ecosystem.

Usage
-----

Researchers, domain experts, and developers within the materials science
and chemistry communities can utilize the Chemical Substance Domain
Ontology for various purposes, including:

- Incorporating consistent and standardized chemical substance
information into their modeling and simulation activities.
- Enhancing data interoperability between materials modeling tools,
databases, and platforms.
- Supporting research projects that require precise and standardized
chemical entity representation.
- Building applications, databases, or knowledge graphs that leverage
EMMO and require chemical substance information.

Contributing
------------

We welcome contributions from the community to enhance and expand the
Chemical Substance Domain Ontology. If you have suggestions,
improvements, or additional chemical substance information to
contribute, please refer to our :ref:`contributing guidelins<contribute:Contributing to the ontology>`.

Acknowledgements
----------------

This project has received support from European Unition research and
innovation programs, under grant agreement numbers:

- 957189 - `BIG-MAP <http://www.big-map.eu/>`__

License
-------

The Chemical Substance Domain Ontology is released under the `Creative
Commons Attribution 4.0
International <https://creativecommons.org/licenses/by/4.0/legalcode>`__
license (CC BY 4.0).

Please cite this content using the following DOI:
`10.5281/zenodo.10254978 <https://zenodo.org/doi/10.5281/zenodo.10254978>`__

.. |DOI| image:: https://zenodo.org/badge/697870611.svg
:target: https://zenodo.org/doi/10.5281/zenodo.10254978
Loading

0 comments on commit ad3434f

Please sign in to comment.