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

KindCoveredAll%
expression1625 64.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: org.datagraph.spocq.implementation; -*-
2
 ;;; (load "patches/mime-types.lisp")
3
 
4
 (in-package :org.datagraph.spocq.implementation)
5
 
6
 (dsu:modpackage :mime
7
   (:export :mime-type-boundary
8
            :mime-type-content-type))
9
 
10
 (defparameter *triple-dimensions* '(?::|s| ?::|p| ?::|o|)
11
   "The default dimensions for triples encoded.")
12
 (defparameter *quad-dimensions* (append *triple-dimensions* '(?::|g|))
13
   "The default dimensions for quads encoded.")
14
 
15
 (defun triple-dimensions () *triple-dimensions*)
16
 (defun quad-dimensions () *quad-dimensions*)
17
 
18
 
19
 ;;;
20
 ;;; mime type keys
21
 
22
 (unless (boundp 'mime:*/*)
23
   ;; patch for missing definition
24
   (defvar mime:*/* (make-instance 'mime:*/*)))
25
 (def-mime-type-key "BGP")
26
 (def-mime-type-key "BGP+SSE")
27
 (def-mime-type-key "BOOLEAN")
28
 (def-mime-type-key "CIRCOS")
29
 (def-mime-type-key "CIRCOS+PNG")
30
 (def-mime-type-key "CIRCOS+SVG+XML")
31
 (def-mime-type-key "CIRCOS+TSV")
32
 (def-mime-type-key "CXT")
33
 (def-mime-type-key "GRAPHQL")
34
 (def-mime-type-key "GZIP")
35
 (def-mime-type-key "JSON-QUERY")
36
 (def-mime-type-key "LD+JSON")
37
 (def-mime-type-key "LDF")
38
 (def-mime-type-key "LDF+N-QUADS")
39
 (def-mime-type-key "LDF+N-TRIPLES")
40
 (def-mime-type-key "LINK-FORMAT")
41
 (def-mime-type-key "MULTIPART")
42
 (def-mime-type-key "N-QUADS")
43
 (def-mime-type-key "N-TRIPLES")
44
 (def-mime-type-key "QUERY")
45
 (def-mime-type-key "RDF+JSON")
46
 (def-mime-type-key "RDF+THRIFT")
47
 (def-mime-type-key "RELATED")
48
 (def-mime-type-key "SPARQL")
49
 (def-mime-type-key "SPARQL-QUERY")
50
 (def-mime-type-key "SPARQL-QUERY-ALGEBRA")
51
 (def-mime-type-key "SPARQL-QUERY-EXECUTION")
52
 (def-mime-type-key "SPARQL-QUERY-PLAN")
53
 (def-mime-type-key "SPARQL-QUERY+JSON")
54
 (def-mime-type-key "SPARQL-QUERY+SSB")
55
 (def-mime-type-key "SPARQL-QUERY+CASCALOG")
56
 (def-mime-type-key "SPARQL-QUERY+JSON")
57
 (def-mime-type-key "SPARQL-QUERY+SSE")
58
 (def-mime-type-key "SPARQL-QUERY+SSL")
59
 (def-mime-type-key "SPARQL-QUERY+GRAPHVIZ") ;; abstract graphviz types
60
 (def-mime-type-key "SPARQL-QUERY+GRAPHVIZ+PDF")
61
 (def-mime-type-key "SPARQL-QUERY+GRAPHVIZ+PNG")
62
 (def-mime-type-key "SPARQL-QUERY+GRAPHVIZ+SVG+XML")
63
 (def-mime-type-key "SPARQL-RESULTS")
64
 (def-mime-type-key "SPARQL-RESULTS+CIRCOS")
65
 (def-mime-type-key "SPARQL-RESULTS-EXECUTION")
66
 (def-mime-type-key "SPARQL-RESULTS+JSON")
67
 (def-mime-type-key "SPARQL-RESULTS+JSONP")
68
 (def-mime-type-key "SPARQL-RESULTS+JSON-COLUMNS")
69
 (def-mime-type-key "SPARQL-RESULTS+JSON-COLUMNS-STREAMING")
70
 (def-mime-type-key "SPARQL-RESULTS+SSB")
71
 (def-mime-type-key "SPARQL-RESULTS+SSB-STREAM")
72
 (def-mime-type-key "SPARQL-RESULTS+SSE-STREAM")
73
 (def-mime-type-key "SPARQL-RESULTS+TERM-NUMBER")
74
 (def-mime-type-key "SPARQL-RESULTS-TRACE")
75
 (def-mime-type-key "SPARQL-RESULTS+GRAPHVIZ") ;; abstract graphviz types
76
 (def-mime-type-key "SPARQL-RESULTS+GRAPHVIZ+JPEG")
77
 (def-mime-type-key "SPARQL-RESULTS+GRAPHVIZ+PDF")
78
 (def-mime-type-key "SPARQL-RESULTS+GRAPHVIZ+PNG")
79
 (def-mime-type-key "SPARQL-RESULTS+GRAPHVIZ+SVG+XML")
80
 (def-mime-type-key "SPARQL-RESULTS+XML")
81
 (def-mime-type-key "SPARQL-UPDATE")
82
 (def-mime-type-key "SQL")
83
 (def-mime-type-key "SSB")
84
 (def-mime-type-key "SSE")
85
 (def-mime-type-key "THRIFT")
86
 (def-mime-type-key "TRIG")
87
 (def-mime-type-key "TRIX")
88
 (def-mime-type-key "TURTLE-STAR")
89
 
90
 ;;; specific vendor types
91
 (def-mime-type-key "VND.DYDRA.SPARQL")
92
 (def-mime-type-key "VND.DYDRA.SPARQL-QUERY")
93
 (def-mime-type-key "VND.DYDRA.SPARQL-QUERY-ALGEBRA")
94
 (def-mime-type-key "VND.DYDRA.SPARQL-QUERY-ALGEBRA+GRAPHVIZ")
95
 (def-mime-type-key "VND.DYDRA.SPARQL-QUERY-ALGEBRA+GRAPHVIZ+PDF")
96
 (def-mime-type-key "VND.DYDRA.SPARQL-QUERY-ALGEBRA+GRAPHVIZ+PNG")
97
 (def-mime-type-key "VND.DYDRA.SPARQL-QUERY-ALGEBRA+GRAPHVIZ+SVG+XML")
98
 (def-mime-type-key "VND.DYDRA.SPARQL-QUERY-PLAN")
99
 (def-mime-type-key "VND.DYDRA.SPARQL-QUERY-PLAN+GRAPHVIZ")
100
 (def-mime-type-key "VND.DYDRA.SPARQL-QUERY-PLAN+GRAPHVIZ+SVG+XML")
101
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS+CIRCOS+PNG")
102
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS+CIRCOS+SVG+XML")
103
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS-EXECUTION")
104
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS-EXECUTION+JSON")
105
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS-EXECUTION+GRAPHVIZ")
106
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS-EXECUTION+GRAPHVIZ+PDF")
107
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS-EXECUTION+GRAPHVIZ+PNG")
108
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS-EXECUTION+GRAPHVIZ+SVG+XML")
109
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS-TRACE")
110
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS-TRACE+JSON")
111
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS-TRACE+GRAPHVIZ")
112
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS-TRACE+GRAPHVIZ+PDF")
113
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS-TRACE+GRAPHVIZ+SVG+XML")
114
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS")
115
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS+GRAPHVIZ")
116
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS+GRAPHVIZ+JPEG")
117
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS+GRAPHVIZ+PDF")
118
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS+GRAPHVIZ+PNG")
119
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS+GRAPHVIZ+SVG+XML")
120
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS+HTML+TABLE")
121
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS+HTML+D3")
122
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS+HTML+CHART")
123
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS+HTML+CHART+RICKSHAW")
124
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS+HTML+HIVE")
125
 (def-mime-type-key "VND.DYDRA.SPARQL-RESULTS+HTML+PARALLELCOORDINATES")
126
 (def-mime-type-key "VND.GRAPHVIZ")
127
 (def-mime-type-key "VND.GRAPHVIZ+JPEG")
128
 (def-mime-type-key "VND.GRAPHVIZ+PDF")
129
 (def-mime-type-key "VND.GRAPHVIZ+PNG")
130
 (def-mime-type-key "VND.GRAPHVIZ+SVG+XML")
131
 (def-mime-type-key "VND.HDT")
132
 (def-mime-type-key "WEBP")
133
 (def-mime-type-key "X-ICON")
134
 (def-mime-type-key "X-NDJSON")
135
 
136
 ;;; three ihneritance relation patterns exist among media types.
137
 ;;; - major type : distinguishes among the application, image, text types
138
 ;;; - minor type : where the '+' suffix extends a base type
139
 ;;; - explicit : otherwise, the types serve as concrete markers, while
140
 ;;;   declared superclasses define a specialization hierarchy independent of
141
 ;;;   the media type names, which does not follow the minor name patterns.
142
 
143
 ;;; abstract media types
144
 (defclass mime::sse (mime:application/*) ())
145
 (defclass mime::sse-stream (mime::sse) ())
146
 (defclass mime::ssb (mime:application/*) ())
147
 (defclass mime::ssb-stream (mime::ssb) ())
148
 
149
 (defclass mime::triples (mime:rdf)
150
   ((dimensions
151
     :initform (triple-dimensions) :initarg :dimensions
152
     :reader media-type-dimensions)))
153
 
154
 (defclass mime::quads (mime::triples)
155
   ((dimensions
156
     :initform (quad-dimensions) :initarg :dimensions
157
     :reader media-type-dimensions)))
158
 
159
 ;;; graphviz typs for the cases which text/vnd.graphviz does not cover
160
 (defclass mime::graphviz-application (mime:graphviz)
161
   ()
162
   (:documentation "The abstract graphviz type for pdf generation."))
163
 (defclass mime::graphviz-image (mime:graphviz)
164
   ()
165
   (:documentation "The abstract graphviz type for jpeg, png, svg generation"))
166
 
167
 (defclass mime::circos (mime:*/*)
168
   ()
169
   (:documentation "The abstract circos media type is associated with no registered type(s).
170
   it is associated with numerous media types, of application, image and text major types,
171
   in order to specify purpose-specific encodings."))
172
 (def-mime-type ("APPLICATION" "CIRCOS") (mime::circos) ())
173
 (def-mime-type ("IMAGE" "CIRCOS") (mime::circos) ())
174
 (def-mime-type ("TEXT" "CIRCOS") (mime::circos) ())
175
 
176
 (defclass mime::query (mime:*/*)
177
   ()
178
   (:documentation "The abstrat root class of all query encodings.
179
 This includes both SPARQL, SQL, GRAPHQL, etc:"))
180
 
181
 (defclass mime::sparql (mime:*/*)
182
   ()
183
   (:documentation "The abstract sparql media type heads the hierarchy of abstract types
184
  which indicate various representation and encodings for content related to sparql.
185
  This includes both -query and -results specializations."))
186
 (defclass mime::SPARQL-QUERY (mime::sparql mime::query) ())
187
 (defclass mime::SPARQL-QUERY-ALGEBRA (mime::sparql-query) ())
188
 (defclass mime::SPARQL-QUERY-EXECUTION (mime::sparql-query) ())
189
 (defclass mime::SPARQL-QUERY-PLAN (mime::sparql-query) ())
190
 (defclass mime::SPARQL-RESULTS (mime::sparql) ())
191
 (defclass mime::SPARQL-RESULTS-EXECUTION (mime::sparql-results) ())
192
 (defclass mime::SPARQL-RESULTS-TRACE (mime::sparql-results) ())
193
 
194
 
195
 ;;; abstract media types - must appear before use
196
 
197
 ;;; no image/vnd.graphviz as both image and application are involved in its renderings
198
 (def-mime-type ("APPLICATION" "VND.GRAPHVIZ+PDF") (mime::application/pdf mime::graphviz-image)
199
   ((de.setf.utility.implementation::file-type
200
     :initform "pdf" :allocation :class)
201
    (canonical-mime-type
202
     :initform mime:text/vnd.graphviz)))
203
 
204
 ;;; must appear before references
205
 (def-mime-type ("IMAGE" "VND.GRAPHVIZ+JPEG") (mime:image/jpeg mime::graphviz-image)
206
   ((canonical-mime-type
207
     :initform mime:image/jpeg)))
208
 (def-mime-type ("IMAGE" "VND.GRAPHVIZ+PNG") (mime:image/png mime::graphviz-image)
209
   ((canonical-mime-type
210
     :initform mime:image/png)))
211
 (def-mime-type ("IMAGE" "VND.GRAPHVIZ+SVG+XML") (mime:image/svg+xml mime::graphviz-image)
212
   ((canonical-mime-type
213
     :initform mime:image/svg+xml)))
214
 
215
 ;;; concrete media types, where the relation is by minor type suffix only
216
 
217
 (def-mime-type ("APPLICATION" "BGP") ()
218
   ((de.setf.utility.implementation::charset
219
     :initform :utf-8)
220
    (de.setf.utility.implementation::file-type
221
     :initform "bgp")))
222
 
223
 (def-mime-type ("APPLICATION" "CXT") (mime::triples)
224
   ((de.setf.utility.implementation::charset
225
     :initform :utf-8)
226
    (de.setf.utility.implementation::file-type
227
     :initform "cxt")))
228
 
229
 (def-mime-type ("APPLICATION" "BGP+SSE") (mime::sse mime::application/bgp)
230
   ()
231
   (:documentation "SPARQL bgp forms encoded as sse as utf8 text"))
232
 
233
 (def-mime-type ("APPLICATION" "GRAPHQL") (mime::query)
234
   ()
235
   (:documentation "Intended as the alternative encoding for queries"))
236
 
237
 (def-mime-type ("APPLICATION" "GZIP") (mime:binary))
238
 
239
 (def-mime-type ("APPLICATION" "JAVASCRIPT") ()
240
   ((de.setf.utility.implementation::charset
241
     :initform :utf-8)
242
    (de.setf.utility.implementation::file-type
243
     :initform "js")))
244
 
245
 (def-mime-type ("APPLICATION" "LINK-FORMAT") ()
246
   ()
247
   (:documentation "Timemap encoded as HTTP Link headers"))
248
 
249
 (defclass mime::application/ld+json () ()) ;; to avvoid the compiler warning
250
 (def-mime-type ("APPLICATION" "LD+JSON") (mime::quads mime::application/json mime:mime-type-profile)
251
   ((de.setf.utility.implementation::charset
252
     :initform :utf-8)
253
    (de.setf.utility.implementation::file-type
254
     :initform "jsonld")))
255
 
256
 (defmethod initialize-instance :after ((instance mime::application/ld+json) &key)
257
   (setf (mime:mime-type-profile instance)
258
         (loop for iri in (mime:mime-type-profile instance)
259
           collect (intern-iri iri))))
260
 
261
 (def-mime-type ("APPLICATION" "LDF") ()
262
   ())
263
 
264
 (def-mime-type ("APPLICATION" "N-TRIPLES") (mime::triples mime:text/plain)
265
   ((de.setf.utility.implementation::charset
266
     :initform :utf-8)
267
    (de.setf.utility.implementation::file-type
268
     :initform "nt")))
269
 
270
 (def-mime-type ("APPLICATION" "N-QUADS") (mime::quads mime:text/plain)
271
   ((de.setf.utility.implementation::charset
272
     :initform :utf-8)
273
    (de.setf.utility.implementation::file-type
274
     :initform "nq")))
275
 
276
 ;;;!!! note the evaluation order due to the class dependency
277
 (def-mime-type ("APPLICATION" "LDF+N-TRIPLES") (mime::application/ldf mime::application/n-triples mime:mime-type-profile)
278
   ()
279
   (:default-initargs
280
       :profile "http://www.hydra-cg.com/spec/latest/linked-data-fragments/"
281
     :base-type mime::application/n-triples))
282
 
283
 (def-mime-type ("APPLICATION" "LDF+N-QUADS") (mime::application/ldf mime::application/n-quads  mime:mime-type-profile)
284
   ()
285
   (:default-initargs
286
       :profile "http://www.hydra-cg.com/spec/latest/linked-data-fragments/"
287
     :base-type mime::application/n-quads))
288
 
289
 
290
 (def-mime-type ("APPLICATION" "RDF+JSON") (mime::triples mime::application/json)
291
   ((de.setf.utility.implementation::charset
292
     :initform :utf-8)
293
    (de.setf.utility.implementation::file-type
294
     :initform "rj")))
295
 
296
 (def-mime-type ("APPLICATION" "THRIFT") ()
297
   ((de.setf.utility.implementation::charset
298
     :initform :utf-8)))
299
 
300
 (def-mime-type ("APPLICATION" "RDF+THRIFT") (mime::quads mime::application/thrift)
301
   ((de.setf.utility.implementation::charset
302
     :initform :utf-8)
303
    (de.setf.utility.implementation::file-type
304
     :initform "rt")))
305
 
306
 (def-mime-type ("APPLICATION" "SPARQL") (mime::sparql)
307
   ((de.setf.utility.implementation::charset
308
     :initform :utf-8)))
309
 
310
 (progn
311
 (def-mime-type ("APPLICATION" "SPARQL-QUERY") (mime::sparql-query mime::application/sparql)
312
   ((de.setf.utility.implementation::file-type
313
     :initform "rq")))
314
 
315
 (def-mime-type ("APPLICATION" "JSON-QUERY") (mime::application/json mime::application/sparql-query)
316
   ((de.setf.utility.implementation::file-type
317
     :initform "json"))
318
   (:documentation "json forms encoded as utf8 text"))
319
 )
320
 
321
 (def-mime-type ("APPLICATION" "SPARQL-QUERY-ALGEBRA") (mime::sparql-query-algebra
322
                                                        mime::application/sparql-query)
323
   ((de.setf.utility.implementation::file-type
324
     :initform "rqa"))
325
   (:documentation "SPARQL expressed as the recommendation's abstract algebra"))
326
 
327
 (def-mime-type ("APPLICATION" "SPARQL-QUERY-EXECUTION") (mime::sparql-query-execution
328
                                                          mime::application/sparql-query)
329
   ((de.setf.utility.implementation::file-type
330
     :initform "rqe"))
331
   (:documentation "SPARQL query preprocessed for compilation"))
332
 
333
 (def-mime-type ("APPLICATION" "SPARQL-QUERY-PLAN") (mime::sparql-query-plan
334
                                                     mime::application/sparql-query)
335
   ((de.setf.utility.implementation::file-type
336
     :initform "rqp")))
337
 
338
 (def-mime-type ("APPLICATION" "SPARQL-QUERY+CASCALOG") (mime::sse mime::application/sparql-query)
339
   ((de.setf.utility.implementation::file-type
340
     :initform "clog"))
341
   (:documentation "SPARQL encoded as a CASCALOG form"))
342
 
343
 (def-mime-type ("APPLICATION" "SPARQL-QUERY+JSON") (mime::application/json mime::application/sparql-query)
344
   ((de.setf.utility.implementation::file-type
345
     :initform "rqj"))
346
   (:documentation "SPARQL json forms encoded as utf8 text"))
347
 
348
 (def-mime-type ("APPLICATION" "SPARQL-QUERY+SSE") (mime::sse mime::application/sparql-query)
349
   ((de.setf.utility.implementation::file-type
350
     :initform "sse"))
351
   (:documentation "SPARQL ssf forms encoded as utf8 text"))
352
 
353
 (def-mime-type ("APPLICATION" "SPARQL-QUERY+SSL") (mime::application/sparql-query)
354
   ((de.setf.utility.implementation::file-type
355
     :initform "ssl"))
356
   (:documentation "SPARQL scripting language forms encoded as utf8 text"))
357
 
358
 (def-mime-type ("APPLICATION" "SPARQL-QUERY+GRAPHVIZ") (mime::graphviz mime::application/sparql-query)
359
   ((de.setf.utility.implementation::charset
360
     :initform :utf-8)
361
    (de.setf.utility.implementation::file-type
362
     :initform "dot"))
363
   (:documentation "SPARQL query encoded as graphviz dot"))
364
 
365
 
366
 (def-mime-type ("APPLICATION" "SPARQL-RESULTS") (mime::sparql-results)
367
   ((de.setf.utility.implementation::charset
368
     :initform :utf-8)
369
    (de.setf.utility.implementation::file-type
370
     :initform "sr")
371
    (dimensions
372
     :initform nil :initarg :dimensions
373
     :reader media-type-dimensions)))
374
 
375
 (def-mime-type ("APPLICATION" "SPARQL-RESULTS+CIRCOS") (mime::circos mime::application/sparql-results)
376
   ((de.setf.utility.implementation::charset
377
     :initform :utf-8))
378
   (:documentation "SPARQL results encoded for Circos, but unspecific"))
379
 
380
 (def-mime-type ("APPLICATION" "SPARQL-RESULTS-EXECUTION") (mime::sparql-results-execution
381
                                                            mime::application/sparql-results
382
                                                            mime:mime-type-profile)
383
   ((de.setf.utility.implementation::file-type
384
     :initform "rqx")))
385
 
386
 (defmethod initialize-instance :after ((instance mime::application/sparql-results-execution) &key)
387
   (setf (mime:mime-type-profile instance)
388
         (loop for iri in (mime:mime-type-profile instance)
389
           collect (intern-iri iri))))
390
 
391
 
392
 (def-mime-type ("APPLICATION" "SPARQL-RESULTS+JSON") (mime::application/json
393
                                                       mime::application/sparql-results)
394
   ((de.setf.utility.implementation::charset
395
     :initform :utf-8)
396
    (de.setf.utility.implementation::file-type
397
     :initform "srj"))
398
   (:documentation "SPARQL results encoded as json"))
399
 
400
 ;;; runistated 20200831
401
 ;;; implmentation specializes applicaiton/javascript,
402
 ;;; but this permits the specific media type at the protocol level
403
 (def-mime-type ("APPLICATION" "SPARQL-RESULTS+JSONP") (mime::application/javascript mime::application/sparql-results)
404
   ((de.setf.utility.implementation::charset
405
     :initform :utf-8)
406
    (de.setf.utility.implementation::file-type
407
     :initform "jsonp"))
408
   (:documentation "SPARQL results encoded as jsonp"))
409
 
410
 (def-mime-type ("APPLICATION" "SPARQL-RESULTS+JSON-COLUMNS") (mime::application/json mime::application/sparql-results)
411
   ((de.setf.utility.implementation::charset
412
     :initform :utf-8)
413
    (de.setf.utility.implementation::file-type
414
     :initform "srjc"))
415
   (:documentation "SPARQL results encoded as json in columns"))
416
 
417
 (def-mime-type ("APPLICATION" "SPARQL-RESULTS+JSON-COLUMNS-STREAMING") (mime::application/json mime::application/sparql-results)
418
   ((de.setf.utility.implementation::charset
419
     :initform :utf-8)
420
    (de.setf.utility.implementation::file-type
421
     :initform "srjcs"))
422
   (:documentation "SPARQL results encoded as json in columns, for streaming"))
423
 
424
 (def-mime-type ("APPLICATION" "SPARQL-RESULTS+SSB") (mime::ssb mime::application/sparql-results)
425
   ((de.setf.utility.implementation::charset
426
     :initform nil)
427
    (de.setf.utility.implementation::file-type
428
     :initform "ssb"))
429
   (:documentation "SPARQL results encoded as binary symbolic expressions"))
430
 
431
 (def-mime-type ("APPLICATION" "SPARQL-RESULTS+SSB-STREAM") (mime::ssb-stream mime::application/sparql-results)
432
   ((de.setf.utility.implementation::charset
433
     :initform nil)
434
    (de.setf.utility.implementation::file-type
435
     :initform "ssbs"))
436
   (:documentation "SPARQL results encoded as a stream of symbolic expressions"))
437
 
438
 (def-mime-type ("APPLICATION" "SPARQL-RESULTS+SSE-STREAM") (mime::sse-stream mime::application/sparql-results)
439
   ((de.setf.utility.implementation::charset
440
     :initform nil)
441
    (de.setf.utility.implementation::file-type
442
     :initform "sses"))
443
   (:documentation "SPARQL results encoded as a stream of binary symbolic expressions"))
444
 
445
 (def-mime-type ("APPLICATION" "SPARQL-RESULTS+TERM-NUMBER") (mime::application/sparql-results)
446
   ((de.setf.utility.implementation::charset
447
     :initform :utf-8)
448
    (de.setf.utility.implementation::file-type
449
     :initform "srjcs"))
450
   (:documentation "SPARQL results encoded as tsv of term-numbers, for communication among components"))
451
 
452
 (def-mime-type ("APPLICATION" "SPARQL-RESULTS-TRACE") (mime::sparql-results-trace
453
                                                        mime::application/sparql-results)
454
   ((de.setf.utility.implementation::file-type
455
     :initform "srt"))
456
   (:documentation "The abstract trace results class"))
457
 
458
 (def-mime-type ("APPLICATION" "SPARQL-RESULTS+XML") (mime::application/xml mime::application/sparql-results)
459
   ((de.setf.utility.implementation::charset
460
     :initform :utf-8)
461
    (de.setf.utility.implementation::file-type
462
     :initform "srx"))
463
   (:documentation "SPARQL results encoded as xml"))
464
 
465
 
466
 (def-mime-type ("APPLICATION" "SPARQL-UPDATE") (mime::application/sparql)
467
   ((de.setf.utility.implementation::file-type
468
     :initform "su")))
469
 
470
 (def-mime-type ("APPLICATION" "SQL") (mime::query)
471
   ((de.setf.utility.implementation::file-type
472
     :initform "sql"))
473
   (:documentation "Intended as a response media type for testing query translation to SQL."))
474
 
475
 (def-mime-type ("APPLICATION" "SSE") ()
476
   ((de.setf.utility.implementation::file-type
477
     :initform "sse"))
478
   (:documentation "general s-expression coded messages"))
479
 
480
 (def-mime-type ("APPLICATION" "TRIX") (mime::quads mime::application/xml)
481
   ((de.setf.utility.implementation::charset
482
     :initform :utf-8)
483
    (de.setf.utility.implementation::file-type
484
     :initform "trix")))
485
 
486
 (def-mime-type ("APPLICATION" "TRIG") (mime::quads mime:text/plain)
487
   ((de.setf.utility.implementation::charset
488
     :initform :utf-8)
489
    (de.setf.utility.implementation::file-type
490
     :initform "trig")))
491
 
492
 (def-mime-type ("APPLICATION" "TURTLE-STAR") (mime::quads mime:text/plain)
493
   ((de.setf.utility.implementation::charset
494
     :initform :utf-8)
495
    (de.setf.utility.implementation::file-type
496
     :initform "ttls")))
497
 
498
 
499
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-QUERY") (mime::application/sparql-query)
500
   ()
501
   (:documentation "Dydra private SPARQL encodings, 'APPLICATION' for programmatic accesss."))
502
 
503
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-QUERY-ALGEBRA") (mime::sparql-query-algebra
504
                                                                  mime::application/vnd.dydra.sparql-query)
505
   ()
506
   (:documentation "SPARQL symbolic forms encoded as utf8 s-expression text"))
507
 
508
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-QUERY-ALGEBRA+GRAPHVIZ+PDF") (mime::application/vnd.graphviz+pdf
509
                                                                               mime::application/vnd.dydra.sparql-query-algebra)
510
   ()
511
   (:documentation "SPARQL symbolic forms rendered as a graph in a pdf document"))
512
 
513
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-QUERY-PLAN") (mime::application/sparql-query-plan
514
                                                               mime::application/vnd.dydra.sparql-query)
515
   ()
516
   (:documentation "expanded SPARQL symbolic forms encoded as utf8 s-expression text"))
517
 
518
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS") (mime::application/sparql-results)
519
   ()
520
   (:documentation "Dydra private SPARQL encodings, 'APPLICATION' for programmatic accesss."))
521
 
522
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS-EXECUTION") (mime::application/sparql-results-execution
523
                                                                      mime::application/vnd.dydra.sparql-results)
524
   ()
525
   (:documentation "SPARQL execution statistics"))
526
 
527
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS-EXECUTION+JSON") (mime::application/json
528
                                                                           mime::application/vnd.dydra.sparql-RESULTS-EXECUTION)
529
   ((de.setf.utility.implementation::charset
530
     :initform :utf-8)
531
    (de.setf.utility.implementation::file-type
532
     :initform "srxj")) ;"json"))
533
   (:documentation "SPARQL operation execution statistics, encoded as json"))
534
 
535
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS+GRAPHVIZ+PDF") (mime::application/vnd.graphviz+pdf
536
                                                                         mime::application/vnd.dydra.sparql-results)
537
   ()
538
   (:documentation "SPARQL results rendered as a graph in a pdf document"))
539
 
540
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS-EXECUTION+GRAPHVIZ") (mime::sparql-results-execution
541
                                                                               mime:graphviz)
542
   ()
543
   (:documentation "SPARQL execution statistics graphviz application variations"))
544
 
545
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS-EXECUTION+GRAPHVIZ+PDF") (mime::application/vnd.graphviz+pdf
546
                                                                                   mime::application/vnd.dydra.sparql-results-execution+graphviz)
547
   ()
548
   (:documentation "SPARQL operation execution statistics rednered as a graph in a pdf document"))
549
 
550
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS-TRACE") (mime::application/sparql-results-trace
551
                                                                       mime::application/vnd.dydra.sparql-results)
552
   ()
553
   (:documentation "SPARQL operation trace results"))
554
 
555
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS-TRACE+JSON") (mime::application/json
556
                                                                       mime::application/vnd.dydra.sparql-RESULTS-TRACE)
557
   ((de.setf.utility.implementation::charset
558
     :initform :utf-8)
559
    (de.setf.utility.implementation::file-type
560
     :initform "srtj"))
561
   (:documentation "SPARQL operation trace results, encoded as json"))
562
 
563
 
564
 
565
 
566
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS+HTML+TABLE") (mime::application/sparql-results)
567
   ((de.setf.utility.implementation::charset
568
     :initform :utf-8)
569
    (de.setf.utility.implementation::file-type
570
     :initform "html"))
571
   (:documentation "SPARQL results encoded as an html document in a table"))
572
 
573
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS+HTML+CHART") (mime::application/sparql-results)
574
   ((de.setf.utility.implementation::charset
575
     :initform :utf-8)
576
    (de.setf.utility.implementation::file-type
577
     :initform "html"))
578
   (:documentation "SPARQL results encoded as an html document in chart"))
579
 
580
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS+HTML+CHART+RICKSHAW") (mime::application/VND.DYDRA.SPARQL-RESULTS+HTML+CHART)
581
   ((de.setf.utility.implementation::charset
582
     :initform :utf-8)
583
    (de.setf.utility.implementation::file-type
584
     :initform "srjcs"))
585
   (:documentation "SPARQL results encoded as an html document in a d3-based graph using rickshaw"))
586
 
587
 
588
 
589
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS+HTML+D3") (mime::application/sparql-results)
590
   ((de.setf.utility.implementation::charset
591
     :initform :utf-8)
592
    (de.setf.utility.implementation::file-type
593
     :initform "html"))
594
   (:documentation "SPARQL results encoded as an html document in a d3-based visual"))
595
 
596
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS+HTML+HIVE") (mime::application/sparql-results)
597
   ((de.setf.utility.implementation::charset
598
     :initform :utf-8)
599
    (de.setf.utility.implementation::file-type
600
     :initform "html"))
601
   (:documentation "SPARQL results encoded as an html document in a d3-based hive graph"))
602
 
603
 (def-mime-type ("APPLICATION" "VND.DYDRA.SPARQL-RESULTS+HTML+PARALLELCOORDINATES") (mime::application/sparql-results)
604
   ((de.setf.utility.implementation::charset
605
     :initform :utf-8)
606
    (de.setf.utility.implementation::file-type
607
     :initform "html"))
608
   (:documentation "SPARQL results encoded as an html document with a d3-based parallel-coordinates graph"))
609
 
610
 (def-mime-type ("APPLICATION" "VND.HDT") (mime::triples)
611
   ((de.setf.utility.implementation::charset
612
     :initform :utf-8)
613
    (de.setf.utility.implementation::file-type
614
     :initform "hdt")))
615
 
616
 (def-mime-type ("APPLICATION" "X-NDJSON") (mime::application/json mime::application/sparql-results)
617
   ((de.setf.utility.implementation::charset
618
     :initform :utf-8)
619
    (de.setf.utility.implementation::file-type
620
     :initform "ndjson")))
621
 
622
 (def-mime-type ("IMAGE" "CIRCOS+PNG") (mime:image/png mime:image/circos)
623
   ((de.setf.utility.implementation::file-type
624
     :initform "png"))
625
   (:documentation "a CIRCOS matrix rendered as a png document"))
626
 
627
 (def-mime-type ("IMAGE" "CIRCOS+SVG+XML") (mime:image/svg+xml mime:image/circos)
628
   ((de.setf.utility.implementation::charset
629
     :initform :utf-8)
630
    (de.setf.utility.implementation::file-type
631
     :initform "svg"))
632
   (:documentation "a CIRCOS matrix rendered as a svg document"))
633
 
634
 (def-mime-type ("IMAGE" "PNG") ()
635
   ((de.setf.utility.implementation::file-type
636
     :initform "png")))
637
 
638
 (def-mime-type ("IMAGE" "SPARQL") ()
639
   ((de.setf.utility.implementation::charset
640
     :initform :utf-8)))
641
 
642
 (def-mime-type ("IMAGE" "SPARQL-QUERY") (mime:image/sparql)
643
   ((de.setf.utility.implementation::file-type
644
     :initform "rq")))
645
 
646
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-QUERY-ALGEBRA") (mime::sparql-query-algebra
647
                                                            mime:image/sparql-query)
648
   ()
649
   (:documentation "SPARQL symbolic forms encoded as an image"))
650
 
651
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-QUERY-ALGEBRA+GRAPHVIZ+PNG") (mime:image/vnd.graphviz+png
652
                                                                         mime:image/vnd.dydra.sparql-query-algebra)
653
   ()
654
   (:documentation "SPARQL symbolic forms encoded as a graphviz dot document"))
655
 
656
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-QUERY-ALGEBRA+GRAPHVIZ+SVG+XML") (mime:image/vnd.graphviz+svg+xml
657
                                                                             mime:image/vnd.dydra.sparql-query-algebra)
658
   ()
659
   (:documentation "SPARQL symbolic forms encoded as a graphviz dot rendered as svg+xml"))
660
 
661
 
662
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-QUERY-PLAN") (mime::sparql-query-PLAN
663
                                                         mime:image/sparql-query)
664
   ()
665
   (:documentation "SPARQL execution plan encoded as an image"))
666
 
667
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-QUERY-PLAN+GRAPHVIZ+SVG+XML") (mime:image/vnd.graphviz+svg+xml
668
                                                                          mime:image/vnd.dydra.sparql-query-plan)
669
   ()
670
   (:documentation "SPARQL execution plan encoded as a graphviz dot rendered as svg+xml"))
671
 
672
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-RESULTS") (mime::sparql-results)
673
   ()
674
   (:documentation "SPARQL symbolic forms encoded as an image"))
675
 
676
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-RESULTS+CIRCOS+PNG") (mime:image/circos+png mime:*/sparql-results+circos mime::sparql-results)
677
   ((de.setf.utility.implementation::file-type
678
     :initform "png"))
679
   (:documentation "SPARQL results encoded as Circos rendered as png"))
680
 
681
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-RESULTS+CIRCOS+SVG+XML") (mime:image/circos+svg+xml mime:*/sparql-results+circos mime::sparql-results  mime:mime-type-profile)
682
   ((de.setf.utility.implementation::file-type
683
     :initform "svg"))
684
   (:documentation "SPARQL results encoded as Circos rendered as svg+xml"))
685
 
686
 (defmethod initialize-instance :after ((instance mime::image/VND.DYDRA.SPARQL-RESULTS+CIRCOS+SVG+XML) &key)
687
   (setf (mime:mime-type-profile instance)
688
         (loop for iri in (mime:mime-type-profile instance)
689
           collect (intern-iri iri))))
690
 
691
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-RESULTS+GRAPHVIZ") (mime:graphviz mime:image/vnd.dydra.sparql-results)
692
   ()
693
   (:documentation "SPARQL results encoded as graphviz variant"))
694
 
695
 
696
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-RESULTS+GRAPHVIZ+JPEG") (mime:image/vnd.graphviz+jpeg
697
                                                                    mime:image/vnd.dydra.sparql-results+graphviz)
698
   ()
699
   (:documentation "SPARQL results encoded as graphviz dot rendered as jpeg"))
700
 
701
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-RESULTS+GRAPHVIZ+PNG") (mime:image/vnd.graphviz+png 
702
                                                                   mime:image/vnd.dydra.sparql-results+graphviz)
703
   ((de.setf.utility.implementation::file-type
704
     :initform "png"))
705
   (:documentation "SPARQL results encoded as graphviz dot rendered as png"))
706
 
707
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-RESULTS+GRAPHVIZ+SVG+XML") (mime:image/vnd.graphviz+svg+xml
708
                                                                       mime:image/vnd.dydra.sparql-results+graphviz)
709
   ()
710
   (:documentation "SPARQL results encoded as graphviz dot rendered as svg+xml"))
711
 
712
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-RESULTS-EXECUTION") (mime::sparql-results-execution)
713
   ()
714
   (:documentation "SPARQL execution statistics encoded as an image"))
715
 
716
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-RESULTS-EXECUTION+GRAPHVIZ") (mime::sparql-results-execution
717
                                                                         mime:graphviz)
718
   ()
719
   (:documentation "SPARQL execution statistics graphviz image variations"))
720
 
721
 
722
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-RESULTS-EXECUTION+GRAPHVIZ+PNG") (mime:image/vnd.graphviz+png 
723
                                                                             mime:image/vnd.dydra.sparql-results-execution+graphviz)
724
   ((de.setf.utility.implementation::file-type
725
     :initform "png"))
726
   (:documentation "SPARQL results encoded as graphviz dot rendered as png"))
727
 
728
 (def-mime-type ("IMAGE" "VND.DYDRA.SPARQL-RESULTS-EXECUTION+GRAPHVIZ+SVG+XML") (mime:image/vnd.graphviz+svg+xml 
729
                                                                                 mime:image/vnd.dydra.sparql-results-execution+graphviz)
730
   ()
731
   (:documentation "SPARQL results encoded as graphviz dot rendered as svg+xml"))
732
 
733
 
734
 (def-mime-type ("IMAGE" "WEBP") ()
735
   ((de.setf.utility.implementation::file-type
736
     :initform "webp")))
737
 
738
 (def-mime-type ("IMAGE" "X-ICON") ()
739
   ((de.setf.utility.implementation::file-type
740
     :initform "ico")))
741
 
742
 
743
 (defclass mime::multipart ()
744
   ((boundary
745
     :initform "" :initarg :boundary
746
     :reader mime:mime-type-boundary)
747
    (content-type
748
     :initform nil :initarg :content-type
749
     :reader mime:mime-type-content-type))
750
   (:documentation "see https://tools.ietf.org/html/rfc2387"))
751
 
752
 (def-mime-type ("MULTIPART" "RELATED") (mime::multipart)
753
   ())
754
 
755
 (def-mime-type ("RDF" "JSON") (mime:rdf mime::application/json)
756
   ((de.setf.utility.implementation::charset
757
     :initform :utf-8)
758
    (de.setf.utility.implementation::file-type
759
     :initform "rj")))
760
 
761
 (def-mime-type ("TEXT" "BOOLEAN") ()
762
   ((de.setf.utility.implementation::charset
763
     :initform nil)
764
    (de.setf.utility.implementation::file-type
765
     :initform "txt"))
766
   (:documentation "SPARQL results encoded as a stream of binary symbolic expressions"))
767
 
768
 (def-mime-type ("TEXT" "CIRCOS+TSV") (mime:text/tab-separated-values mime:text/circos)
769
   ((de.setf.utility.implementation::charset
770
     :initform :utf-8)
771
    (de.setf.utility.implementation::file-type
772
     :initform "tsv"))
773
   (:documentation "a CIRCOS matrix rendered as a tsv document"))
774
 
775
 (def-mime-type ("TEXT" "TURTLE") (mime::triples mime:text/plain)
776
   ((de.setf.utility.implementation::charset
777
     :initform :utf-8)
778
    (de.setf.utility.implementation::file-type
779
     :initform "ttl")))
780
 
781
 (def-mime-type ("TEXT" "VND.DYDRA.SPARQL-QUERY-ALGEBRA+GRAPHVIZ") (mime:text/vnd.graphviz mime::sparql-query-algebra)
782
   ()
783
   (:documentation "SPARQL symbolic forms encoded as a graphviz dot document"))
784
 
785
 (def-mime-type ("TEXT" "VND.DYDRA.SPARQL-QUERY-PLAN+GRAPHVIZ") (mime:text/vnd.graphviz mime::sparql-query-plan)
786
   ()
787
   (:documentation "SPARQL compiled symbolic forms encoded as a graphviz dot document"))
788
 
789
 (def-mime-type ("TEXT" "VND.DYDRA.SPARQL-RESULTS+GRAPHVIZ") (mime:text/vnd.graphviz mime::sparql-results)
790
   ((de.setf.utility.implementation::charset
791
     :initform :utf-8)
792
    (de.setf.utility.implementation::file-type
793
     :initform "dot"))
794
   (:documentation "SPARQL results encoded as graphviz dot"))
795
 
796
 (def-mime-type ("TEXT" "VND.DYDRA.SPARQL-RESULTS-EXECUTION+GRAPHVIZ") (mime::sparql-results-execution
797
                                                                        mime:text/vnd.dydra.sparql-results+graphviz)
798
   ((de.setf.utility.implementation::charset
799
     :initform :utf-8)
800
    (de.setf.utility.implementation::file-type
801
     ;; override the iana default
802
     :initform "dot"))
803
   (:documentation "SPARQL execution result statistics encoded as a graphviz dot document"))
804
 
805
 (def-mime-type ("TEXT" "VND.DYDRA.SPARQL-RESULTS-TRACE+GRAPHVIZ") (mime::sparql-results-trace
806
                                                                    mime:text/vnd.dydra.sparql-results+graphviz)
807
   ((de.setf.utility.implementation::charset
808
     :initform :utf-8))
809
   (:documentation "SPARQL execution trace encoded as a graphviz dot document"))
810