Merge pull request #7 from AtomGraph/nest-containers-under-org #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SHACL validation | |
| on: | |
| push: | |
| paths: | |
| - 'datasets/current/**' | |
| - 'etl/shapes/**' | |
| - 'etl/lib/validate.sh' | |
| - 'etl/lib/shacl.sh' | |
| - '.github/workflows/shacl-validation.yml' | |
| pull_request: | |
| paths: | |
| - 'datasets/current/**' | |
| - 'etl/shapes/**' | |
| - 'etl/lib/validate.sh' | |
| - 'etl/lib/shacl.sh' | |
| - '.github/workflows/shacl-validation.yml' | |
| env: | |
| JENA_VERSION: 6.1.0 | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| - name: Cache Apache Jena | |
| id: jena-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/jena | |
| key: apache-jena-${{ env.JENA_VERSION }} | |
| - name: Download Apache Jena | |
| if: steps.jena-cache.outputs.cache-hit != 'true' | |
| run: | | |
| curl -fsSL "https://archive.apache.org/dist/jena/binaries/apache-jena-${JENA_VERSION}.tar.gz" -o /tmp/jena.tar.gz | |
| echo "$(curl -fsSL "https://archive.apache.org/dist/jena/binaries/apache-jena-${JENA_VERSION}.tar.gz.sha512" | awk '{print $1}') /tmp/jena.tar.gz" | sha512sum -c - | |
| mkdir -p ~/jena | |
| tar -xzf /tmp/jena.tar.gz -C ~/jena --strip-components=1 | |
| - name: Validate datasets | |
| run: | | |
| export JENA_HOME="$HOME/jena" | |
| rc=0 | |
| # settlements.trig/streets.trig are gitignored (bulk) — absent here, | |
| # validated during local `make` runs instead | |
| for f in datasets/current/*/*.trig; do | |
| domain=$(basename "$(dirname "$f")") | |
| echo "::group::$f" | |
| case "$(basename "$f")" in | |
| # overlay files (owl:sameAs/foaf:depiction onto other files' graphs): | |
| # graph invariants intentionally absent, so skip validate.sh | |
| alignments.trig|photos.trig) | |
| etl/lib/shacl.sh "etl/shapes/$domain.ttl" "$f" \ | |
| || { rc=1; echo "::error file=$f::SHACL validation failed"; echo "- FAIL: $f" >> "$GITHUB_STEP_SUMMARY"; } ;; | |
| *) | |
| etl/lib/validate.sh "$f" \ | |
| || { rc=1; echo "::error file=$f::validation failed"; echo "- FAIL: $f" >> "$GITHUB_STEP_SUMMARY"; } ;; | |
| esac | |
| echo "::endgroup::" | |
| done | |
| exit $rc |