qlue-ls 3.4.1

A language server for SPARQL
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
#[cfg(target_arch = "wasm32")]
use crate::server::lsp::rpc::NotificationMessageBase;
use crate::{
    server::{
        lsp::{
            LspMessage,
            errors::{ErrorCode, LSPErrorBase},
            rpc::{RequestId, RequestMessageBase, ResponseMessageBase},
            textdocument::TextDocumentIdentifier,
        },
        sparql_operations::{ConnectionError, HttpError},
    },
    sparql::results::SparqlResult,
};
#[cfg(target_arch = "wasm32")]
use lazy_sparql_result_reader::parser::PartialResult;
use serde::{Deserialize, Serialize};

#[derive(Debug, Deserialize)]
pub struct ExecuteOperationRequest {
    #[serde(flatten)]
    base: RequestMessageBase,
    pub params: ExecuteOperationParams,
}
impl ExecuteOperationRequest {
    pub(crate) fn get_id(&self) -> &RequestId {
        &self.base.id
    }
}

impl LspMessage for ExecuteOperationRequest {}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExecuteOperationParams {
    #[serde(flatten)]
    pub source: ExecuteOperationSource,
    pub max_result_size: Option<usize>,
    pub result_offset: Option<usize>,
    pub query_id: Option<String>,
    pub lazy: Option<bool>,
    pub access_token: Option<String>,
}

// INFO: `textDocument` resolves the query text via the server's document store;
// `query` carries the SPARQL string inline.
#[derive(Debug, Deserialize)]
#[serde(rename_all_fields = "camelCase", untagged)]
pub enum ExecuteOperationSource {
    Document {
        text_document: TextDocumentIdentifier,
    },
    Inline {
        query: String,
    },
}

#[derive(Debug, Serialize)]
pub struct ExecuteOperationResponse {
    #[serde(flatten)]
    base: ResponseMessageBase,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub result: Option<ExecuteOperationResponseResult>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub error: Option<ExecuteOperationError>,
}

impl ExecuteOperationResponse {
    pub(crate) fn success(id: &RequestId, result: ExecuteOperationResponseResult) -> Self {
        Self {
            base: ResponseMessageBase::success(id),
            result: Some(result),
            error: None,
        }
    }

    pub(crate) fn error(id: &RequestId, error: ExecuteOperationErrorData) -> Self {
        Self {
            base: ResponseMessageBase::success(id),
            result: None,
            error: Some(ExecuteOperationError {
                base: LSPErrorBase {
                    code: ErrorCode::RequestFailed,
                    message: match &error {
                        ExecuteOperationErrorData::QLeverException(_) => "Qlever threw an error.",
                        ExecuteOperationErrorData::Connection(_) => {
                            "The connection to the endpoint failed."
                        }
                        ExecuteOperationErrorData::Http(_) => {
                            "The endpoint returned an http error."
                        }
                        ExecuteOperationErrorData::Canceled(_) => "The query was canceled.",
                        ExecuteOperationErrorData::InvalidFormat {
                            query: _,
                            message: _,
                        } => "Update result could not be deserialized.",
                        ExecuteOperationErrorData::Deserialization {
                            query: _,
                            message: _,
                        } => "The result of the query could not be deserialized.",
                        ExecuteOperationErrorData::Unknown => "An unknown error occured",
                    }
                    .to_string(),
                },
                data: error,
            }),
        }
    }
}

impl LspMessage for ExecuteOperationResponse {}

#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum ExecuteOperationResponseResult {
    QueryResult(ExecuteQueryResponseResult),
    UpdateResult(ExecuteUpdateResponseResult),
}

#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ExecuteQueryResponseResult {
    pub time_ms: u128,
    pub result: Option<SparqlResult>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct ExecuteUpdateResponseResult {
    pub operations: Vec<ExecuteUpdateOperationResult>,
    pub time: ExecuteUpdateGlobalTimeInfo,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExecuteUpdateGlobalTimeInfo {
    pub total: u64,
    pub parsing: u64,
    pub waiting_for_update_thread: u64,
    pub acquiring_delta_triples_write_lock: u64,
    pub operations: u64,
    pub metadata_update_for_snapshot: u64,
    pub disk_writeback: u64,
    pub snapshot_creation: u64,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct ExecuteUpdateOperationResult {
    pub status: String,
    #[serde(rename(deserialize = "delta-triples", serialize = "deltaTriples"))]
    pub delta_triples: DeltaTiples,
    #[serde(rename(deserialize = "located-triples", serialize = "locatedTriples"))]
    pub located_triples: LocatedTriplesStats,
    pub time: ExecuteUpdateOperationTimeInfo,
    pub update: String,
    pub warnings: Vec<String>,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExecuteUpdateOperationTimeInfo {
    pub execution: ExecutionTime,
    pub planning: u64,
    pub total: u64,
    pub update_metadata: u64,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExecutionTime {
    pub clear_cache: u64,
    pub compute_ids: ComputeIdsTime,
    pub delete_triples: TripleWriteTime,
    pub evaluate_where: u64,
    pub insert_triples: TripleWriteTime,
    pub total: u64,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ComputeIdsTime {
    pub deduplication: u64,
    pub result_interpolation: u64,
    pub total: u64,
    pub vocab_lookup: u64,
}

// INFO: QLever reports `0` when the operation does not perform that kind of
// write (e.g. `insertTriples` is a plain integer for a DELETE WHERE), and a
// detailed breakdown otherwise.
#[derive(Debug, Serialize, Deserialize)]
#[serde(untagged)]
pub enum TripleWriteTime {
    Skipped(u64),
    Detailed(Box<TripleWriteTimeDetails>),
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TripleWriteTimeDetails {
    pub external_permutation: ExternalPermutationTime,
    pub internal_permutation: InternalPermutationTime,
    pub make_internal_triples: u64,
    pub total: u64,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExternalPermutationTime {
    pub located_and_add: ExternalLocatedAndAdd,
    pub mark_triples: u64,
    pub remove_existing_triples: u64,
    pub remove_inverse_triples: u64,
    pub rewrite_local_vocab_entries: u64,
    pub total: u64,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExternalLocatedAndAdd {
    #[serde(rename(deserialize = "SPO"))]
    pub spo: PermutationLocateAdd,
    #[serde(rename(deserialize = "SOP"))]
    pub sop: PermutationLocateAdd,
    #[serde(rename(deserialize = "PSO"))]
    pub pso: PermutationLocateAdd,
    #[serde(rename(deserialize = "POS"))]
    pub pos: PermutationLocateAdd,
    #[serde(rename(deserialize = "OSP"))]
    pub osp: PermutationLocateAdd,
    #[serde(rename(deserialize = "OPS"))]
    pub ops: PermutationLocateAdd,
    pub total: u64,
    pub transform_handles: u64,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct InternalPermutationTime {
    pub located_and_add: InternalLocatedAndAdd,
    pub mark_triples: u64,
    pub remove_existing_triples: u64,
    pub remove_inverse_triples: u64,
    pub rewrite_local_vocab_entries: u64,
    pub total: u64,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct InternalLocatedAndAdd {
    #[serde(rename(deserialize = "PSO"))]
    pub pso: PermutationLocateAdd,
    #[serde(rename(deserialize = "POS"))]
    pub pos: PermutationLocateAdd,
    pub total: u64,
    pub transform_handles: u64,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PermutationLocateAdd {
    pub add_to_located_triples: AddToLocatedTriples,
    pub locate_triples: u64,
    pub total: u64,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct AddToLocatedTriples {
    pub adding: u64,
    pub total: u64,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct DeltaTiples {
    pub before: TripleDelta,
    pub after: TripleDelta,
    pub difference: TripleDelta,
    pub operation: TripleDelta,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct LocatedTriplesStats {
    #[serde(rename(deserialize = "SPO"))]
    pub spo: LocatedTriplesPermutationStats,
    #[serde(rename(deserialize = "SOP"))]
    pub sop: LocatedTriplesPermutationStats,
    #[serde(rename(deserialize = "PSO"))]
    pub pso: LocatedTriplesPermutationStats,
    #[serde(rename(deserialize = "POS"))]
    pub pos: LocatedTriplesPermutationStats,
    #[serde(rename(deserialize = "OSP"))]
    pub osp: LocatedTriplesPermutationStats,
    #[serde(rename(deserialize = "OPS"))]
    pub ops: LocatedTriplesPermutationStats,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct LocatedTriplesPermutationStats {
    #[serde(rename(deserialize = "blocks-affected", serialize = "blocksAffected"))]
    pub blocks_affected: u32,
    #[serde(rename(deserialize = "blocks-total", serialize = "blocksTotal"))]
    pub blocks_total: u32,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct TripleDelta {
    pub deleted: i64,
    pub inserted: i64,
    pub total: i64,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct ExecuteOperationError {
    #[serde(flatten)]
    base: LSPErrorBase,
    data: ExecuteOperationErrorData,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum ExecuteOperationErrorData {
    QLeverException(QLeverException),
    Connection(ConnectionError),
    Http(HttpError),
    Canceled(CanceledError),
    InvalidFormat { query: String, message: String },
    Deserialization { query: String, message: String },
    Unknown,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct CanceledError {
    pub query: String,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct QLeverException {
    pub exception: String,
    pub query: String,
    pub status: QLeverStatus,
    pub metadata: Option<Metadata>,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Metadata {
    line: u32,
    position_in_line: u32,
    start_index: u32,
    stop_index: u32,
}

#[derive(Debug, Serialize, Deserialize)]
pub enum QLeverStatus {
    #[serde(rename = "ERROR")]
    Error,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[cfg(target_arch = "wasm32")]
pub struct PartialSparqlResultNotification {
    #[serde(flatten)]
    pub base: NotificationMessageBase,
    pub params: PartialResult,
}

#[cfg(target_arch = "wasm32")]
impl PartialSparqlResultNotification {
    pub(crate) fn new(chunk: PartialResult) -> Self {
        use lazy_sparql_result_reader::parser::PartialResult;

        Self {
            base: NotificationMessageBase::new("qlueLs/partialResult"),
            params: PartialResult::from(chunk),
        }
    }
}

#[cfg(target_arch = "wasm32")]
impl LspMessage for PartialSparqlResultNotification {}

#[cfg(test)]
mod test {
    use crate::server::lsp::{
        ExecuteOperationErrorData, ExecuteOperationParams, ExecuteOperationSource,
        ExecuteUpdateResponseResult, Metadata, QLeverException, QLeverStatus,
    };

    #[test]
    fn deserialize_execute_params_with_text_document() {
        let message = r#"{
            "textDocument": { "uri": "file:///tab-161.rq" },
            "queryId": "de9aa904-9640-43c0-9d88-1d063cc7cea0",
            "accessToken": "UdKTWNFUoLm9POa8m7a5jvhjVrq7tYqU",
            "maxResultSize": 100,
            "resultOffset": 0,
            "lazy": true
        }"#;
        let params: ExecuteOperationParams = serde_json::from_str(message).unwrap();
        let ExecuteOperationSource::Document { text_document } = params.source else {
            panic!("expected Document source");
        };
        assert_eq!(text_document.uri, "file:///tab-161.rq");
        assert_eq!(params.max_result_size, Some(100));
        assert_eq!(params.lazy, Some(true));
    }

    #[test]
    fn deserialize_execute_params_with_inline_query() {
        let message = r#"{
            "query": "SELECT * WHERE { ?s ?p ?o }",
            "maxResultSize": 50
        }"#;
        let params: ExecuteOperationParams = serde_json::from_str(message).unwrap();
        let ExecuteOperationSource::Inline { query } = params.source else {
            panic!("expected Inline source");
        };
        assert_eq!(query, "SELECT * WHERE { ?s ?p ?o }");
        assert_eq!(params.max_result_size, Some(50));
    }

    #[test]
    fn serialize_execute_query_error() {
        let error = ExecuteOperationErrorData::QLeverException(QLeverException {
            exception: "foo".to_string(),
            query: "bar".to_string(),
            metadata: Some(Metadata {
                line: 0,
                position_in_line: 0,
                start_index: 0,
                stop_index: 0,
            }),
            status: QLeverStatus::Error,
        });
        let serialized = serde_json::to_string(&error).unwrap();
        assert_eq!(
            serialized,
            r#"{"type":"QLeverException","exception":"foo","query":"bar","status":"ERROR","metadata":{"line":0,"positionInLine":0,"startIndex":0,"stopIndex":0}}"#
        )
    }

    #[test]
    fn deserialize_update_result() {
        let message = r#"{
    "operations": [
        {
            "delta-triples": {
                "after": {
                    "deleted": 0,
                    "inserted": 1,
                    "total": 1
                },
                "before": {
                    "deleted": 0,
                    "inserted": 1,
                    "total": 1
                },
                "difference": {
                    "deleted": 0,
                    "inserted": 0,
                    "total": 0
                },
                "operation": {
                    "deleted": 0,
                    "inserted": 1,
                    "total": 1
                }
            },
            "located-triples": {
                "OPS": {
                    "blocks-affected": 1,
                    "blocks-total": 0
                },
                "OSP": {
                    "blocks-affected": 1,
                    "blocks-total": 0
                },
                "POS": {
                    "blocks-affected": 1,
                    "blocks-total": 0
                },
                "PSO": {
                    "blocks-affected": 1,
                    "blocks-total": 0
                },
                "SOP": {
                    "blocks-affected": 1,
                    "blocks-total": 0
                },
                "SPO": {
                    "blocks-affected": 1,
                    "blocks-total": 0
                }
            },
            "status": "OK",
            "time": {
                "execution": {
                    "clearCache": 0,
                    "computeIds": {
                        "deduplication": 0,
                        "resultInterpolation": 0,
                        "total": 0,
                        "vocabLookup": 0
                    },
                    "deleteTriples": 0,
                    "evaluateWhere": 0,
                    "insertTriples": {
                        "externalPermutation": {
                            "locatedAndAdd": {
                                "OPS": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "OSP": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "POS": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "PSO": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "SOP": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "SPO": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "total": 0,
                                "transformHandles": 0
                            },
                            "markTriples": 0,
                            "removeExistingTriples": 0,
                            "removeInverseTriples": 0,
                            "rewriteLocalVocabEntries": 0,
                            "total": 0
                        },
                        "internalPermutation": {
                            "locatedAndAdd": {
                                "POS": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "PSO": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "total": 0,
                                "transformHandles": 0
                            },
                            "markTriples": 0,
                            "removeExistingTriples": 0,
                            "removeInverseTriples": 0,
                            "rewriteLocalVocabEntries": 0,
                            "total": 0
                        },
                        "makeInternalTriples": 0,
                        "total": 0
                    },
                    "total": 0
                },
                "planning": 0,
                "total": 0,
                "updateMetadata": 0
            },
            "update": "INSERT DATA {\n  <a> <b> <b>\n}",
            "warnings": [
                "SPARQL 1.1 Update for QLever is experimental."
            ]
        }
    ],
    "time": {
        "total": 1,
        "parsing": 0,
        "waitingForUpdateThread": 0,
        "acquiringDeltaTriplesWriteLock": 0,
        "operations": 1,
        "metadataUpdateForSnapshot": 0,
        "diskWriteback": 0,
        "snapshotCreation": 0
    }
}"#;
        let _x: ExecuteUpdateResponseResult = serde_json::from_str(message).unwrap();
    }

    #[test]
    fn deserialize_update_result_delete_where() {
        // INFO: For a DELETE WHERE the shapes of `deleteTriples` and
        // `insertTriples` are flipped vs an INSERT: the detailed breakdown
        // shows up under `deleteTriples`, while `insertTriples` is a plain `0`.
        let message = r#"{
    "operations": [
        {
            "delta-triples": {
                "after": {
                    "deleted": 3,
                    "inserted": 1,
                    "total": 4
                },
                "before": {
                    "deleted": 2,
                    "inserted": 2,
                    "total": 4
                },
                "difference": {
                    "deleted": 1,
                    "inserted": -1,
                    "total": 0
                },
                "operation": {
                    "deleted": 1,
                    "inserted": 0,
                    "total": 1
                }
            },
            "located-triples": {
                "OPS": {
                    "blocks-affected": 1,
                    "blocks-total": 0
                },
                "OSP": {
                    "blocks-affected": 1,
                    "blocks-total": 0
                },
                "POS": {
                    "blocks-affected": 1,
                    "blocks-total": 0
                },
                "PSO": {
                    "blocks-affected": 1,
                    "blocks-total": 0
                },
                "SOP": {
                    "blocks-affected": 1,
                    "blocks-total": 0
                },
                "SPO": {
                    "blocks-affected": 1,
                    "blocks-total": 0
                }
            },
            "status": "OK",
            "time": {
                "execution": {
                    "clearCache": 0,
                    "computeIds": {
                        "deduplication": 0,
                        "resultInterpolation": 0,
                        "total": 0,
                        "vocabLookup": 0
                    },
                    "deleteTriples": {
                        "externalPermutation": {
                            "locatedAndAdd": {
                                "OPS": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "OSP": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "POS": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "PSO": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "SOP": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "SPO": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "total": 0,
                                "transformHandles": 0
                            },
                            "markTriples": 0,
                            "removeExistingTriples": 0,
                            "removeInverseTriples": 0,
                            "rewriteLocalVocabEntries": 0,
                            "total": 0
                        },
                        "internalPermutation": {
                            "locatedAndAdd": {
                                "POS": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "PSO": {
                                    "addToLocatedTriples": {
                                        "adding": 0,
                                        "total": 0
                                    },
                                    "locateTriples": 0,
                                    "total": 0
                                },
                                "total": 0,
                                "transformHandles": 0
                            },
                            "markTriples": 0,
                            "removeExistingTriples": 0,
                            "removeInverseTriples": 0,
                            "rewriteLocalVocabEntries": 0,
                            "total": 0
                        },
                        "makeInternalTriples": 0,
                        "total": 0
                    },
                    "evaluateWhere": 0,
                    "insertTriples": 0,
                    "total": 0
                },
                "planning": 0,
                "total": 0,
                "updateMetadata": 0
            },
            "update": "DELETE WHERE {\n  <a> ?p ?o\n}",
            "warnings": [
                "SPARQL 1.1 Update for QLever is experimental."
            ]
        }
    ],
    "time": {
        "total": 1,
        "parsing": 0,
        "waitingForUpdateThread": 0,
        "acquiringDeltaTriplesWriteLock": 0,
        "operations": 1,
        "metadataUpdateForSnapshot": 0,
        "diskWriteback": 0,
        "snapshotCreation": 0
    }
}"#;
        let _x: ExecuteUpdateResponseResult = serde_json::from_str(message).unwrap();
    }
}