-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathimport-rdf.sh
More file actions
executable file
·41 lines (35 loc) · 1.01 KB
/
import-rdf.sh
File metadata and controls
executable file
·41 lines (35 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then
echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2
echo "Example: $0" 'https://localhost:4443/ ../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2
echo "Note: special characters such as $ need to be escaped in passwords!" >&2
exit 1
fi
base="$1"
cert_pem_file=$(realpath "$2")
cert_password="$3"
if [ -n "$4" ]; then
proxy="$4"
else
proxy="$base"
fi
pwd=$(realpath "$PWD")
item=$(create-item.sh \
-b "$base" \
-f "$cert_pem_file" \
-p "$cert_password" \
--proxy "$proxy" \
--title "Unesco Thesaurus" \
--slug "unesco-thesaurus" \
--container "${base}concept-schemes/"
)
import-rdf.sh \
-b "$base" \
-f "$cert_pem_file" \
-p "$cert_password" \
--proxy "$proxy" \
--title "Unesco Thesaurus SKOS" \
--query-file "$pwd/concept-schemes/unesco-thesaurus/skos-import.rq" \
--rdf-file "$pwd/concept-schemes/unesco-thesaurus/unesco-thesaurus.ttl" \
--content-type "text/turtle" \
"$item"