forked from dydra/http-api-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-spin.sh
More file actions
70 lines (56 loc) · 2.38 KB
/
setup-spin.sh
File metadata and controls
70 lines (56 loc) · 2.38 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#! /bin/bash
# test library item references
# make sure the repositories exist
curl -v -f -s -S -X POST \
-H "Content-Type: application/json" --data-binary @- \
${STORE_URL}/${STORE_ACCOUNT}/repositories?auth_token=${STORE_TOKEN} << EOF
{"repository" : {"name" : "spin-data" } }
EOF
curl -v -f -s -S -X POST \
-H "Content-Type: application/json" --data-binary @- \
${STORE_URL}/${STORE_ACCOUNT}/repositories?auth_token=${STORE_TOKEN} << EOF
{"repository" : {"name" : "spin-library" } }
EOF
# set the library search path for the data repository
curl -f -s -S -X POST \
-H "Content-Type: application/json" --data-binary @- \
${STORE_URL}/${STORE_ACCOUNT}/repositories/spin-data?auth_token=${STORE_TOKEN} << EOF
{"library-path": "<urn:dydra:all> <http://example.org/spin1> <http://example.org/spin2>"}
EOF
# load the data repository
# see http://topbraid.org/examples/
$CURL -w "%{http_code}\n" -f -s -S -X PUT \
-H "Content-Type: application/rdf+xml" \
--data-binary @kennedys.rdf \
${STORE_URL}/${STORE_ACCOUNT}/spin-data?auth_token=${STORE_TOKEN} \
| egrep -q "$STATUS_PUT_SUCCESS"
# load the library repository
$CURL -w "%{http_code}\n" -f -s -S -X PUT \
-H "Content-Type: text/turtle" \
--data-binary @- \
${STORE_URL}/${STORE_ACCOUNT}/spin-data?auth_token=${STORE_TOKEN} <<EOF \
| egrep -q "$STATUS_PUT_SUCCESS"
<http://topbraid.org/schema.ui#ChildrenOverview>
a spin:SelectTemplate ;
rdfs:comment "Adapted from A (demo) SELECT template displaying some information about the children of a given schema:Person."^^xsd:string ;
rdfs:label "Children overview"^^xsd:string ;
rdfs:subClassOf spin:SelectTemplates ;
spin:constraint
[ a spl:Argument ;
rdfs:comment "The schema:Person to get the children of."^^xsd:string ;
spl:predicate arg:parent ;
spl:valueType schema:Person
] ;
spin:body
[ a sp:Select ;
sp:text """
SELECT ?childName ?birthDate
WHERE {
?child schema:parent ?parent .
?child rdfs:label ?childName .
OPTIONAL {
?child schema:birthDate ?birthDate .
} .
}
"""
] ;EOF