These are the files necessary to develop, build and maintain e-editiones.ch - the website of the ontologies developed on GitHub in the repository Ontologies.
- Ontologies are developed as turtle files.
- A script validates the turtle files and converts them to RDF/XML, N-Triples, and JSON-LD as well as to a human-readable HTML version.
- The ontologies are made available through e-editiones.ch, which simply points to a GitHub Pages page provided by this repository.
- Make sure you have the above listed dependencies installed.
- Clone repository.
- cd into repository with
cd e-editiones
. - Run
bundle install
to fetch the needed Ruby gems. - cd into "ttl_conv" with
cd ttl_conv
. - Set up a Python virtual environment. E.g.
virtualenv env
- Activate your virtual environment. E.g.
source env/bin/activate
(typedeactivate
to deactivate). - Run
pip3 install -r requirements.txt
to fetch the needed Python packages. - cd back to "e-editiones" with
cd ..
.
You should now be all set to develop, build and maintain the website locally.
The folder and file structure you see is based on Jekyll's needs but there are some additional non-Jekyll folders and files. Below is a quick overview of the top-level files. You might want to visit the Jekyll Docs to see how Jekyll itself works.
Folder/File | Description |
---|---|
_includes | Jekyll folder containing HTML building blocks. The subfolder "ontologies" contains the human-readable HTML version of each ontology. |
_layouts | Jekyll folder containing HTML templates. |
_sass | Jekyll folder containing scss stylesheets. These files are compiled to a single css file for the final static website. |
_site | Jekyll folder containing the static files version of the website when serving locally. |
\docs | Custom Jekyll folder to save the built website files. |
assets | Jekyll folder containing asset files for the static website. |
collections | Jekyll folder to group content into collections. This folder is needed to group the created ontologies into "generic" and "project". |
ontology | Custom Jekyll folder containing all the ontology files. |
ttl_conv | Custom folder containing a Python script and additional resources to convert turtle files into needed formats and files. |
.gitignore | Gitingore file. |
404.html | 404 error page for the static website. |
_config.yml | Jekyll file for site-wide configurations. |
Gemfile | Ruby file used to list the needed Ruby Gems to run Jekyll. |
Gemfile.lock | Ruby file listing all the necessary Ruby Gem dependencies. |
index.md | Jekyll file with the content of the Home page. |
... .md | Jekyll files for specific pages. |
README.md | The very file you're reading right now. |
To serve the website locally, run bundle exec jekyll serve
and visit http://localhost:4000/e-editiones/.
To build the static website, run bundle exec jekyll build
and all necessary files will be available in the "\docs" folder.
To convert turtle files to the needed formats:
- Any turtle file needs to be in the "ontology" folder.
- Be aware of the correct file naming (see Add New Ontologies below)
- cd into "ttl_conv" with
cd ttl_conv
. - Activate your virtual environment, if not activated, with
source env/bin/activate
. - Run
python3 -W ignore convert_files.py
.-W ignore
is optional but it ignores some default RDFlib messages.- The script validates available turtle files and stops with error messages if there are invalid files.
- If there are no errors, the script converts the turtle files to RDF/XML, N-Triples and JSON-LD.
- The script then continues to convert the RDF/XML files to HTML.
- RDF/XML, N-Triples and JSON-LD files are saved in the "ontology" folder.
- HTML files are saved in "_includes/ontologies".
- Build the site by running
bundle exec jekyll build
, which will generate static page files in the /docs directory. - Add changes to Git, commit them and push everything to GitHub:
git add .
git commit -m "Deploy site to GitHub Pages"
(or whatever message suits your needs)git push
You might need to wait a few minutes to see any changes on the actual website.
To add a new ontology to the website, the following steps are necessary:
- Have the ontology ready as a turtle file.
- Name the ontology file in accordance with the ending of the IRI.
- I.e. if the base IRI is http://e-editiones.ch/ontology/agent, the ontology file should be agent.ttl.
- Save the ontology file in the "ontology" folder.
- Create a new markdown file in the of the "collections" subfolders ("_external", "_generalDomain", "_generalHumanities", "_project", "_specificHumanities").
- The name of the file must be the same as the name of the ontolgoy file.
- You can create a new collection by creating a new subfolder and updating the "_config.yml" file accordingly.
- Add front-matter meta data to the newly created markdown file (title, description, file). E.g.:
Everything written below the front matter will be shown on the ontology page as well.
--- title: Petrus Lombard' Sentences description: An ontology for the Digital Repertory of Commentaries on Peter Lombard’s Sentences file: drcs ---
- Convert the available turtle files as described above.