@@ -25,4 +25,62 @@ To stop GraphDB, run:
2525docker compose down
2626```
2727
28- Your data in ` ./data/ ` stays safe and portable.
28+ Your data in ` ./data/ ` stays safe and portable.
29+
30+ ## Test Queries
31+
32+ Query to test a tunnel to ` kg.uxmethods.org ` with basic authentication.
33+
34+ ### Method Centrality
35+
36+ ``` bash
37+ curl -u " username:password" \
38+ -X POST http://kg.uxmethods.org/repositories/uxm \
39+ -H " Content-Type: application/x-www-form-urlencoded" \
40+ -H " Accept: application/sparql-results+json" \
41+ --data-urlencode " query=
42+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
43+ PREFIX : <https://uxmethods.org/>
44+ PREFIX uxmo: <https://uxmethods.org/ontology/>
45+
46+ SELECT ?method ?label (COUNT(?transput) AS ?centrality)
47+ WHERE {
48+ ?methodA skos:prefLabel ?label.
49+ {?methodA uxmo:hasInput ?transput.}
50+ UNION
51+ {?methodA uxmo:hasOutput ?transput.}
52+ BIND(?methodA AS ?method)
53+ }
54+ GROUP BY ?method ?label
55+ ORDER BY DESC (?centrality)
56+ "
57+ ```
58+
59+ ### Shared Output
60+
61+ ``` bash
62+ curl -u " username:password" \
63+ -X POST http://kg.uxmethods.org/repositories/uxm \
64+ -H " Content-Type: application/x-www-form-urlencoded" \
65+ -H " Accept: application/sparql-results+json" \
66+ --data-urlencode " query=
67+ PREFIX : <https://uxmethods.org/>
68+ PREFIX uxmo: <https://uxmethods.org/ontology/>
69+
70+ SELECT ?origin ?destination (COUNT(?output) AS ?sharedOutputCount)
71+ (GROUP_CONCAT(DISTINCT ?output; SEPARATOR=',') AS ?sharedOutput)
72+ WHERE {
73+ ?origin uxmo:hasOutput ?output.
74+ ?destination uxmo:hasInput ?output.
75+ }
76+ GROUP BY ?origin ?destination
77+ ORDER BY DESC(?sharedOutputCount)
78+ "
79+ ```
80+
81+ Replace ` username ` and ` password ` with your actual credentials.
82+
83+ ### Notes
84+
85+ - ` -u ` The most basic curl authentication option is -u / --user. It accepts an argument that is the username and password, colon separated.
86+ - ` -X ` Tell curl to change the method into something else by using the -X or --request command-line options followed by the actual method name.
0 commit comments