Skip to content

Commit

Permalink
Add Strapi import workflow for rpb-notations, rpb-spatials (RPB-66)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Sep 7, 2023
1 parent e71b261 commit 0c9bcc9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions conf/rpb-systematik-import.flux
Original file line number Diff line number Diff line change
@@ -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("(?<data>.+)")
| 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: ")
;

0 comments on commit 0c9bcc9

Please sign in to comment.