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

KindCoveredAll%
expression052 0.0
branch08 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; -*-
2
 
3
 (in-package :org.datagraph.spocq.implementation)
4
 
5
 
6
 (defparameter *repository-content*
7
   '(#p"yoda:Development:Source:dev:Library:de:setf:resource:test:family.nt"))
8
 
9
 (defmethod (setf configuration-parameter) (list (parameter (eql :repository-content)))
10
   (setq *repository-content*
11
         (mapcar #'(lambda (location)
12
                     (etypecase location
13
                       (puri:uri location)
14
                       (string (puri:uri location))
15
                       (pathname location)))
16
                 list)))
17
 
18
 
19
 ;;;
20
 ;;; initial- and re-start
21
 
22
 
23
 (defun main-store ()
24
   (initialize-and-run-store))
25
 
26
 
27
 (defun initialize-and-run-store ()
28
   (cond ((not (load-system-configuration *configuration-pathname*))
29
          (log-error "Cannot load configuration: ~s." *configuration-pathname*))
30
         ((not (ignore-errors (ensure-directories-exist *log-pathname*)))
31
          (log-error "Cannot locate log file: ~s." *log-pathname*))
32
         (t
33
          (setq *repository* (make-instance 'de.setf.rdf:wilbur-mediator))
34
          (dolist (url *repository-content*)
35
            (de.setf.rdf:load-repository *repository* url))
36
          (amqp:with-open-connection (accounting-connection :uri *broker-uri*)
37
            (amqp:with-open-channel (*accounting-io* accounting-connection
38
                                                     :element-type '(unsigned-byte 8)
39
                                                     :content-type mime:application/octet-stream)
40
              (setf (amqp.u:channel-content-type *accounting-io*) mime:application/octet-stream)
41
              (unwind-protect (run-store)
42
                (delete-file *pidfile-pathname*)))))))
43
 
44
 
45
 
46
 (defun run-store (&rest args)
47
   (handler-case (apply #'run-store-processor args)
48
     (error (condition)
49
            (log-error "RUN Error: ~a." condition)
50
            (log-stacktrace "RUN Error: ~a." condition))))
51
 
52
 
53
 #|
54
 (amqp:with-open-connection (accounting-connection :uri *broker-uri*)
55
   (amqp:with-open-channel (*accounting-io* accounting-connection
56
                                            :element-type '(unsigned-byte 8)
57
                                            :content-type mime:application/octet-stream)
58
     (setf (amqp.u:channel-content-type *accounting-io*) mime:application/octet-stream)
59
     (run-store :store-routing-key "foaf")))
60
 
61
 ruby bin/spocq-query '(select (?s ?p ?o) (bgp (triple ?s ?p ?o)))'
62
 |#