Coverage report: /development/source/library/org/datagraph/spocq-shard/src/spocq-server/resources.lisp
| Kind | Covered | All | % |
| expression | 0 | 14 | 0.0 |
| branch | 0 | 0 | nil |
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.server.implementation; -*-
2
;;; Copyright 2013 [james anderson](mailto:james.anderson@setf.de) All Rights Reserved
4
(in-package :org.datagraph.spocq.server.implementation)
6
(:documentation "concrete request resources"
8
"There are three distinct realms:
9
admin : accounts/:account/repositories/:repository/...
10
graph store : :account/:repository/...
11
with paths for service, sparql, ldp and ldf
12
sesame : :account/repositories/:repository/...
14
the paths and respons efunctions remain, but they are reflected here only and
15
not in the nginx locations.
21
/protocol : protocol version (GET)
22
/:repository : query evaluation and administration tasks on
23
a repository (GET/POST/DELETE)
24
/contexts : context overview (GET)
25
/namespaces : overview of namespace definitions (GET/DELETE)
26
/:prefix : namespace-prefix definition (GET/PUT/DELETE)
27
/rdf-graphs : named graphs overview (GET)
28
/service : Graph Store operations on indirectly referenced named graphs
29
in repository (GET/PUT/POST/DELETE)
30
includes the query argument graph=${STORE_IGRAPH}
31
/:relativeGraph : Graph Store operations on directly referenced named graphs
32
in repository (GET/PUT/POST/DELETE)
33
/size : #statements in repository (GET)
34
/statements : repository statements (GET/POST/PUT/DELETE)
35
/:repository?default : the default graph
36
/:repository?graph=:indirectGraph : an arbitrary indirect graph
37
graph=urn:dydra:service-description : the repository SPARQL endpoint service description
38
/:repository/:relativeGraph : graph relative to the repository base url
39
/:repository/ldf : linked data fragment endpoint
40
/:repository/ldp : linked data platform endpoint
41
/:repository/service?default : graph store endpoint targeting the default graph
42
/:repository/service?graph=:indirectGraph : graph store endpoint targeting a specific graph
43
/:repository/sparql : sparql endpoint
44
/:repository/:view : view api
45
/system : this is interposed above accounts to isolate all non-content and to avoid rails' paths
48
/authorization : access rights,
49
/configuration : namespace, provenance, describe, default data-set and dynamic binding settings
50
/namespaces : just prefix bindings
51
/profile : name, homepage, email
54
/profile : name, homepage, summary, description, and license url
55
/configuration : access rights, namespace, provenance, describe, default data-set and dynamic binding settings
56
/service_description : the repository SPARQL endpoint service description
57
/service_history : the repository query statistics
58
/service_statistics : the repository query statistics
63
/profile : name, homepage, email
66
(defclass :|/| (anonymous-resource) ;; for websocket handshake w/o auth
69
(defclass |/ws| (anonymous-resource) ;; for websocket handshake w/o auth
72
(defclass |/favicon.ico| (anonymous-resource)
73
((mime:mime-type :initform mime:image/x-icon
76
(defclass |/:account| (account-resource) ; eventually the account page
78
(:metaclass spocq.i::persistent-class))
80
(defclass |/:account/protocol| (|/:account|)
82
(:metaclass spocq.i::persistent-class))
84
(defclass |/:account/repositories| (|/:account|)
86
(:metaclass spocq.i::persistent-class))
88
(defclass |/:account/repositories/:repository| (query-resource repository-resource)
90
(:metaclass spocq.i::persistent-class)
92
"Combine repository-resource slots with query-resource behavior.
93
In particular the autorization protocol must permit all methods and delay constraints until
94
the query form is known."))
96
(defclass |/:account/repositories/:repository/contexts| (|/:account/repositories/:repository|)
98
(:metaclass spocq.i::persistent-class))
100
(defclass |/:account/repositories/:repository/namespaces| (|/:account/repositories/:repository|)
102
(:metaclass spocq.i::persistent-class))
104
(defclass |/:account/repositories/:repository/namespaces/:prefix| (|/:account/repositories/:repository/namespaces|
107
(:metaclass spocq.i::persistent-class))
109
(defclass |/:account/repositories/:repository/rdf-graphs| (|/:account/repositories/:repository|
112
(:metaclass spocq.i::persistent-class))
114
(defclass |/:account/repositories/:repository/rdf-graphs/service| (|/:account/repositories/:repository/rdf-graphs|)
115
;; inherits from /:account/repositories/:repository/rdf-graphs in order to combine
116
;; decoding implementation
118
(:metaclass spocq.i::persistent-class))
120
(defclass |/:account/repositories/:repository/rdf-graphs/:graph| (|/:account/repositories/:repository/rdf-graphs|)
122
(:metaclass spocq.i::persistent-class))
124
(defclass |/:account/repositories/:repository/size| (|/:account/repositories/:repository|)
126
(:metaclass spocq.i::persistent-class))
128
(defclass |/:account/repositories/:repository/statements| (|/:account/repositories/:repository|
131
(:metaclass spocq.i::persistent-class))
133
(defclass |/:account/:repository| (query-resource repository-resource) ; not an account resource
135
(:metaclass spocq.i::persistent-class)
137
"Combine repository-resource slots with query-resource behavior.
138
In particular the autorization protocol must permit all methods and delay constraints until
139
the query form is known."))
141
(defclass |/:account/:repository/sparql| (|/:account/:repository|)
142
((mime:mime-type :initform (mime:mime-type "application/sparql-results+json; charset=utf-8")
144
(:documentation "the sparql endpoint for a given repository")
145
(:metaclass spocq.i::persistent-class))
147
(defclass |/:account/:repository/git/:git-path*| (|/:account/:repository|)
149
:initarg :path :accessor resource-git-path)
150
(mime:mime-type :initform (mime:mime-type "application/json; charset=utf-8")
152
(:documentation "the git endpoint for a given repository")
153
(:metaclass spocq.i::persistent-class))
155
(defclass |/:account/:repository/ldf| (|/:account/:repository|)
156
((mime:mime-type :initform (mime:mime-type "application/json; charset=utf-8")
158
(:documentation "the linked data fragment endpoint for a given repository")
159
(:metaclass spocq.i::persistent-class))
161
(defclass |/:account/:repository/tpf| (|/:account/:repository|)
162
((mime:mime-type :initform (mime:mime-type "application/n-quads; charset=utf-8")
164
(:documentation "the linked data fragment endpoint for a given repository")
165
(:metaclass spocq.i::persistent-class))
168
(defclass |/:account/:repository/service| (graph-store-service-resource |/:account/:repository|)
169
((mime:mime-type :initform (mime:mime-type "application/n-quads; charset=utf-8")
171
(:documentation "the graph store protocol endpoint for a given repository")
172
(:metaclass spocq.i::persistent-class))
174
(defclass |/:account/:repository/ldp| (graph-store-service-resource graph-store-binary-resource |/:account/:repository|)
175
((mime:mime-type :initform (mime:mime-type "text/turtle; charset=utf-8")
177
(:documentation "the linked data platform store protocol endpoint for a given repository,
178
to be accompanied by an indirect identifer for the target resource.
179
it mixes in binary decode _after_ service media types")
180
(:metaclass spocq.i::persistent-class))
182
(defmethod initialize-instance ((instance |/:account/:repository/ldp|) &rest initargs
183
&key (request (http:request))
184
(resource (http:request-query-argument request "resource"))
186
(apply #'call-next-method instance
188
(list* :graph resource initargs)
191
(defclass |/:account/:repository/:graph| (direct-graph-resource graph-store-service-resource |/:account/:repository|)
192
((mime:mime-type :initform (mime:mime-type "application/sparql-results+json; charset=utf-8")
194
(:documentation "the graph store protocol endpoint for a given repository w/ a direct graph.
195
for a sparql protocol request, this names a view
196
NYI, but holding the place.
198
(:metaclass spocq.i::persistent-class))
200
(defclass |/:account/:repository/:view.:type| (direct-graph-resource graph-store-service-resource |/:account/:repository|)
201
((view :initform "" :initarg :view
202
:reader resource-view)
203
(type :initform "json" :initarg :type
204
:reader resource-type)
205
(mime:mime-type :initform (mime:mime-type "application/sparql-results+json; charset=utf-8")
207
(:documentation "the graph store protocol endpoint for a given repository w/ a view.")
208
(:metaclass spocq.i::persistent-class))
210
(defclass |/:account/:repository/:graph/:element*| (|/:account/:repository/:graph|)
212
:initarg :element :initarg :elements :accessor resource-elements)
213
(mime:mime-type :initform (mime:mime-type "application/n-quads; charset=utf-8")
215
(:documentation "the graph store protocol endpoint for a given repository w/ an extended direct graph.
216
for a sparql protocol request, this names a view.
217
for a ldp request this combines the complonents to yield the full path ( deprecated in favor of an indirect graph)
219
(:metaclass spocq.i::persistent-class))
224
(defclass |/system| (administrator-resource metadata-resource account-resource)
226
(:default-initargs :account "admin"))
228
(defclass |/system/accounts| (administrator-resource metadata-resource account-resource)
231
(defclass |/system/accounts/:account| (metadata-resource account-resource)
233
(:metaclass spocq.i::persistent-class))
235
(defclass |/system/accounts/:account/authorization| (authorization-account-resource)
237
(:metaclass spocq.i::persistent-class))
239
(defclass |/system/accounts/:account/configuration| (configuration-account-resource)
241
(:metaclass spocq.i::persistent-class))
243
(defclass |/system/accounts/:account/configuration/:property| (configuration-account-resource)
245
(:metaclass spocq.i::persistent-class))
247
(defclass |/system/accounts/:account/profile| (profile-account-resource)
249
(:metaclass spocq.i::persistent-class))
251
(defclass |/system/accounts/:account/repositories| (metadata-resource repository-resource)
254
(defclass |/system/accounts/:account/repositories/:repository| (metadata-resource repository-resource)
257
(defclass |/system/accounts/:account/repositories/:repository/authorization| (authorization-repository-resource)
259
(:metaclass spocq.i::persistent-class))
261
(defclass |/system/accounts/:account/repositories/:repository/configuration| (configuration-repository-resource)
263
(:metaclass spocq.i::persistent-class))
265
(defclass |/system/accounts/:account/repositories/:repository/configuration/:property| (configuration-repository-resource)
266
;; does not specialize /*/repositories/*, as that is the sparql endpoint
268
(:metaclass spocq.i::persistent-class)
270
"Provide a resource which permits to specify an individual configuration property,
271
for example, the namespace prefix bindings."))
273
(defclass |/system/accounts/:account/repositories/:repository/views/:view| (|/:account/:repository|)
274
((view :initform "" :initarg :view
275
:reader resource-view))
276
(:metaclass spocq.i::persistent-class)
277
(:documentation "the view management endpoint"))
279
(defclass |/system/accounts/:account/repositories/:repository/views| (|/:account/:repository|)
281
(:metaclass spocq.i::persistent-class)
282
(:documentation "the view list endpoint"))
284
(defclass |/system/accounts/:account/repositories/:repository/profile| (profile-repository-resource)
285
;; does not specialize /*/repositories/*, as that is the sparql endpoint
287
(:metaclass spocq.i::persistent-class))
289
(defclass |/system/accounts/:account/repositories/:repository/revisions| (repository-resource)
291
(:metaclass spocq.i::persistent-class))
293
(defclass |/system/accounts/:account/repositories/:repository/service_description| (repository-resource)
295
(:metaclass spocq.i::persistent-class))
297
(defclass |/system/accounts/:account/repositories/:repository/service_history| (anonymous-resource repository-resource)
299
(:metaclass spocq.i::persistent-class))
301
(defclass |/system/accounts/:account/repositories/:repository/service_statistics| (anonymous-resource repository-resource)
303
(:metaclass spocq.i::persistent-class))
305
(defclass |/system/accounts/:account/repositories/:repository/revisions| (repository-resource)
307
(:metaclass spocq.i::persistent-class))
309
(defclass |/system/accounts/:account/services/:host/:path*| (service-repository-resource)
311
(:metaclass spocq.i::persistent-class))
314
(defclass |/system/configuration.:type| (|/system|)
315
((type :initform "srj" :initarg :type
316
:reader resource-type)))
319
(defclass |/system/service_history/imports| (|/system| authorized-resource)
321
(defclass |/system/service_history/imports.:type| (|/system/history/imports|)
322
((type :initform "json" :initarg :type
323
:reader resource-type)
324
(mime:mime-type :initform (mime:mime-type "application/json; charset=utf-8")
325
:allocation :class)))
327
(defclass |/system/service_history/queries| (|/system| authorized-resource)
329
(defclass |/system/service_history/queries/:account/:query-hash| (|/system/history/queries| account-resource)
330
((query-hash :initarg :query-hash :initform nil
331
:reader resource-query-hash)))
332
(defclass |/system/service_history/queries.:type| (|/system/history/queries|)
333
((type :initform "json" :initarg :type
334
:reader resource-type)
335
(mime:mime-type :initform (mime:mime-type "application/json; charset=utf-8")
336
:allocation :class)))
338
(defclass |/system/service_statistics/queries| (|/system| authorized-resource)
340
(defclass |/system/service_statistics/queries/:account/:query-hash| (|/system/history/queries| account-resource)
341
((query-hash :initarg :query-hash :initform nil
342
:reader resource-query-hash)))
343
(defclass |/system/service_statistics/queries.:type| (|/system/history/queries|)
344
((type :initform "json" :initarg :type
345
:reader resource-type)
346
(mime:mime-type :initform (mime:mime-type "application/json; charset=utf-8")
347
:allocation :class)))
349
(defclass |/system/service_history/transactions| (|/system| system-pathname-resource)
351
(:default-initargs :pathname #p"/var/log/dydra/commits.log"))
352
(defclass |/system/service_history/transactions.:type| (|/system/history/transactions|)
353
((type :initform "json" :initarg :type
354
:reader resource-type)
355
(mime:mime-type :initform (mime:mime-type "application/json; charset=utf-8")
356
:allocation :class)))
358
(defclass |/system/service_statistics/transactions| (|/system| system-pathname-resource)
360
(:default-initargs :pathname #p"/var/log/dydra/commits.log"))
361
(defclass |/system/service_statistics/transactions.:type| (|/system/history/transactions|)
362
((type :initform "json" :initarg :type
363
:reader resource-type)
364
(mime:mime-type :initform (mime:mime-type "application/json; charset=utf-8")
365
:allocation :class)))
367
(defclass |/system/status/accounts| (|/system| authorized-resource)
369
(defclass |/system/status/accounts.:type| (|/system/manage/accounts|)
370
((type :initform "json" :initarg :type
371
:reader resource-type)
372
(mime:mime-type :initform (mime:mime-type "application/json; charset=utf-8")
373
:allocation :class)))
375
(defclass |/system/status/repositories| (|/system| authorized-resource)
377
(defclass |/system/status/repositories.:type| (|/system/manage/repositories|)
378
((type :initform "json" :initarg :type
379
:reader resource-type)
380
(mime:mime-type :initform (mime:mime-type "application/json; charset=utf-8")
381
:allocation :class)))
384
(defclass |/system/queries| (|/system|)
387
(defclass |/system/threads| (|/system|)
390
(defclass |/system/status| (anonymous-resource |/system|)
393
(defclass |/system/status.:type| (|/system|)
394
((type :initform "srj" :initarg :type
395
:reader resource-type)))
397
(defclass |/admin/status.:type| (|/system|)
398
((type :initform "srj" :initarg :type
399
:reader resource-type)))
401
(defclass |/:user| (user-resource)
403
(:metaclass spocq.i::persistent-class))
405
(defclass |/system/users/:user/profile| (|/:user|)
407
(:metaclass spocq.i::persistent-class))