Skip to content

Commit db020be

Browse files
authored
Merge pull request #23 from sdsc-ordes/main
Pull main into develop
2 parents 21b4dfc + 926c3bf commit db020be

File tree

11 files changed

+3725
-3545
lines changed

11 files changed

+3725
-3545
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,25 @@ on:
77
required: false
88
type: boolean
99
default: false
10+
push:
11+
branches:
12+
- main
13+
tags:
14+
- "v*"
15+
pull_request:
16+
branches:
17+
- main
1018

11-
jobs:
1219

20+
jobs:
1321
build:
1422
runs-on: ubuntu-latest
1523

1624
steps:
17-
1825
- uses: actions/checkout@v4
19-
26+
with:
27+
ref: main
28+
fetch-depth: 0
2029
- name: Set up Python
2130
uses: actions/setup-python@v5
2231
with:
@@ -27,14 +36,28 @@ jobs:
2736
python -m pip install --upgrade pip
2837
pip install -r tools/python/requirements.txt
2938
30-
- name: build
39+
- name: Build combined ontology and schemas
3140
run: |
3241
bash ./tools/bash/build/create-combined-turtle.sh src/imaging-ontology/
3342
python ./tools/python/build/create-schemas.py --input build/ontology_combined.ttl --output build/locales/en/schema.json
3443
35-
- name: upload assets in artifacts
36-
uses: actions/upload-artifact@v4
37-
if: ${{ inputs.is_release }}
38-
with:
39-
name: schema-bundle
40-
path: build/*
44+
- name: Commit and push built files back to repo
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: |
48+
git config user.name "github-actions[bot]"
49+
git config user.email "github-actions[bot]@users.noreply.github.com"
50+
51+
git add build/
52+
53+
if ! git diff --cached --quiet; then
54+
git commit -m "Update generated build files"
55+
56+
# Fetch latest main and rebase
57+
git fetch origin main
58+
git rebase origin/main
59+
60+
git push origin main
61+
else
62+
echo "No changes in build folder, nothing to commit."
63+
fi

.github/workflows/docs.yml

Lines changed: 70 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,78 @@
1-
# name: Build ontology docs
1+
name: SHACL Documentation Generation
22

3-
# on:
4-
# workflow_call:
3+
on:
4+
push:
5+
paths:
6+
- 'src/imaging-ontology/**'
7+
pull_request:
8+
paths:
9+
- 'src/imaging-ontology/**'
510

6-
# jobs:
11+
jobs:
12+
generate-docs:
13+
runs-on: ubuntu-latest
714

8-
# build:
9-
# runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
1018

11-
# steps:
19+
- name: Set up Python and install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install rdflib
1223
13-
# - uses: actions/checkout@v4
24+
- name: Enrich ontology with rdflib
25+
id: enrich
26+
run: |
27+
python tools/python/docs/sparql.py
28+
echo "enriched_file=/tmp/enriched.ttl" >> $GITHUB_ENV
29+
1430
15-
# - name: Set up Python
16-
# uses: actions/setup-python@v5
17-
# with:
18-
# python-version: '3.12'
31+
- name: Set up Java 11
32+
uses: actions/setup-java@v4
33+
with:
34+
distribution: 'temurin'
35+
java-version: '11'
1936

20-
# - name: Install dependencies
21-
# run: |
22-
# python -m pip install --upgrade pip
23-
# pip install
37+
- name: Install Graphviz
38+
run: |
39+
sudo apt-get update
40+
sudo apt-get install -y graphviz
2441
25-
# TODO: BUILD DOCUMENTATION USING RESPECTER
42+
- name: Set DOT_PATH environment variable
43+
run: echo "GRAPHVIZ_DOT=/usr/bin/dot" >> $GITHUB_ENV
44+
45+
- name: Download SHACL Play CLI
46+
run: |
47+
wget https://github.com/sparna-git/shacl-play/releases/download/0.10.2/shacl-play-app-0.10.2-onejar.jar -O shacl-play-cli.jar
48+
49+
- name: Generate Documentation
50+
run: |
51+
java -jar shacl-play-cli.jar \
52+
doc \
53+
-d \
54+
-i ${{ env.enriched_file }} \
55+
-l en \
56+
-o docs/index.html
57+
58+
- name: Generate Ontology Diagram
59+
run: |
60+
java -jar shacl-play-cli.jar \
61+
draw \
62+
-i ${{ env.enriched_file }} \
63+
-o docs/ontology.svg
64+
65+
- name: Commit generated docs
66+
run: |
67+
git config user.name "github-actions[bot]"
68+
git config user.email "github-actions[bot]@users.noreply.github.com"
69+
git add docs/index.html
70+
git add docs/ontology.svg
71+
git commit -m "Update generated docs" || echo "Nothing to commit"
72+
git push
73+
74+
- name: Upload generated documentation as an artifact
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: shacl-documentation
78+
path: docs/index.html

.github/workflows/main-and-pr.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
8-
workflow_call:
9-
107
pull_request:
118
branches:
129
- main
@@ -17,6 +14,3 @@ jobs:
1714

1815
build:
1916
uses: ./.github/workflows/build.yml
20-
with:
21-
is_release: false
22-

.github/workflows/release.yml

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Include ontology assets in the release
1+
name: Release workflow
22

33
on:
44
push:
@@ -8,30 +8,9 @@ on:
88
jobs:
99

1010
build:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v4
14-
15-
- name: Set up Python
16-
uses: actions/setup-python@v5
17-
with:
18-
python-version: '3.12'
19-
20-
- name: Install dependencies
21-
run: |
22-
python -m pip install --upgrade pip
23-
pip install -r tools/python/requirements.txt
24-
25-
- name: Build ontology assets
26-
run: |
27-
bash ./tools/bash/build/create-combined-turtle.sh src/imaging-ontology/
28-
python ./tools/python/build/create-schemas.py --input build/ontology_combined.ttl --output build/locales/en/schema.json
29-
30-
- name: Upload schema bundle
31-
uses: actions/upload-artifact@v4
32-
with:
33-
name: schema-bundle
34-
path: build/*
11+
uses: ./.github/workflows/build.yml
12+
with:
13+
is_release: true # optional, now unused
3514

3615
checks:
3716
uses: ./.github/workflows/checks.yml
@@ -44,13 +23,13 @@ jobs:
4423
steps:
4524
- uses: actions/checkout@v4
4625

47-
- name: Get schema assets
48-
uses: actions/download-artifact@v4.1.8
26+
- name: Download built assets
27+
uses: actions/download-artifact@v4
4928
with:
5029
name: schema-bundle
5130
path: build/
5231

53-
- name: Create release
32+
- name: Create GitHub release
5433
uses: softprops/action-gh-release@v2
5534
with:
5635
files: build/*

build/locales/en/schema.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"ExecutableNotebook_label": "Executable Notebook",
2222
"FeatureEnum_label": "Feature Enumeration",
2323
"HostTypeEnumeration_label": "Host Type Enumeration",
24+
"ImageObject_label": "Image object",
2425
"ImageObjectTagEnum_label": "Image Object Tag Enumeration",
2526
"ImagingModalityEnum_label": "Imaging Modality Enumeration",
2627
"IsPluginModuleOfEnum_label": "Plugin Module Enumeration",
@@ -32,7 +33,6 @@
3233
"DatasetSpecification_label": "Dataset Specification",
3334
"FundingInformation_label": "Funding Information",
3435
"SoftwareImage_label": "Software Image",
35-
"contentURL_label": "Content URL",
3636
"distribution_label": "Distribution",
3737
"AMD64_label": "AMD64",
3838
"ARM64_label": "ARM64",
@@ -162,6 +162,7 @@
162162
"author_label": "Author",
163163
"codeRepository_label": "Code repository",
164164
"conditionsOfAccess_label": "Conditions of access",
165+
"contentUrl_label": "Content URL",
165166
"defaultValue_label": "Default value",
166167
"encodingFormat_label": "Encoding format",
167168
"familyName_label": "Family name",
@@ -243,6 +244,7 @@
243244
"ExecutableNotebook_placeholder": "An object representing an executable notebook such as Jupyter Notebook",
244245
"FeatureEnum_placeholder": "Enumeration class for software features",
245246
"HostTypeEnumeration_placeholder": "Enumeration class for host type",
247+
"ImageObject_placeholder": "An image of the software, typically a screenshot, before/after or a logo.",
246248
"ImageObjectTagEnum_placeholder": "Enumeration class for image object tag",
247249
"ImagingModalityEnum_placeholder": "Enumeration class for imaging modality",
248250
"IsPluginModuleOfEnum_placeholder": "Enumeration class for plugin module",
@@ -254,7 +256,6 @@
254256
"DatasetSpecification_placeholder": "Class designed to describe a type of input or output used or produced by a model. For example, Topoflow has several inputs. One of them is a text file with precipitation values. The representation of this input is an instance of a dataset specification.",
255257
"FundingInformation_placeholder": "A class to represent the funding information of a software project",
256258
"SoftwareImage_placeholder": "An image that virtualizes the functionality of a given software. For example, a Docker container.",
257-
"contentURL_placeholder": "Actual bytes of the media object, for example the image file or video file.",
258259
"distribution_placeholder": "A downloadable form of this dataset, at a specific location, in a specific format.",
259260
"hasInput_placeholder": "Property that links a model configuration to the input types expected by it.",
260261
"hasOutput_placeholder": "Property that expresses what the outputs of a model are",
@@ -263,6 +264,7 @@
263264
"author_placeholder": "The author of the software, this can be organizations or people that are maintainers and/or producers of the software.",
264265
"codeRepository_placeholder": "Primary link to the repository where the un-compiled, human readable code and related code is located (GitLab, GitHub, CodePlex etc.).",
265266
"conditionsOfAccess_placeholder": "Conditions that affect the availability of, or method(s) of access to, an item. e.g. log-in required ",
267+
"contentUrl_placeholder": "Actual bytes of the media object, for example the image file or video file.",
266268
"defaultValue_placeholder": "The default value of the input. For properties that expect a literal, the default is a literal value, for properties that expect an object, it's an ID reference to one of the current values.",
267269
"encodingFormat_placeholder": "Expressed using a MIME format (http://www.iana.org/assignments/media-types/media-types.xhtml).",
268270
"familyName_placeholder": "Family name. In the U.S., the last name of a Person.",

0 commit comments

Comments
 (0)