-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
80 additions
and
28,023 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
tutorial/ | ||
bins/ | ||
.DS_Store | ||
*.iml |
27,885 changes: 0 additions & 27,885 deletions
27,885
idorg-ontology/idorg-ontology-materialized.ttl
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: ontop-materializer | ||
labels: | ||
component: ontop | ||
tier: api | ||
app: idorg | ||
deployment: hq | ||
environment: staging | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: ontop | ||
image: identifiersorg/ontop:1.1.0 #ontop + postgresql jdbc driver + curl | ||
workingDir: "/tmp" | ||
command: ["/bin/sh", "-c"] | ||
args: | ||
- >- | ||
wget --no-check-certificate -q https://raw.githubusercontent.com/identifiers-org/ontop/refs/heads/main/update-triples-script.sh && | ||
bash update-triples-script.sh | ||
env: | ||
- name: ONTOP_DB_URL | ||
value: "jdbc:postgresql://hq-postgresql:5432/dbhqregistry" | ||
- name: ONTOP_DB_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: hq-registry-database-credentials | ||
key: username | ||
- name: ONTOP_DB_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: hq-registry-database-credentials | ||
key: password | ||
- name: ONTOP_GH_TOKEN | ||
valueFrom: | ||
secretKeyRef: | ||
name: github-credentials | ||
key: auth-token | ||
- name: ONTOP_LOG_LEVEL | ||
value: ERROR | ||
restartPolicy: Never | ||
backoffLimit: 4 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,20 +4,20 @@ wget --no-check-certificate -q https://raw.githubusercontent.com/identifiers-org | |
wget --no-check-certificate -q https://raw.githubusercontent.com/identifiers-org/ontop/refs/heads/main/idorg-ontology/idorg-ontology.ttl | ||
wget --no-check-certificate -q https://raw.githubusercontent.com/identifiers-org/ontop/refs/heads/main/idorg-ontology/idorg-ontology.obda | ||
ontop materialize --db-user "$ONTOP_DB_USER" --db-password "$ONTOP_DB_PASSWORD" --db-url "$ONTOP_DB_URL" -m ./idorg-ontology.obda -t ./idorg-ontology.ttl -o ./new-idorg-ontology-materialized.rdf -p /dev/null | ||
# if diff -q new-idorg-ontology-materialized.rdf idorg-ontology-materialized.rdf > /dev/null; then | ||
echo Updating materialized file | ||
if diff -q new-idorg-ontology-materialized.rdf idorg-ontology-materialized.rdf > /dev/null; then | ||
echo Updating materialized file | ||
|
||
echo -n "{\"message\":\"Sync materialized registry tuples with database\", \"committer\":{\"name\":\"Ontop bot\", \"email\":\"[email protected]\"}, \"content\":\"" > datafile | ||
cat new-idorg-ontology-materialized.rdf|base64 >> datafile | ||
old_sha=$(wget --no-check-certificate -O - -q https://api.github.com/repos/identifiers-org/ontop/contents/idorg-ontology/idorg-ontology-materialized.rdf | grep sha | cut -d\" -f4) | ||
echo "\", \"sha\": \"$old_sha\"}" >> datafile | ||
echo -n "{\"message\":\"Sync triples with database [skip ci]\", \"committer\":{\"name\":\"Sync bot\", \"email\":\"[email protected]\"}, \"content\":\"" > datafile | ||
cat new-idorg-ontology-materialized.rdf|base64 >> datafile | ||
old_sha=$(wget --no-check-certificate -O - -q https://api.github.com/repos/identifiers-org/ontop/contents/idorg-ontology/idorg-ontology-materialized.rdf | grep sha | cut -d\" -f4) | ||
echo "\", \"sha\": \"$old_sha\"}" >> datafile | ||
|
||
curl -X PUT --insecure \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $ONTOP_GH_TOKEN" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
--data @./datafile \ | ||
https://api.github.com/repos/identifiers-org/ontop/contents/idorg-ontology/idorg-ontology-materialized.rdf | ||
# else | ||
# echo No need to update materialized file | ||
# fi | ||
curl -X PUT --insecure \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $ONTOP_GH_TOKEN" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
--data @./datafile \ | ||
https://api.github.com/repos/identifiers-org/ontop/contents/idorg-ontology/idorg-ontology-materialized.rdf | ||
else | ||
echo No need to update materialized file | ||
fi |