-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
45 lines (37 loc) · 1.28 KB
/
README
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
guile-sparql
============
This package provides a `sparql-query` function to query an RDF store.
Additionally, it provides an interface to write SPARQL queries using
S-expressions.
## Example usage
Using default settings (triple store at http:https://localhost:8890 and CSV output
format):
```
(use-modules (sparql driver)
(sparql lang))
(sparql-query
(let ((rdf (prefix "http:https://www.w3.org/1999/02/22-rdf-syntax-ns#"))
(rdfs (prefix "http:https://www.w3.org/2000/01/rdf-schema#"))
(internal (prefix "http:https://localhost/")))
(select '(subject predicate object)
`((subject predicate object)
(subject ,(rdf "type") ,(internal "Sample")))
'((group by object)))))
```
Using non-default settings:
```
(use-modules (sparql driver)
(sparql lang))
(sparql-query
(let ((rdf (prefix "http:https://www.w3.org/1999/02/22-rdf-syntax-ns#"))
(rdfs (prefix "http:https://www.w3.org/2000/01/rdf-schema#"))
(internal (prefix "http:https://localhost/")))
(select '(subject predicate object)
`((subject predicate object)
(subject ,(rdf "type") ,(internal "Sample")))
'((group by object))))
#:host "1.2.3.4"
#:port 8080
#:type "text/xml"
#:token "...")
```