Skip to content
name: Update Knowledge Graph and Search Graph
# Every day at 11:00
# on:
# schedule:
# - cron: "0 11 * * *"
on:
push:
branches: ["main"]
jobs:
update-kg-with-data-registry:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout data repository
uses: actions/checkout@v4
with:
path: ./data
sparse-checkout: data-registry
- name: Checkout code repository
uses: actions/checkout@v4
with:
path: ./code
repository: colonial-heritage/integration-layer
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install app
run: |
cd ./code
npm install --no-progress
npx turbo run build --filter=@colonial-collections/data-registry
- name: Create graphs
run: |
cd ./data
../code/apps/data-registry/dist/cli.js upload \
--glob-pattern "data-registry/**/*.ttl" \
--graph-base-iri "https://data.colonialcollections.nl" \
--triplydb-instance-url "${{ vars.TRIPLYDB_INSTANCE_URL }}" \
--triplydb-api-token "${{ secrets.TRIPLYDB_API_TOKEN }}" \
--triplydb-account "${{ vars.TRIPLYDB_ACCOUNT }}" \
--triplydb-dataset "${{ vars.TRIPLYDB_DATASET_KG }}" \
--triplydb-service-name "kg" \
--triplydb-service-type "virtuoso"
update-sg-with-persons:
needs: [update-kg-with-data-registry]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout data repository
uses: actions/checkout@v4
with:
path: ./data
sparse-checkout: persons
- name: Checkout code repository
uses: actions/checkout@v4
with:
path: ./code
repository: colonial-heritage/integration-layer
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install app
run: |
cd ./code
npm install --no-progress
npx turbo run build --filter=@colonial-collections/graph-create
- name: Create graph
run: |
cd ./data
mkdir -p "$RUNNER_TEMP/persons"
test -f ./persons/data/data.tar.zst && tar --zstd -xf ./persons/data/data.tar.zst -C "$RUNNER_TEMP/persons"
../code/apps/graph-create/dist/cli.js create \
--resource-dir ./persons/resources \
--data-file "$RUNNER_TEMP/persons/data.sqlite" \
--iterate-endpoint-url "${{ vars.SPARQL_ENDPOINT_URL_KG }}" \
--iterate-query-file ./persons/queries/iterate.rq \
--generate-endpoint-url "${{ vars.SPARQL_ENDPOINT_URL_KG }}" \
--generate-query-file ./persons/queries/generate.rq \
--triplydb-instance-url "${{ vars.TRIPLYDB_INSTANCE_URL }}" \
--triplydb-api-token "${{ secrets.TRIPLYDB_API_TOKEN }}" \
--triplydb-account "${{ vars.TRIPLYDB_ACCOUNT }}" \
--triplydb-dataset "${{ vars.TRIPLYDB_DATASET_SG }}" \
--triplydb-service-name "search" \
--triplydb-service-type "elasticsearch" \
--graph-name "https://data.colonialcollections.nl/persons" \
--temp-dir "$RUNNER_TEMP"
- name: Save changes
run: |
cd ./data
mkdir -p ./persons/data
test -f "$RUNNER_TEMP/persons/data.sqlite" && tar --zstd -cf ./persons/data/data.tar.zst -C "$RUNNER_TEMP" data.sqlite
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit --quiet -a -m "Save changes" || true
git push --force -u origin