Skip to content

Export Scenepro entities to Artsdata #9

Export Scenepro entities to Artsdata

Export Scenepro entities to Artsdata #9

name: Export Scenepro entities to Artsdata
on:
workflow_dispatch:
jobs:
transform-scenepro-entities:
runs-on: ubuntu-latest
container:
image: ontotext/refine:1.2.0
options: --user root
ports:
- 7333:7333
steps:
- name: Install requirements
id: step-1
run: apk update && apk add curl && apk add util-linux && apk add coreutils
- name: Run Onto Refine server
id: step-2
run: /opt/ontorefine/dist/bin/ontorefine &
- name: Download scenepro entities
id: step-3
run: |
curl 'https://public-api.scenepro.ca/capacoa/organizations/diffuser/0/200?networkId=2' \
-H "Ocp-Apim-Subscription-Key: 44c4455927594abfb8127ec918b93c73;product=capacoa" >> entities.json
- name: Download mapping file
id: step-4
run: |
curl 'https://raw.githubusercontent.com/culturecreates/artsdata-planet-scenepro/main/ontorefine/config.json' >> config.json
- name: Transform entities in JSON to RDF
id: step-5
run: |
/opt/ontorefine/dist/bin/ontorefine-cli \
transform entities.json \
-u http://localhost:7333 \
--configurations config.json \
-f json >> scenepro-entities.ttl
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: scenepro-entities
path: ./scenepro-entities.ttl
retention-days: 1
commit-file-to-github:
needs: transform-scenepro-entities
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: scenepro-entities
path: ./scenepro-entities
- name: Copy file
run: cp /home/runner/work/artsdata-planet-scenepro/artsdata-planet-scenepro/scenepro-entities/scenepro-entities.ttl ./scenepro-entities/
- name: Commit file to GitHub
run: |
git pull
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add scenepro-entities.ttl
git commit -m "Push ScenePro entities TTL file"
git push