Skip to content

Commit dbd80bd

Browse files
committed
Add by-iri/uuid tests
Signed-off-by: Greg Haskins <greg@manetu.com>
1 parent a0946f5 commit dbd80bd

File tree

6 files changed

+2104
-0
lines changed

6 files changed

+2104
-0
lines changed

examples/by-iri/bindings.csv

Lines changed: 1001 additions & 0 deletions
Large diffs are not rendered by default.

examples/by-iri/generate-bindings.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
invoke_graphql() {
4+
yq -r -o=json - | curl --data-binary @- --silent --show-error --fail $MANETU_EXTRA_CURL_ARGS --header 'Content-Type: application/json' -u ":$MANETU_TOKEN" $MANETU_URL/graphql
5+
}
6+
7+
format_output () {
8+
cat - | jq ".data.sparql_query"
9+
}
10+
11+
invoke_sparql_query() {
12+
local expr=$(cat - | url-encode)
13+
14+
cat <<EOF | invoke_graphql | format_output
15+
query: |
16+
{
17+
sparql_query(
18+
sparql_expr: "$expr",
19+
encoding: URL
20+
) {
21+
name
22+
value
23+
}
24+
}
25+
EOF
26+
}
27+
28+
echo "iri"
29+
30+
cat <<EOF | invoke_sparql_query | jq ".[].[0].value" | sed 's/\"//g'
31+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
32+
PREFIX manetu: <http://manetu.com/manetu/>
33+
PREFIX mmeta: <http://manetu.io/rdf/metadata/0.1/>
34+
35+
SELECT ?iri
36+
37+
WHERE {
38+
?iri rdf:predicate manetu:email .
39+
}
40+
LIMIT 1000
41+
EOF

examples/by-iri/query.sparql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3+
PREFIX manetu: <http://manetu.com/manetu/>
4+
PREFIX mmeta: <http://manetu.io/rdf/metadata/0.1/>
5+
6+
SELECT ?o0
7+
WHERE {
8+
?iri rdf:object ?o0 .
9+
}

0 commit comments

Comments
 (0)