Coverage report: /development/source/library/org/datagraph/spocq-shard/src/core/libraries/rdfcache.lisp

KindCoveredAll%
expression11100.0
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; -*- Mode: lisp; Syntax: ansi-common-lisp; Base: 10; Package: cl-user; -*-
2
 
3
 (in-package :org.datagraph.spocq.implementation)
4
 
5
 ;; based on
6
 ;;  lgrep rdfcache: | sed -e 's/.*\(rdfcache:\+\)\([\x2a%a-zA-Z0-9-]\+\).*/:\2/I' | sort | uniq
7
 
8
 (modpackage :rdfcache
9
   (:use ;; in case this is the only definition
10
         :cffi
11
         :common-lisp)
12
   (:export :*all-context-number*
13
            :*default-context-number*
14
            :*named-context-number*
15
            :*wildcard-term-number*
16
            :%%cursor-fetch-term
17
            :%%matrix-get
18
            :%%matrix-set
19
            :%%memcpy
20
            :%%REPOSITORY-REVISION
21
            :%%utf8-get-char
22
            :%%utf8-get-length
23
            :%%utf8-next-char
24
            :%%utf8-to-utf32
25
            :%%uuid-generate
26
            :%clear-cursor
27
            :%clear-socket
28
            :%clear-term
29
            :%destroy-transaction
30
            :%make-transaction
31
            :%uuid
32
            :abort-transaction
33
            :all
34
            :attach
35
            :begin-transaction
36
            :boost
37
            :clone-transaction
38
            :close
39
            :CLOSE
40
            :commit-transaction
41
            :connect
42
            :count
43
            :count-matched-quads
44
            :curor-term-number
45
            :cursor
46
            :cursor-append-matrix
47
            :cursor-context-number
48
            :cursor-context-pointer
49
            :cursor-object-number
50
            :cursor-object-pointer
51
            :cursor-predicate-number
52
            :cursor-predicate-pointer
53
            :cursor-subject-number
54
            :cursor-subject-pointer
55
            :cursor-to-matrix
56
            :data
57
            :datatype
58
            :declare-terms
59
            :default
60
            :delete-statement
61
            :destroy-ephemeral-terms
62
            :disconnect
63
            :ephemeral-term-number-p
64
            :equal-term
65
            :exit-thread
66
            :fetch-term
67
            :fetch-term*
68
            :fetch-term-type
69
            :foreign-pointer
70
            :index-match
71
            :init
72
            :initialize-term
73
            :init-thread
74
            :insert-statement
75
            :intern-term
76
            :is-blank
77
            :is-literal
78
            :is-string
79
            :is-uri
80
            :language
81
            :list-to-matrix
82
            :load-library
83
            :lookup-term
84
            :lookup-term-number
85
            :make-ephemeral-term-cache
86
            :make-matrix
87
            :make-quad-cursor
88
            :map-context-numbers
89
            :map-object-numbers
90
            :map-predicate-numbers
91
            :map-subject-numbers
92
            :match
93
            :match-with-filter
94
            :matrix-append-rows
95
            :matrix-column-count
96
            :matrix-concatenate
97
            :matrix-data-pointer
98
            :matrix-element-count
99
            :matrix-fill
100
            :matrix-free
101
            :matrix-get
102
            :matrix-release
103
            :matrix-resize
104
            :matrix-row-count
105
            :matrix-row-index
106
            :matrix-row-size
107
            :matrix-row-to-list
108
            :matrix-set
109
            :matrix-size
110
            :matrix-sort-by
111
            :matrix-to-list
112
            :named
113
            :next
114
            :persistent-term-number-p
115
            :pointerp
116
            :print-cursor
117
            :print-matrix
118
            :print-transaction
119
            :query
120
            :rdfcache
121
            :rdfcache-error
122
            :resolve-repository
123
            :same-term
124
            :skip
125
            :socket
126
            :sparql-add
127
            :sparql-clear
128
            :sparql-copy
129
            :sparql-create
130
            :sparql-load
131
            :sparql-move
132
            :term
133
            :term-cursor-close
134
            :term-cursor-init
135
            :term-cursor-next
136
            :term-cursor-open
137
            :term-record-value
138
            :term-type
139
            :time-in-thread
140
            :transaction-delete-count
141
            :transaction-insert-count
142
            :transaction-parent-revision-p
143
            :transaction-parent-revision-uuid-string
144
            :transaction-status
145
            :transaction-uuid-pointer
146
            :transaction-uuid-string
147
            :type
148
            :uuid-to-string
149
            :value
150
            :with-checked-errno-result
151
            :with-checked-pointer
152
            :with-cursor
153
            :with-transaction
154
            :with-uuid
155
            ))
156
 
157
 (in-package :rdfcache)
158
 
159
 ;; library
160
 
161
 (defvar *encoding* :utf-8
162
   "Triple term encoding.")
163
 
164
 (defvar *wildcard-term-pointer* (null-pointer)
165
   "A wildcard term.")
166
 
167
 (defvar *wildcard-term-number* 0
168
   "The term number designating a wildcard term.")
169
 
170
 ;; prelude
171
 (defcenum (term-type :int)
172
   (:none 0) (:uri 1) (:node 2) (:literal 5) (:default-context 255))
173
 
174
 (defcstruct term
175
   (type term-type)
176
   (value :pointer)
177
   (language :pointer)
178
   (datatype :pointer))
179
 
180
 
181
 #-store-is-rdfcache
182
 (macrolet ((defstub (name args)
183
              (let ((ignore (set-difference args lambda-list-keywords))) 
184
                `(defun ,name ,args (declare (ignore ,@ignore))))))
185
   ; rdfcache store operators
186
   (defstub delete-statement (transaction context subject predicate object))
187
   (defstub insert-statement (transaction context subject predicate object))
188
   (defstub print-transaction (matrix))
189
   (defstub resolve-repository (repository &key revision))
190
   (defstub transaction-status (transaction))
191
 
192
   ;; rdfcaceh data model and process operators
193
   (defparameter *all-context-number* 0)
194
   (defparameter *default-context-number* 0)
195
   (defparameter *named-context-number* 0)
196
   (defstub %%UTF8-GET-LENGTH (data))
197
   (defstub %%UTF8-TO-UTF32 (data))
198
   (defstub %%UUID-GENERATE ())
199
   (defstub %CLEAR-TERM (%term))
200
   (defstub %UUID (%term))
201
   (defstub boost (value))
202
   (defstub ephemeral-term-number-p (number))
203
   (defstub exit-thread ())
204
   (defstub fetch-term (term-number %term))
205
   (defstub fetch-term-type (number))
206
   (defstub fetch-term* (transaction term-number %term))
207
   (defstub init-thread ())
208
   (defstub initialize-term (%term &key uri language datatype))
209
   (defstub intern-term (transaction type value language datatype))
210
   (defstub is-blank (value))
211
   (defstub lookup-term-number (%term))
212
   (defstub lookup-term (transaction type value language datatype))
213
   (defstub make-matrix (row-count column-count))
214
   (defstub matrix-column-count (matrix))
215
   (defstub matrix-concatenate (m1 m2))
216
   (defstub matrix-data-pointer (m))
217
   (defstub matrix-fill (m))
218
   (defstub matrix-to-list (matrix))
219
   (defstub matrix-resize (matrix))
220
   (defstub matrix-release (matrix))
221
   (defstub matrix-row-count (matrix))
222
   (defstub matrix-set (matrix))
223
   (defstub matrix-sort-by (matrix))
224
   (defstub persistent-term-number-p (number))
225
   (defstub term-type (%term))
226
   (defstub (setf term-type) (type term)) 
227
   (defstub time-in-thread ())
228
   (defstub UUID-TO-STRING (uuid))
229
   ;; (defmacro with-checked-errno-result (name &body body) `(progn ,name ,@body))
230
   (defmacro with-checked-pointer ((%term) &body body) `(progn ,%term ,@body))
231
   (defmacro with-uuid ((var) &body body) `(let ((,var nil)) ,@body))
232
 
233
   )
234
 
235
 (in-package :spocq.i)
236
 #-store-is-rdfcache
237
 (macrolet ((defstub (name args)
238
              (let ((ignore (set-difference args lambda-list-keywords))) 
239
                `(defun ,name ,args (declare (ignore ,@ignore))))))
240
   ;; spocq persistent store operators : they are those which involve transactions and/or revisions
241
   (defstub call-with-revision-transaction (function revision transaction))
242
   (defstub process-provenance-information (task))  ;; extracts transaction graph data
243
   (defstub repository-add-graph (transaction from to &key if-exists))
244
   (defstub repository-copy-graph (transaction from to &key if-does-not-exist))
245
   (defstub repository-clear-graph (transaction graph &key if-does-not-exist))
246
   (defstub repository-create-graph (transaction graph))
247
   (defstub repository-delete-graph (transaction graph &key if-does-not-exist))
248
   (defstub repository-list-revision-ids (repository))
249
   (defstub repository-make-transaction (revision &key operation api-key read-only-p task))
250
   (defstub repository-load-graph (transaction from graph))
251
   (defstub repository-move-graph (transaction from to &key if-does-not-exist))
252
   (defstub revision-parent-uri (transaction))
253
   (defstub compute-timemap (repository &key timemap-properties)) ;; requires transaction history
254
   (defstub expand-query (query &key repository-id)) ;; macroexpansions rely on statement statistics
255
   (defstub repository-call-with-matched-terms (function transaction s p o &key context))
256
   (defstub rdfcache-count (transaction g s p o ))
257
 
258
   ;; spocq ephemeral store operators
259
   ;; (defstub rdfcache-call-with-numbered-term (function transaction number))
260
   ;; (defstub rdfcache-call-with-numbered-term-aspects (function transaction number))
261
   ;; (defstub call-with-term-number-type (function number))
262
   ;; (defstub call-with-term-string (function literal))
263
   ;; (defstub compute-repository-service-description-solutions (repository))
264
   ;; (defstub intern-quad-or-triple-data (repository data))
265
   ;; (defstub rdfcache-extern-field (field))
266
   ;; (defstub rdfcache-fetch-term (transaction number %term))
267
   ;; (defstub rdfcache-find-object-term-number (object))
268
   ;; (defstub rdfcache-graph-term-number (object))
269
   ;; (defstub rdfcache-intern-field (field))
270
   ;; (defstub rdfcache-intern-shuffeled-field (field result-dimensions source-dimensions))
271
   ;; (defstub rdfcache-lookup-object-term-number (object))
272
   ;; (defstub rdfcache-object-term-number (object))
273
   ;; (defstub rdfcache-term-number-object (object))
274
   ;; (defstub rdfcache-term-number-object-p (object))
275
   ;; (defstub repository-intern-statements (transaction statements))
276
   ;; (defstub repository-service-description (repository))
277
   ;; (defstub rewrite-pattern (pattern operators))
278
   ;; (defstub service-description-solutions (service-description))
279
   ;; (defstub set-optional-term (%term node))
280
 
281
   ;; spocq data model operators
282
   ;; (defstub check-query-status (query))
283
   ;; (defstub clear-optional-term (%term))
284
   ;; (defstub compute-initial-resource-authorization-graph (resource))
285
   ;; (defstub setcache (key cache function-name))
286
   ;; (defstub write-timemap-headers (task stream))
287
   ;; (defstub zero-duration ())
288
 )
289
 
290
 
291