-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathremote-client.cl
More file actions
55 lines (38 loc) · 1.5 KB
/
remote-client.cl
File metadata and controls
55 lines (38 loc) · 1.5 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
(require :agraph)
(in-package :db.agraph.user)
(close-all-triple-stores)
;;;------------------------------------------------
;; Create triple-store on remote AGraph server.
;;;------------------------------------------------
(defparameter ground-ts
(create-triple-store "test-remote"
:triple-store-class 'remote-triple-store
:server "localhost" :port 10035
:user "test" :password "xyzzy"))
;; As with a local triple-store, the *db* var is set:
*db*
(close-triple-store)
(defparameter ground-ts
(open-triple-store "test-remote"
:triple-store-class 'remote-triple-store
:server "localhost" :port 10035
:user "test" :password "xyzzy"))
;; Most other functions work the same as with a local triple-store.
;; For example:
(register-namespace
"ex" "http://www.franz.com/things#"
:errorp nil)
(display-namespaces)
;; examples copied from reasoner-tutorial.cl
(add-triple !ex:jans !ex:owns !ex:birra)
(add-triple !ex:jans !owl:sameAs !ex:jannes)
;; no reasoning, ask about ex:owns and get one triple
(get-triples-list :p !ex:owns)
(defparameter inferred-ts (apply-rdfs++-reasoner :remote-reasoning t
:db ground-ts))
;; we'll get two triples now
(get-triples-list :p !ex:owns)
;; using the :db argument
(get-triples-list :p !ex:owns :db ground-ts)
(get-triples-list :p !ex:owns :db (ground-triple-store inferred-ts))
(close-all-triple-stores)