Skip to content

Commit 0dcf99e

Browse files
authored
Merge pull request #22 from eccenca/develop
release
2 parents 490c62f + 3baf268 commit 0dcf99e

File tree

9 files changed

+233
-50
lines changed

9 files changed

+233
-50
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ jobs:
99
docker:
1010
runs-on: ubuntu-latest
1111
steps:
12-
-
13-
name: Set up QEMU
12+
- name: Set up QEMU
1413
uses: docker/setup-qemu-action@v2
15-
-
16-
name: Set up Docker Buildx
14+
- name: Set up Docker Buildx
1715
uses: docker/setup-buildx-action@v2
18-
-
19-
name: Login to GitHub Container Registry
16+
- name: Login to GitHub Container Registry
2017
uses: docker/login-action@v2
2118
with:
2219
registry: ghcr.io
@@ -28,8 +25,7 @@ jobs:
2825
with:
2926
images: |
3027
ghcr.io/eccenca/jod
31-
-
32-
name: Build and push
28+
- name: Build and push
3329
uses: docker/build-push-action@v3
3430
with:
3531
push: true

CHANGELOG.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,71 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/) resp. [zer0ver](https://0ver.org/).
66

77
## [Unreleased]
88

9+
### Add
10+
11+
### Fixed
12+
13+
### Changed
14+
15+
### Remove
16+
17+
18+
## [0.4.0] 2025-10-08
19+
920
TODO: add at least one Added, Changed, Deprecated, Removed, Fixed or Security section
1021

1122
### Add
23+
- Add examples of jod to the README
24+
- Display owl:NamedIndividuals
25+
- Add sections to the navigation
26+
- Adjust filter to filter for section contents
27+
28+
### Fixed
29+
- Install `git` in build stage so that gem build does not fail
30+
31+
### Changed
32+
- Specify registry for OCI base image in Dockerfile
33+
- Show section headings only if section is not empty
34+
- Disable buttons for empty sections
1235

13-
-
36+
### Remove
37+
- Remove empty "Overview" section
38+
39+
40+
## [0.3.2] 2023-07-03
41+
42+
### Fixed
43+
- Rename task to gem:push
44+
45+
46+
## [0.3.1] 2023-07-03
1447

1548
### Fixed
49+
- Update rake dependency to 13
1650

17-
-
51+
52+
## [0.3.0] 2023-07-03
53+
54+
### Add
55+
- Taskfile
56+
57+
### Fixed
58+
- Fix permissions for `write_config.sh` in docker image
59+
- Fix environment value in `write_config.sh` in docker image
1860

1961
### Changed
62+
- Depend on Jekyll RDF '~> 4.0'
63+
- Remove support for linux/ppc64le
64+
- Set gem version based on git tag
2065

21-
-
2266

2367
## [0.2.6] 2022-11-14
2468

2569
### Add
26-
2770
- Add the `_config.yml` to the gem
2871
- Dockerfile
2972
- CHANGELOG ;-)

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM ruby:3.1-slim AS builder
1+
FROM docker.io/library/ruby:3.1-slim AS builder
22

3-
RUN apt-get update && apt-get -y install build-essential && rm -rf /var/lib/apt/lists/*
3+
RUN apt-get update && apt-get -y install build-essential git && rm -rf /var/lib/apt/lists/*
44
WORKDIR jekyll-theme-jod
55

66
ADD . .
77
RUN gem build jekyll-theme-jod.gemspec && \
88
gem install jekyll-theme-jod-*.gem mustache
99

10-
FROM ruby:3.1-slim
10+
FROM docker.io/library/ruby:3.1-slim
1111
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
1212
COPY --from=builder /jekyll-theme-jod/docker-resources/ /docker-resources
1313
RUN apt-get update && apt-get -y install jq && rm -rf /var/lib/apt/lists/*

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,14 @@ When your theme is released, only the files in `_layouts`, `_includes`, and `_sa
6868
6969
The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). Take a look at the `LICENSE` file.
7070
71-
## Screenshot
71+
## Examples and Screenshot
7272
7373
![Screenshot](./Screenshot.png "Screenshot")
7474
75+
Examples of using jod
76+
- [diggr Video Game Vocabulary](https://diggr.github.io/diggr-video-game-vocabulary/) ([repo](https://github.com/diggr/diggr-video-game-vocabulary))
77+
- [GND Ontology](https://d-nb.info/standards/elementset/gnd)
78+
7579
## Related Projects
7680
7781
- [Widoco](https://github.com/dgarijo/Widoco), a Wizard for documenting ontologies

Taskfile.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
version: '3'
2+
3+
env:
4+
BUNDLE_PATH: .vendor
5+
6+
vars:
7+
GIT_DESCRIBE:
8+
sh: git describe --tags --dirty --always
9+
GEM_VERSION:
10+
sh: ruby -e "if Gem::Version.new(ARGV[0]).prerelease? then puts Gem::Version.new(Gem::Version.new(ARGV[0].split('-')[0]).bump().to_s + '-' + ARGV[0].split('-')[1..].join('.')) else puts Gem::Version.new(ARGV[0]) end" {{.GIT_DESCRIBE}}
11+
GEM_NAME: jekyll-theme-jod
12+
DOCKER_IMAGE: eccenca/jod
13+
14+
tasks:
15+
16+
default:
17+
desc: The list of all defined tasks
18+
cmds:
19+
- task -a
20+
21+
info:
22+
desc: Output some variables
23+
cmds:
24+
- |
25+
echo "GIT_DESCRIBE: {{.GIT_DESCRIBE}}"
26+
echo "GEM_VERSION: {{.GEM_VERSION}}"
27+
echo "GEM_NAME: {{.GEM_NAME}}"
28+
echo "DOCKER_IMAGE: {{.DOCKER_IMAGE}}"
29+
30+
install:
31+
desc: Install jekyll rdf and its dependencies with bundle
32+
cmds:
33+
- bundle install
34+
35+
gem:build:
36+
desc: Build the ruby gem
37+
cmds:
38+
- gem build {{.GEM_NAME}}.gemspec
39+
40+
gem:push:
41+
desc: Push the gem to rubygems.org
42+
cmds:
43+
- gem push {{.GEM_NAME}}-{{.GEM_VERSION}}.gem
44+
45+
docker:build:
46+
desc: Build the docker image
47+
cmds:
48+
- docker build --no-cache -t {{.DOCKER_IMAGE}}:{{.GEM_VERSION}} .

_includes/navigation.html

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,51 @@
2020

2121
<ul class="nav nav-pills flex-column" id="search-list">
2222
{% for result in classesResultset %}
23+
{%- if forloop.first %}
24+
<li class="list-group-item list-group-item-dark disabled"><div class="fw-bold">Classes</div></li>
25+
{% endif -%}
2326
<li class="nav-item">
24-
<a class="nav-link" href="#id-{{ result.subject.iri | md5 }}">
27+
<a search-string="class" class="nav-link" href="#id-{{ result.subject.iri | md5 }}">
28+
{% include label.html iri = result.subject.iri %}
29+
</a>
30+
</li>
31+
{% endfor %}
32+
{% for result in rdfPropertiesResultset %}
33+
{%- if forloop.first %}
34+
<li class="list-group-item list-group-item-dark disabled"><div class="fw-bold">RDF Properties</div></li>
35+
{% endif -%}
36+
<li class="nav-item">
37+
<a search-string="rdf property" class="nav-link" href="#id-{{ result.subject.iri | md5 }}">
2538
{% include label.html iri = result.subject.iri %}
2639
</a>
2740
</li>
2841
{% endfor %}
2942
{% for result in objectPropertiesResultset %}
43+
{%- if forloop.first %}
44+
<li class="list-group-item list-group-item-dark disabled"><div class="fw-bold">Object Properties</div></li>
45+
{% endif -%}
3046
<li class="nav-item">
31-
<a class="nav-link" href="#id-{{ result.subject.iri | md5 }}">
47+
<a search-string="object property" class="nav-link" href="#id-{{ result.subject.iri | md5 }}">
3248
{% include label.html iri = result.subject.iri %}
3349
</a>
3450
</li>
3551
{% endfor %}
3652
{% for result in datatypePropertiesResultset %}
53+
{%- if forloop.first %}
54+
<li class="list-group-item list-group-item-dark disabled"><div class="fw-bold">Datatype Properties</div></li>
55+
{% endif -%}
56+
<li class="nav-item">
57+
<a search-string="datatype proeprty" class="nav-link" href="#id-{{ result.subject.iri | md5 }}">
58+
{% include label.html iri = result.subject.iri %}
59+
</a>
60+
</li>
61+
{% endfor %}
62+
{% for result in namedIndividualsResultset %}
63+
{%- if forloop.first %}
64+
<li class="list-group-item list-group-item-dark disabled"><div class="fw-bold">Named Individuals</div></li>
65+
{% endif -%}
3766
<li class="nav-item">
38-
<a class="nav-link" href="#id-{{ result.subject.iri | md5 }}">
67+
<a search-string="named individual" class="nav-link" href="#id-{{ result.subject.iri | md5 }}">
3968
{% include label.html iri = result.subject.iri %}
4069
</a>
4170
</li>
@@ -53,11 +82,14 @@
5382
// Loop through all list items, and hide those who don't match the search query
5483
for (i = 0; i < li.length; i++) {
5584
a = li[i].getElementsByTagName("a")[0];
56-
txtValue = a.textContent || a.innerText;
57-
if (txtValue.toUpperCase().indexOf(filter) > -1) {
58-
li[i].style.display = "";
59-
} else {
60-
li[i].style.display = "none";
85+
if (a != undefined) {
86+
txtValue = a.textContent || a.innerText;
87+
txtValue = txtValue + a.getAttribute("search-string");
88+
if (txtValue.toUpperCase().indexOf(filter) > -1) {
89+
li[i].style.display = "";
90+
} else {
91+
li[i].style.display = "none";
92+
}
6193
}
6294
}
6395
}

_includes/ontology-head.html

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -63,30 +63,26 @@ <h1 class="display-3">{{ site_title }}</h1>
6363
</dl>
6464
</p>
6565
<hr class="my-4">
66-
<p>
67-
{% for result in countClassResultSet %}
68-
<a class="btn btn-primary btn-lg" href="#classes" role="button">
66+
<p style="line-height: 3.3rem;">
67+
<a class="btn btn-primary btn-lg {% unless countClass > 0 %}disabled{% endunless %}" href="#classes" role="button">
6968
Classes
70-
<span class="badge badge-light">{{ result.classes}}</span>
69+
<span class="badge badge-light">{{ countClass }}</span>
7170
</a>
72-
{% endfor %}
73-
{% for result in countRdfPropertiesResultSet %}
74-
<a class="btn btn-primary btn-lg" href="#rdfProperties" role="button">
71+
<a class="btn btn-primary btn-lg {% unless countRdfProperties > 0 %}disabled{% endunless %}" href="#rdfProperties" role="button">
7572
RDF Properties
76-
<span class="badge badge-light">{{ result.rdfProperties}}</span>
73+
<span class="badge badge-light">{{ countRdfProperties }}</span>
7774
</a>
78-
{% endfor %}
79-
{% for result in countObjectPropertiesResultSet %}
80-
<a class="btn btn-primary btn-lg" href="#objectProperties" role="button">
75+
<a class="btn btn-primary btn-lg {% unless countObjectProperties > 0 %}disabled{% endunless %}" href="#objectProperties" role="button">
8176
Object Properties
82-
<span class="badge badge-light">{{ result.objectProperties}}</span>
77+
<span class="badge badge-light">{{ countObjectProperties}}</span>
8378
</a>
84-
{% endfor %}
85-
{%- for result in countDatatypePropertiesResultSet -%}
86-
<a class="btn btn-primary btn-lg" href="#datatypeProperties" role="button">
79+
<a class="btn btn-primary btn-lg {% unless countDatatypeProperties > 0 %}disabled{% endunless %}" href="#datatypeProperties" role="button">
8780
Datatype Properties
88-
<span class="badge badge-light">{{ result.datatypeProperties }}</span>
81+
<span class="badge badge-light">{{ countDatatypeProperties }}</span>
82+
</a>
83+
<a class="btn btn-primary btn-lg {% unless countNamedIndividuals > 0 %}disabled{% endunless %}" href="#namedIndividuals" role="button">
84+
Named Individuals
85+
<span class="badge badge-light">{{ countNamedIndividuals }}</span>
8986
</a>
90-
{%- endfor -%}
9187
</p>
9288
</div>

_layouts/ontology.html

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,31 +94,84 @@
9494
' %}
9595
{% assign countDatatypePropertiesResultSet = page.rdf | sparql_query: countDatatypePropertiesQuery %}
9696

97+
{% assign namedIndividualsQuery = '
98+
SELECT DISTINCT ?subject
99+
WHERE
100+
{
101+
?subject a ?class .
102+
FILTER ( ?class IN (owl:NamedIndividual) )
103+
FILTER isIRI(?subject)
104+
}
105+
ORDER BY ?label' %}
106+
{% assign namedIndividualsResultset = page.rdf | sparql_query: namedIndividualsQuery %}
107+
108+
{% assign countNamedIndividualsQuery = '
109+
SELECT DISTINCT (COUNT(?subject) as ?namedIndividuals)
110+
WHERE
111+
{
112+
?subject a ?class .
113+
FILTER ( ?class IN (owl:NamedIndividual) )
114+
FILTER isIRI(?subject)
115+
}
116+
' %}
117+
{% assign countNamedIndividualsResultSet = page.rdf | sparql_query: countNamedIndividualsQuery %}
118+
119+
120+
{% for result in countClassResultSet %}
121+
{% assign countClass = result.classes | plus: 0 %}
122+
{% endfor %}
123+
{% for result in countRdfPropertiesResultSet %}
124+
{% assign countRdfProperties = result.rdfProperties | plus: 0 %}
125+
{% endfor %}
126+
{% for result in countObjectPropertiesResultSet %}
127+
{% assign countObjectProperties = result.objectProperties | plus: 0 %}
128+
{% endfor %}
129+
{% for result in countDatatypePropertiesResultSet %}
130+
{% assign countDatatypeProperties = result.datatypeProperties | plus: 0 %}
131+
{% endfor %}
132+
{% for result in countNamedIndividualsResultSet %}
133+
{% assign countNamedIndividuals = result.namedIndividuals | plus: 0 %}
134+
{% endfor %}
135+
97136
<div class="container-fluid">
98137
<div class="row">
99138
{% include navigation.html iri = result.subject.iri %}
100139

101140
<main role="main" class="container col-sm-9 col-md-10 col-lg-8 col-xl-7">
102141
{% include ontology-head.html iri = result.subject.iri %}
103142

104-
<h2 id="classes">Overview</h2>
105-
<h2 id="classes">Classes</h2>
106143
{% for result in classesResultset %}
144+
{%- if forloop.first %}
145+
<h2 id="classes">Classes</h2>
146+
{% endif -%}
107147
<p>{% include class-card.html iri = result.subject.iri %}</p>
108148
{% endfor %}
109149

110-
<h2 id="rdfProperties">RDF Properties</h2>
111150
{% for result in rdfPropertiesResultset %}
151+
{%- if forloop.first %}
152+
<h2 id="rdfProperties">RDF Properties</h2>
153+
{% endif -%}
112154
<p>{% include class-card.html iri = result.subject.iri %}</p>
113155
{% endfor %}
114156

115-
<h2 id="objectProperties">Object Properties</h2>
116157
{% for result in objectPropertiesResultset %}
158+
{%- if forloop.first %}
159+
<h2 id="objectProperties">Object Properties</h2>
160+
{% endif -%}
117161
<p>{% include class-card.html iri = result.subject.iri %}</p>
118162
{% endfor %}
119163

120-
<h2 id="datatypeProperties">Datatype Properties</h2>
121164
{% for result in datatypePropertiesResultset %}
165+
{%- if forloop.first %}
166+
<h2 id="datatypeProperties">Datatype Properties</h2>
167+
{% endif -%}
168+
<p>{% include class-card.html iri = result.subject.iri %}</p>
169+
{% endfor %}
170+
171+
{% for result in namedIndividualsResultset %}
172+
{%- if forloop.first %}
173+
<h2 id="namedIndividuals">Named Individuals</h2>
174+
{% endif -%}
122175
<p>{% include class-card.html iri = result.subject.iri %}</p>
123176
{% endfor %}
124177

0 commit comments

Comments
 (0)