Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 33 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,25 @@ on:
required: false
type: boolean
default: false
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main

jobs:

jobs:
build:
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v4

with:
ref: main
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand All @@ -27,14 +36,28 @@ jobs:
python -m pip install --upgrade pip
pip install -r tools/python/requirements.txt

- name: build
- name: Build combined ontology and schemas
run: |
bash ./tools/bash/build/create-combined-turtle.sh src/imaging-ontology/
python ./tools/python/build/create-schemas.py --input build/ontology_combined.ttl --output build/locales/en/schema.json

- name: upload assets in artifacts
uses: actions/upload-artifact@v4
if: ${{ inputs.is_release }}
with:
name: schema-bundle
path: build/*
- name: Commit and push built files back to repo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

git add build/

if ! git diff --cached --quiet; then
git commit -m "Update generated build files"

# Fetch latest main and rebase
git fetch origin main
git rebase origin/main

git push origin main
else
echo "No changes in build folder, nothing to commit."
fi
87 changes: 70 additions & 17 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,78 @@
# name: Build ontology docs
name: SHACL Documentation Generation

# on:
# workflow_call:
on:
push:
paths:
- 'src/imaging-ontology/**'
pull_request:
paths:
- 'src/imaging-ontology/**'

# jobs:
jobs:
generate-docs:
runs-on: ubuntu-latest

# build:
# runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

# steps:
- name: Set up Python and install dependencies
run: |
python -m pip install --upgrade pip
pip install rdflib

# - uses: actions/checkout@v4
- name: Enrich ontology with rdflib
id: enrich
run: |
python tools/python/docs/sparql.py
echo "enriched_file=/tmp/enriched.ttl" >> $GITHUB_ENV


# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.12'
- name: Set up Java 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'

# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install
- name: Install Graphviz
run: |
sudo apt-get update
sudo apt-get install -y graphviz

# TODO: BUILD DOCUMENTATION USING RESPECTER
- name: Set DOT_PATH environment variable
run: echo "GRAPHVIZ_DOT=/usr/bin/dot" >> $GITHUB_ENV

- name: Download SHACL Play CLI
run: |
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

- name: Generate Documentation
run: |
java -jar shacl-play-cli.jar \
doc \
-d \
-i ${{ env.enriched_file }} \
-l en \
-o docs/index.html

- name: Generate Ontology Diagram
run: |
java -jar shacl-play-cli.jar \
draw \
-i ${{ env.enriched_file }} \
-o docs/ontology.svg

- name: Commit generated docs
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add docs/index.html
git add docs/ontology.svg
git commit -m "Update generated docs" || echo "Nothing to commit"
git push

- name: Upload generated documentation as an artifact
uses: actions/upload-artifact@v4
with:
name: shacl-documentation
path: docs/index.html
6 changes: 0 additions & 6 deletions .github/workflows/main-and-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches:
- main

workflow_call:

pull_request:
branches:
- main
Expand All @@ -17,6 +14,3 @@ jobs:

build:
uses: ./.github/workflows/build.yml
with:
is_release: false

35 changes: 7 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Include ontology assets in the release
name: Release workflow

on:
push:
Expand All @@ -8,30 +8,9 @@ on:
jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tools/python/requirements.txt

- name: Build ontology assets
run: |
bash ./tools/bash/build/create-combined-turtle.sh src/imaging-ontology/
python ./tools/python/build/create-schemas.py --input build/ontology_combined.ttl --output build/locales/en/schema.json

- name: Upload schema bundle
uses: actions/upload-artifact@v4
with:
name: schema-bundle
path: build/*
uses: ./.github/workflows/build.yml
with:
is_release: true # optional, now unused

checks:
uses: ./.github/workflows/checks.yml
Expand All @@ -44,13 +23,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Get schema assets
uses: actions/download-artifact@v4.1.8
- name: Download built assets
uses: actions/download-artifact@v4
with:
name: schema-bundle
path: build/

- name: Create release
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
files: build/*
6 changes: 4 additions & 2 deletions build/locales/en/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"ExecutableNotebook_label": "Executable Notebook",
"FeatureEnum_label": "Feature Enumeration",
"HostTypeEnumeration_label": "Host Type Enumeration",
"ImageObject_label": "Image object",
"ImageObjectTagEnum_label": "Image Object Tag Enumeration",
"ImagingModalityEnum_label": "Imaging Modality Enumeration",
"IsPluginModuleOfEnum_label": "Plugin Module Enumeration",
Expand All @@ -32,7 +33,6 @@
"DatasetSpecification_label": "Dataset Specification",
"FundingInformation_label": "Funding Information",
"SoftwareImage_label": "Software Image",
"contentURL_label": "Content URL",
"distribution_label": "Distribution",
"AMD64_label": "AMD64",
"ARM64_label": "ARM64",
Expand Down Expand Up @@ -162,6 +162,7 @@
"author_label": "Author",
"codeRepository_label": "Code repository",
"conditionsOfAccess_label": "Conditions of access",
"contentUrl_label": "Content URL",
"defaultValue_label": "Default value",
"encodingFormat_label": "Encoding format",
"familyName_label": "Family name",
Expand Down Expand Up @@ -243,6 +244,7 @@
"ExecutableNotebook_placeholder": "An object representing an executable notebook such as Jupyter Notebook",
"FeatureEnum_placeholder": "Enumeration class for software features",
"HostTypeEnumeration_placeholder": "Enumeration class for host type",
"ImageObject_placeholder": "An image of the software, typically a screenshot, before/after or a logo.",
"ImageObjectTagEnum_placeholder": "Enumeration class for image object tag",
"ImagingModalityEnum_placeholder": "Enumeration class for imaging modality",
"IsPluginModuleOfEnum_placeholder": "Enumeration class for plugin module",
Expand All @@ -254,7 +256,6 @@
"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.",
"FundingInformation_placeholder": "A class to represent the funding information of a software project",
"SoftwareImage_placeholder": "An image that virtualizes the functionality of a given software. For example, a Docker container.",
"contentURL_placeholder": "Actual bytes of the media object, for example the image file or video file.",
"distribution_placeholder": "A downloadable form of this dataset, at a specific location, in a specific format.",
"hasInput_placeholder": "Property that links a model configuration to the input types expected by it.",
"hasOutput_placeholder": "Property that expresses what the outputs of a model are",
Expand All @@ -263,6 +264,7 @@
"author_placeholder": "The author of the software, this can be organizations or people that are maintainers and/or producers of the software.",
"codeRepository_placeholder": "Primary link to the repository where the un-compiled, human readable code and related code is located (GitLab, GitHub, CodePlex etc.).",
"conditionsOfAccess_placeholder": "Conditions that affect the availability of, or method(s) of access to, an item. e.g. log-in required ",
"contentUrl_placeholder": "Actual bytes of the media object, for example the image file or video file.",
"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.",
"encodingFormat_placeholder": "Expressed using a MIME format (http://www.iana.org/assignments/media-types/media-types.xhtml).",
"familyName_placeholder": "Family name. In the U.S., the last name of a Person.",
Expand Down
Loading
Loading