Coverage report: /development/source/library/com/dydra/gitlab/dydra-cgi/ffi/lisp/rdfcache/sparql-update.lisp

KindCoveredAll%
expression2476 31.6
branch410 40.0
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 (in-package :rdfcache)
2
 
3
 ;; SPARQL Update API
4
 
5
 (defun *-to-uri-string (term)
6
   (declare (type (or foreign-pointer string fixnum null) term))
7
   (cond ((integerp term)
8
          (cond ((eq term *wildcard-term-number*)
9
                 (null-pointer))
10
                ((eq term *default-context-number*)
11
                 (%default-context-pointer))
12
                (t
13
                 (with-term (term-struct :none *wildcard-term-pointer*)
14
                   (fetch-term term term-struct)
15
                   (term-value term-struct)))))
16
         ((stringp term) term)
17
         ((pointerp term) term)
18
         (t (null-pointer))))
19
 
20
 ;;; @see http://www.w3.org/TR/sparql11-update/#add
21
 (defun sparql-add (transaction-pointer graph1-uri graph2-uri &optional silent)
22
   (declare (type foreign-pointer transaction-pointer)
23
            (type (or foreign-pointer string fixnum null) graph1-uri graph2-uri)
24
            (type boolean silent))
25
   (%%sparql-add transaction-pointer
26
                 (*-to-uri-string graph1-uri)
27
                 (*-to-uri-string graph2-uri)
28
                 silent))
29
 
30
 ;;; @see http://www.w3.org/TR/sparql11-update/#clear
31
 (defun sparql-clear (transaction-pointer graph-uri &optional silent)
32
   (declare (type foreign-pointer transaction-pointer)
33
            (type (or foreign-pointer string fixnum null) graph-uri)
34
            (type boolean silent))
35
   (%%sparql-clear transaction-pointer
36
                   (*-to-uri-string graph-uri)
37
                   silent))
38
 
39
 ;;; @see http://www.w3.org/TR/sparql11-update/#copy
40
 (defun sparql-copy (transaction-pointer graph1-uri graph2-uri &optional silent)
41
   (declare (type foreign-pointer transaction-pointer)
42
            (type (or foreign-pointer string fixnum null) graph1-uri graph2-uri)
43
            (type boolean silent))
44
   (%%sparql-copy transaction-pointer
45
                  (*-to-uri-string graph1-uri)
46
                  (*-to-uri-string graph2-uri)
47
                  silent))
48
 
49
 ;;; @see http://www.w3.org/TR/sparql11-update/#create
50
 (defun sparql-create (transaction-pointer graph-uri &optional silent)
51
   (declare (type foreign-pointer transaction-pointer)
52
            (type (or foreign-pointer string fixnum null) graph-uri)
53
            (type boolean silent))
54
   (%%sparql-create transaction-pointer
55
                    (*-to-uri-string graph-uri)
56
                    silent))
57
 
58
 ;;; @see http://www.w3.org/TR/sparql11-update/#drop
59
 (defun sparql-drop (transaction-pointer graph-uri &optional silent)
60
   (declare (type foreign-pointer transaction-pointer)
61
            (type (or foreign-pointer string fixnum null) graph-uri)
62
            (type boolean silent))
63
   (%%sparql-drop transaction-pointer
64
                  (*-to-uri-string graph-uri)
65
                  silent))
66
 
67
 ;;; @see http://www.w3.org/TR/sparql11-update/#load
68
 (defun sparql-load (transaction-pointer graph-uri from-url &optional silent)
69
   (declare (type foreign-pointer transaction-pointer)
70
            (type (or foreign-pointer string fixnum null) graph-uri from-url)
71
            (type boolean silent))
72
   (%%sparql-load transaction-pointer
73
                  (*-to-uri-string graph-uri)
74
                  (*-to-uri-string from-url)
75
                  silent))
76
 
77
 ;;; @see http://www.w3.org/TR/sparql11-update/#move
78
 (defun sparql-move (transaction-pointer graph1-uri graph2-uri &optional silent)
79
   (declare (type foreign-pointer transaction-pointer)
80
            (type (or foreign-pointer string fixnum null) graph1-uri graph2-uri)
81
            (type boolean silent))
82
   (%%sparql-move transaction-pointer
83
                  (*-to-uri-string graph1-uri)
84
                  (*-to-uri-string graph2-uri)
85
                  silent))