Coverage report: /development/source/library/org/datagraph/spocq-shard/src/spocq-server/metadata.lisp
| Kind | Covered | All | % |
| expression | 0 | 41 | 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; -*-
3
(in-package :org.datagraph.spocq.server.implementation)
5
(:documentation "account presentations:
6
- establish the target resource
7
- establish agent based on authentication
8
- establish authorization for the agent respective the resource
9
- retrieve / modify resource metdata as per request
14
reimplement config operators to extract from the metadata instance once it is
15
clean - retrieving i fnecessary
17
representation spans three realms
22
in the store accounts, repositories and users exists as graphs
24
-- identity, ownership, authentication information in systes/system
25
-- profile, configuration (query processing and authorization) in :account/system
28
-- identity, authentication (should actually be for the user, not the account) in system/system
29
-- profile using an account with that name in :account/system
32
-- identity and ownership information in system/system
33
-- profile, configuration (query processing and authorization) in :account/system
35
the active representation comprises
36
a spocq.si:persistent-resource (for the profile information),
37
a spocq.i:object-with-persistent-metadata (for the identity and process state)
38
a spocq.i:metadata for the configuration with the structure
40
persistent-resource -> object-with-persistent-metadata -> metadata
45
-- namespaces/:prefix (as a distinct resource)
46
-- namespaces (as a distinct resource)
48
the projection paths are
50
<- encode-presentation <- <- decode-graph <-
51
http resource persistent store
52
-> decode-presentation -> -> encode-graph ->
54
each is a generic function for which the base method generates and adds a class-specific method.
55
each respective method iterates over the slots respective the graph statements as controlled
56
by the class' slot definitions and projects those for which an accessor is present in
57
the respective package 'presentation-codec' and 'graph-codec'.
59
this make it possible to control which properties are projected between which realms and to
60
distinguihs also the directions.
63
(:documentation "implement the sparql graph store and sesame2 protocol plus extensions, variations, etc.
65
This file implements extensions to the standard repository access protocols to manage
68
In addition to these paths, the account and repository metadata is located along a path
69
distinct from possible repository linked-data resources:
76
/profile : name, homepage, summary, description, and license url
77
/configuration : access rights,
78
: namespace, provenance, describe, default data-set and dynamic binding settings
79
/service_description : the repository SPARQL endpoint service description
81
See resources.lisp for the class definitions.
85
(defparameter *configuration-dimensions* '(?::|resource| ?::|setting| ?::|value|)
86
"Solution field dimensions for configuration responses")
88
(http:def-resource-function serve-resource-configuration (account request response)
90
(:auth http:authenticate-request-password)
91
(:auth http:authenticate-request-token)
92
(:auth http:authenticate-request-session)
93
(:auth http:authenticate-request-location)
95
(:auth http:authorize-request)
97
(:encode mime:application/sparql-results+json)
98
(:encode :default mime:application/json)
99
(:encode mime:application/sparql-results+xml)
100
(:encode mime:text/csv)
101
(:encode mime:text/plain)
102
(:encode mime:text/tab-separated-values)
104
(:decode mime:application/n-triples)
105
(:decode mime:text/plain :as mime:application/n-triples)
106
(:decode mime:application/x-www-form-urlencoded)
111
(:decode ((resource metadata-resource) request response (request-type mime:application/json) (response-type t))
112
(let* ((request-content (http:decode-request resource request request-type))
113
(instance-arguments (resource-model-arguments resource request-content)))
114
(if instance-arguments
115
;; need to identif the corrct class fo rhte decoding and the resource ist (eq namespaces) nic aleays correct.
116
(transcode-field (resource-model-instance resource) instance-arguments
117
request-type mime:application/n-triples)
118
(http:bad-request "no resource configuration was provided: ~s." request-content))))
120
(:decode ((resource metadata-resource) request response (request-type mime:application/x-www-form-urlencoded) (response-type t))
121
(let* ((arguments (http:request-post-argument-list request))
122
(instance (resource-model-instance resource))
123
(json-arguments (transcode-field instance arguments mime:application/x-www-form-urlencoded mime:application/json))
124
(instance-arguments (resource-model-arguments resource json-arguments)))
125
(if instance-arguments
126
(transcode-field instance instance-arguments mime:application/json mime:application/n-triples)
127
(http:bad-request "no resource configuration was provided: ~s." arguments))))