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
//! Expand annotation shorthand to explicit RDF-star triples and serialize
use ;
/// Expand an `AnnotatedTriple` into explicit RDF-star triples.
///
/// Returns one entry per annotation pair, each being:
/// `(QuotedTriple(base), annotation_predicate, annotation_object)`.
///
/// That is, for:
/// ```text
/// <s> <p> <o> {| <ap1> <ao1> ; <ap2> <ao2> |}
/// ```
/// This returns:
/// ```text
/// [
/// (StarTerm::QuotedTriple(<< <s> <p> <o> >>), "<ap1>", AnnotationValue::NamedNode("<ao1>")),
/// (StarTerm::QuotedTriple(<< <s> <p> <o> >>), "<ap2>", AnnotationValue::NamedNode("<ao2>")),
/// ]
/// ```
/// Serialize an `AnnotatedTriple` back to canonical Turtle-star using the
/// `{| ... |}` shorthand form.
/// Serialize an `AnnotatedTriple` to explicit `<< ... >> pred obj .` form
/// (no `{| ... |}` shorthand).
/// Convenience: convert an `AnnotatedTriple` whose base is a quoted triple.
///
/// Given a quoted-triple subject of the form `<< s p o >>`, reconstructs a
/// synthetic `RdfStarTriple` for serialization.