Coverage report: /development/source/library/org/datagraph/spocq-shard/src/store/rdfcache/geolocation-index.lisp
| Kind | Covered | All | % |
| expression | 0 | 62 | 0.0 |
| branch | 0 | 4 | 0.0 |
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: org.datagraph.spocq.implementation; -*-
3
(in-package :org.datagraph.spocq.implementation)
4
;; (load "/development/source/library/org/datagraph/spocq/src/store/geolocation-index.lisp")
9
(defmethod compute-index-statements ((index (eql '|geo|:|lat|)) statements filters)
11
(compute-geocoordinate-index index statements filters))
14
(defmethod compute-index-statements ((index (eql '|geo|:|long|)) statements filters)
15
"The statements should comprise one each for each variable combination and
16
at least one filter clause per object variable. correlate these to construct
17
one bgp:index-match for each (subject object min max combination).
19
The only predicates should match the index name."
21
(compute-geocoordinate-index index statements filters))
24
(defun compute-geocoordinate-index (index statements filters)
25
(loop for statement in statements
27
collect (let ((predicate (statement-predicate statement))
28
(object (statement-object statement)))
29
(assert (equalp predicate index) ()
30
"invalid index pattern: variant predicate: ~s." statement)
32
(assert (equalp graph (statement-context statement)) ()
33
"Invalid index pattern; spans graphs: ~s." statements)
34
(setf graph (statement-context statement)))
35
(loop with statement-filters = ()
37
for filter-variables = (expression-variables filter)
38
when (find object filter-variables)
39
do (pushnew filter statement-filters)
40
finally (return (append statement
41
`(:test ,(reduce #'(lambda (e1 &optional e2)
42
(if e2 `(spocq.a:&& ,e1 ,e2) e1))
44
:key #'(lambda (expression)
45
(destructuring-bind (operator arg1 arg2) (second expression)
49
(spocq.a:< 'spocq.a:>)
50
(spocq.a:> 'spocq.a:<)
51
(spocq.a:<= 'spocq.a:>=)
52
(spocq.a:>= 'spocq.a:<=))