From 0c9bcc9427d7445999da2ed9a75862165b5e07dd Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Thu, 7 Sep 2023 11:19:22 +0200 Subject: [PATCH] Add Strapi import workflow for rpb-notations, rpb-spatials (RPB-66) --- README.md | 11 +++++++++++ conf/rpb-systematik-import.flux | 13 +++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 conf/rpb-systematik-import.flux diff --git a/README.md b/README.md index d7192c20..bcc6f2ff 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,17 @@ Entries using the same path can be filtered, e.g. to get only volumes (`f36_=sbd http://test-metadaten-nrw.hbz-nrw.de:1339/api/independent-works?filters[f36_][$eq]=sbd&populate=* +### Import SKOS data into strapi + +Actual transformation of SKOS TTL files to JSON happens in https://github.com/acka47/scripts/tree/master/skos2json. + +To import the resulting JSON data into strapi, run: + +```bash +sbt "runMain rpb.ETL conf/rpb-systematik-import.flux INPUT=rpb.ndjson PATH=rpb-notations" +sbt "runMain rpb.ETL conf/rpb-systematik-import.flux INPUT=rpb-spatial.ndjson PATH=rpb-spatials" +``` + ### Run transformation to lobid data ```bash diff --git a/conf/rpb-systematik-import.flux b/conf/rpb-systematik-import.flux new file mode 100644 index 00000000..26f12084 --- /dev/null +++ b/conf/rpb-systematik-import.flux @@ -0,0 +1,13 @@ +API_URL = "http://test-metadaten-nrw.hbz-nrw.de:1339/api/" + PATH; + +"https://raw.githubusercontent.com/acka47/scripts/master/skos2json/" + INPUT +| open-http +| as-lines +| regex-decode("(?.+)") +| stream-to-triples +| template("{\"${p}\":${o}}") // wrap into 'data' object for strapi +| log-object("Will POST: ") +| open-http(url=API_URL, method="POST", contentType="application/json") +| as-lines +| log-object("POST Response: ") +;