Skip to content

Commit 7c8372b

Browse files
committed
published on onto.vaimee.com
1 parent 7da0ebc commit 7c8372b

15 files changed

Lines changed: 1025 additions & 83 deletions

File tree

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.git
2+
.github
3+
.idea
4+
!public/
5+
public/*
6+
!public/ICON_VAIMEE.svg
7+
rdf2html/node_modules
8+
rdf2html/package-lock.json

.github/workflows/publish.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish ontologies
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
24+
- name: Log in to Docker Hub
25+
uses: docker/login-action@v3
26+
with:
27+
username: ${{ secrets.DOCKERHUB_USERNAME }}
28+
password: ${{ secrets.DOCKERHUB_TOKEN }}
29+
30+
- name: Docker metadata
31+
id: meta
32+
uses: docker/metadata-action@v5
33+
with:
34+
images: ${{ vars.DOCKERHUB_REPOSITORY }}
35+
tags: |
36+
type=ref,event=branch
37+
type=sha,prefix=sha-
38+
type=raw,value=latest,enable={{is_default_branch}}
39+
40+
- name: Build and publish
41+
uses: docker/build-push-action@v6
42+
with:
43+
context: .
44+
push: true
45+
tags: ${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
.idea/
2+
public/
3+
!public/
4+
public/*
5+
!public/ICON_VAIMEE.svg
6+
rdf2html/node_modules/

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM node:20-alpine AS build
2+
3+
RUN apk add --no-cache git
4+
5+
WORKDIR /app
6+
7+
COPY rdf2html/package.json ./rdf2html/package.json
8+
RUN npm install --prefix rdf2html
9+
10+
COPY . .
11+
RUN npm run --prefix rdf2html build
12+
13+
FROM nginx:1.27-alpine
14+
15+
COPY nginx.conf /etc/nginx/conf.d/default.conf
16+
COPY --from=build /app/public /usr/share/nginx/html
17+
18+
EXPOSE 80

README.md

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,171 @@
11
# ontologies
2+
23
A collection of ontologies developed by VAIMEE, integrating classes and properties from well-known ontologies to ensure interoperability and alignment with existing standards.
4+
5+
## Requirements
6+
7+
- Node.js 20 or newer for local HTML generation.
8+
- npm for installing the renderer dependencies.
9+
- Docker for building and running the nginx container locally.
10+
- A GitHub repository with GitHub Actions enabled for CI/CD publishing to Docker Hub.
11+
12+
## Ontology Requirements
13+
14+
The renderer discovers ontology sources automatically from first-level ontology folders such as `agora/`, `jsap/`, `msg/`, `users/`, and `fsm/`.
15+
16+
Each ontology source should:
17+
18+
- Use Turtle-compatible syntax and have a `.ttl` or `.owl` extension.
19+
- Declare one ontology resource with `rdf:type owl:Ontology` or `a owl:Ontology`.
20+
- Define classes as `owl:Class` and properties as `owl:ObjectProperty` or `owl:DatatypeProperty`.
21+
- Prefer `rdfs:label` and `rdfs:comment` on classes and properties so the generated documentation has readable names and descriptions.
22+
- Prefer ontology-level metadata: `owl:title`, `dct:abstract`, and `dct:description`.
23+
24+
If ontology-level title, abstract, or description metadata is missing, the renderer adds fallback metadata in memory while generating HTML. The source ontology file is not modified.
25+
26+
## Generate HTML Documentation
27+
28+
Install dependencies once:
29+
30+
```sh
31+
npm install --prefix rdf2html
32+
```
33+
34+
Generate all ontology pages and the landing page:
35+
36+
```sh
37+
npm run --prefix rdf2html build
38+
```
39+
40+
The build writes generated HTML beside each ontology source and creates a `public/` directory ready to be served by nginx. The landing page uses `public/ICON_VAIMEE.svg`, `#10B1D8`, and `#0F3E65`.
41+
42+
## Build Locally
43+
44+
Build the nginx image:
45+
46+
```sh
47+
docker build -t ontologies .
48+
```
49+
50+
Run it locally:
51+
52+
```sh
53+
docker run --rm -p 8080:80 ontologies
54+
```
55+
56+
Open `http://localhost:8080` to browse the generated ontology documentation.
57+
58+
## Deploy With CI/CD
59+
60+
The workflow in `.github/workflows/publish.yml` builds the Docker image and publishes it to Docker Hub.
61+
62+
It runs automatically on pushes to `main` or `master`, and can also be started manually from the GitHub Actions tab.
63+
64+
### Configure Docker Hub
65+
66+
Create a Docker Hub repository before publishing the image. For example, create `lroffia/ontologies` from the Docker Hub web interface.
67+
68+
Create a Docker Hub access token from Docker Hub account settings. Use this token for automation instead of your account password.
69+
70+
Configure these GitHub repository settings before running the workflow:
71+
72+
- Secret `DOCKERHUB_USERNAME`: your Docker Hub username.
73+
- Secret `DOCKERHUB_TOKEN`: a Docker Hub access token. Use an access token instead of your account password.
74+
- Variable `DOCKERHUB_REPOSITORY`: the Docker Hub image name, for example `lroffia/ontologies`.
75+
76+
### Publish From GitHub Actions
77+
78+
After configuring the repository settings, push to `main` or `master`:
79+
80+
```sh
81+
git push origin main
82+
```
83+
84+
Or start the `Publish ontologies` workflow manually from the GitHub Actions tab.
85+
86+
The workflow builds the Docker image from `Dockerfile`, regenerates the ontology HTML during the Docker build, and pushes the image to Docker Hub.
87+
88+
The published image is tagged as:
89+
90+
- `<dockerhub-repository>:latest` for the default branch.
91+
- `<dockerhub-repository>:<branch>` for branch builds.
92+
- `<dockerhub-repository>:sha-<commit>` for immutable commit builds.
93+
94+
### Publish Manually
95+
96+
To build and push the image from your local machine:
97+
98+
```sh
99+
docker login -u <dockerhub-username>
100+
docker build -t <dockerhub-repository>:latest .
101+
docker push <dockerhub-repository>:latest
102+
```
103+
104+
For example:
105+
106+
```sh
107+
docker login -u lroffia
108+
docker build -t lroffia/ontologies:latest .
109+
docker push lroffia/ontologies:latest
110+
```
111+
112+
Use a Docker Hub access token when Docker asks for the password.
113+
114+
### Build Multi-Architecture Images On macOS
115+
116+
Docker Desktop for macOS includes Buildx. Use it to build images for both Apple Silicon and Linux AMD64 servers.
117+
118+
Create and select a Buildx builder:
119+
120+
```sh
121+
docker buildx create --name ontologies-builder --use
122+
docker buildx inspect --bootstrap
123+
```
124+
125+
Build and push a multi-architecture image to Docker Hub:
126+
127+
```sh
128+
docker login -u <dockerhub-username>
129+
docker buildx build \
130+
--platform linux/amd64,linux/arm64 \
131+
-t <dockerhub-repository>:latest \
132+
--push \
133+
.
134+
```
135+
136+
For example:
137+
138+
```sh
139+
docker login -u lroffia
140+
docker buildx build \
141+
--platform linux/amd64,linux/arm64 \
142+
-t lroffia/ontologies:latest \
143+
--push \
144+
.
145+
```
146+
147+
Use `--push` for multi-architecture images. Docker cannot load a multi-platform manifest into the local Docker image store with `--load`.
148+
149+
To build only for the current Mac architecture and load it locally:
150+
151+
```sh
152+
docker buildx build --platform linux/arm64 -t ontologies:local --load .
153+
```
154+
155+
To build an AMD64 image on Apple Silicon and load it locally for testing:
156+
157+
```sh
158+
docker buildx build --platform linux/amd64 -t ontologies:amd64 --load .
159+
```
160+
161+
### Run The Published Image
162+
163+
To deploy the published container on a server:
164+
165+
```sh
166+
docker login -u <dockerhub-username>
167+
docker pull <dockerhub-repository>:latest
168+
docker run -d --name ontologies --restart unless-stopped -p 80:80 <dockerhub-repository>:latest
169+
```
170+
171+
Replace `<dockerhub-username>` and `<dockerhub-repository>` with your Docker Hub account and repository values.

agora/agora_ontology.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ <h2>Introduction</h2>
3838
<section><h4>Horizon</h4><p>IRI: <code>https://ontologies.vaimee.com/agora/criteria#Horizon</code></p><span>Represents a specific layer within a soil profile, characterized by depth and composition.</span><table class="def"><tbody><tr><td>In the domain of</td><td><code><a href="https://ontologies.vaimee.com/agora/criteria#bulkDensity">https://ontologies.vaimee.com/agora/criteria#bulkDensity</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#clay">https://ontologies.vaimee.com/agora/criteria#clay</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#coarseFragment">https://ontologies.vaimee.com/agora/criteria#coarseFragment</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#horizonNumber">https://ontologies.vaimee.com/agora/criteria#horizonNumber</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#kSat">https://ontologies.vaimee.com/agora/criteria#kSat</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#lowerDepth">https://ontologies.vaimee.com/agora/criteria#lowerDepth</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#organicMatter">https://ontologies.vaimee.com/agora/criteria#organicMatter</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#sand">https://ontologies.vaimee.com/agora/criteria#sand</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#silt">https://ontologies.vaimee.com/agora/criteria#silt</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#thetaSat">https://ontologies.vaimee.com/agora/criteria#thetaSat</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#upperDepth">https://ontologies.vaimee.com/agora/criteria#upperDepth</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#waterContent">https://ontologies.vaimee.com/agora/criteria#waterContent</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#waterPotential">https://ontologies.vaimee.com/agora/criteria#waterPotential</a></code></td></tr><tr><td>In the range of</td><td><code><a href="https://ontologies.vaimee.com/agora/criteria#horizon">https://ontologies.vaimee.com/agora/criteria#horizon</a></code></td></tr></tbody></table></section>
3939
<section><h4>Meteo_location</h4><p>IRI: <code>https://ontologies.vaimee.com/agora/criteria#Meteo_location</code></p><span>A geographic point responsible for providing weather data (observed or forecast) to one or more Units.</span><table class="def"><tbody><tr><td>In the domain of</td><td><code><a href="http://schema.org/elevation">http://schema.org/elevation</a></code><br><code><a href="http://schema.org/latitude">http://schema.org/latitude</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#forecastType">https://ontologies.vaimee.com/agora/criteria#forecastType</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#waterTableAlpha">https://ontologies.vaimee.com/agora/criteria#waterTableAlpha</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#weatherType">https://ontologies.vaimee.com/agora/criteria#weatherType</a></code><br><code><a href="https://ontologies.vaimee.com/agora/weather#bulkDays">https://ontologies.vaimee.com/agora/weather#bulkDays</a></code></td></tr><tr><td>In the range of</td><td><code><a href="https://ontologies.vaimee.com/agora/criteria#hasIdMeteo">https://ontologies.vaimee.com/agora/criteria#hasIdMeteo</a></code></td></tr></tbody></table></section>
4040
<section><h4>Soil</h4><p>IRI: <code>https://ontologies.vaimee.com/agora/criteria#Soil</code></p><span>The physical profile of the earth at a specific location.</span><table class="def"><tbody><tr><td>In the domain of</td><td><code><a href="http://schema.org/identifier">http://schema.org/identifier</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#horizon">https://ontologies.vaimee.com/agora/criteria#horizon</a></code></td></tr></tbody></table></section>
41-
<section><h4>Unit</h4><p>IRI: <code>https://ontologies.vaimee.com/agora/criteria#Unit</code></p><span>A unit in our system is a tuple composed of [soil-type,crop-type,meteo-station]</span><table class="def"><tbody><tr><td>In the domain of</td><td><code><a href="http://schema.org/description">http://schema.org/description</a></code><br><code><a href="http://schema.org/location">http://schema.org/location</a></code><br><code><a href="http://schema.org/name">http://schema.org/name</a></code><br><code><a href="http://www.w3.org/2002/07/owl#topDataProperty">http://www.w3.org/2002/07/owl#topDataProperty</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#hasIdCrop">https://ontologies.vaimee.com/agora/criteria#hasIdCrop</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#hasIdMeteo">https://ontologies.vaimee.com/agora/criteria#hasIdMeteo</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#hasIdSoil">https://ontologies.vaimee.com/agora/criteria#hasIdSoil</a></code></td></tr><tr><td>In the range of</td><td><code><a href="http://www.w3.org/ns/sosa/hasFeatureOfInterest">http://www.w3.org/ns/sosa/hasFeatureOfInterest</a></code></td></tr></tbody></table></section>
41+
<section><h4>Unit</h4><p>IRI: <code>https://ontologies.vaimee.com/agora/criteria#Unit</code></p><span>A unit in our system is a tuple composed of [soil-type,crop-type,meteo-station]</span><table class="def"><tbody><tr><td>In the domain of</td><td><code><a href="http://schema.org/description">http://schema.org/description</a></code><br><code><a href="http://schema.org/location">http://schema.org/location</a></code><br><code><a href="http://schema.org/name">http://schema.org/name</a></code><br><code><a href="http://www.w3.org/2002/07/owl#topDataProperty">http://www.w3.org/2002/07/owl#topDataProperty</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#hasIdCrop">hasIdCrop</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#hasIdMeteo">https://ontologies.vaimee.com/agora/criteria#hasIdMeteo</a></code><br><code><a href="https://ontologies.vaimee.com/agora/criteria#hasIdSoil">hasIdSoil</a></code></td></tr><tr><td>In the range of</td><td><code><a href="http://www.w3.org/ns/sosa/hasFeatureOfInterest">http://www.w3.org/ns/sosa/hasFeatureOfInterest</a></code></td></tr></tbody></table></section>
4242
<section><h4>BulkLoad</h4><p>IRI: <code>https://ontologies.vaimee.com/agora/weather#BulkLoad</code></p><span>Represents a high-volume data ingestion process for historical weather records.</span><table class="def"><tbody></tbody></table></section>
4343
<section><h4>Forecast</h4><p>IRI: <code>https://ontologies.vaimee.com/agora/weather#Forecast</code></p><span>Data structure for predicted weather conditions at a specific location.</span><table class="def"><tbody></tbody></table></section>
44-
<section><h4>History</h4><p>IRI: <code>https://ontologies.vaimee.com/agora/weather#History</code></p><span>Data structure for verified past weather observations.</span><table class="def"><tbody></tbody></table></section></section><section><h3>Object Properties</h3></section><section><h3>Datatype Properties</h3><section><h4>hasIdCrop</h4><p>IRI: <code>https://ontologies.vaimee.com/agora/criteria#hasIdCrop</code></p><span>Links a crop to a specific plant type.</span><table class="def"><tbody><tr><td>Domain includes</td><td><code><a href="https://ontologies.vaimee.com/agora/criteria#Unit">https://ontologies.vaimee.com/agora/criteria#Unit</a></code></td></tr><tr><td>Range includes</td><td></td></tr></tbody></table></section>
45-
<section><h4>hasIdSoil</h4><p>IRI: <code>https://ontologies.vaimee.com/agora/criteria#hasIdSoil</code></p><span>Links a soil to a specific unit</span><table class="def"><tbody><tr><td>Domain includes</td><td><code><a href="https://ontologies.vaimee.com/agora/criteria#Unit">https://ontologies.vaimee.com/agora/criteria#Unit</a></code></td></tr><tr><td>Range includes</td><td><code><a href="http://www.w3.org/2001/XMLSchema#integer">http://www.w3.org/2001/XMLSchema#integer</a></code></td></tr></tbody></table></section></section></section>
44+
<section><h4>History</h4><p>IRI: <code>https://ontologies.vaimee.com/agora/weather#History</code></p><span>Data structure for verified past weather observations.</span><table class="def"><tbody></tbody></table></section></section><section><h3>Object Properties</h3></section><section><h3>Datatype Properties</h3><section><h4>hasIdCrop</h4><p>IRI: <code>https://ontologies.vaimee.com/agora/criteria#hasIdCrop</code></p><span>Links a crop to a specific plant type.</span><table class="def"><tbody><tr><td>Domain includes</td><td><code><a href="https://ontologies.vaimee.com/agora/criteria#Unit">Unit</a></code></td></tr><tr><td>Range includes</td><td></td></tr></tbody></table></section>
45+
<section><h4>hasIdSoil</h4><p>IRI: <code>https://ontologies.vaimee.com/agora/criteria#hasIdSoil</code></p><span>Links a soil to a specific unit</span><table class="def"><tbody><tr><td>Domain includes</td><td><code><a href="https://ontologies.vaimee.com/agora/criteria#Unit">Unit</a></code></td></tr><tr><td>Range includes</td><td><code><a href="http://www.w3.org/2001/XMLSchema#integer">http://www.w3.org/2001/XMLSchema#integer</a></code></td></tr></tbody></table></section></section></section>
4646
</body>
4747
</html>

0 commit comments

Comments
 (0)