File: wire-format

package info (click to toggle)
4store 1.1.6+20151109-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid, stretch
  • size: 82,388 kB
  • sloc: ansic: 65,689; sh: 2,916; perl: 2,245; makefile: 281; python: 213
file content (234 lines) | stat: -rw-r--r-- 4,157 bytes parent folder | download
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
NB. Warning, the protocol documentation is not entirely up to date
with the current state of 4store.


Open questions:

* Do we need to handle multiplexing here?

* What errors can reasonably be sent over the wire?

* How are URIs and Literals represented on the wire?

* Do we need a "which segments are on this cluster member?" message?

Message structure

byte
 0- 2  'I' 'D' 0x80 version magic
 3     message type
 4- 7  length of message in bytes, not including this header
 8-11  segment address
  ..   padding
16-    message contents


0x01 FS_NO_OP

(no message contents, length zero)
This operation always succeeds.

0x02 FS_DONE_OK

(no message contents, length zero)

0x03 FS_ERROR

(contents of error messages to be defined later)

0x04 FS_RESOLVE

 0-   64-bit rids

Contents are rids, eight octets per rid. It is an error for there to
be no rids, or partial rids (length not a multiple of 8)

0x05 FS_RESOURCE_LIST

One or more records of the form....

byte
 0- 7  64-bit rid
 8-11  32-bit unsigned offset of next such record
12-    resource string incl/ terminating NUL

0x06 FS_INSERT_RESOURCE

byte
 0- 3  32-bit count of resources
 4- 7  padding

then count records of the form...

byte
 0- 7  64-bit rid
 8-15  64-bit DT/lang rid for resource
16-19  32-bit unsigned offset of next such record
20-    resource string incl/ terminating NUL


0x07 FS_INSERT_TRIPLE

 0- 3  flags value
  ..   padding
 8-15  64-bit rid of model
16-    64-bit rids x 3 per triple


0x08 FS_DELETE_MODEL

 0- 7  64-bit rid of model

Content is a single resource hash, eight octets. Any other length is
an error.

0x09 FS_BIND

byte
 0- 3  query-flags value
 4- 7  count of model rids
 8-11  count of subject rids
12-15  count of predicate rids
16-19  count of object rids
  ..   padding
24-    64-bit rids

Total of the four counts should be appropriate for length of data

0x0A FS_BIND_LIST

 0-    64-bit rids

Contents are Nv resource hashes, where N varies and v is the number of
bindings required by the query flags. If matching triples were found but
no bindings are required the message has no contents and its length is
zero. If nothing is found see the next message type..

0x0B FS_NO_MATCH

(no message contents, length zero)

0x0C FS_PRICE_BIND

(see FS_BIND)

0x0D FS_ESTIMATED_ROWS

byte
 0- 7  count of rows

0x0E FS_SEGMENTS

(no message contents, length zero)

0x0F FS_SEGMENT_LIST

byte
 0-    segment numbers

0x10 FS_COMMIT_TRIPLE

byte
 0- 3  flags value

A single 32-bit flag value only is to be sent

0x11 FS_COMMIT_RESOURCE

(no message contents, length zero)

0x12 FS_START_IMPORT

(no message contents, length zero)

0x13 FS_STOP_IMPORT

(no message contents, length zero)

0x14 FS_GET_SIZE

(no message contents, length zero)

0x15 FS_SIZE

byte
 0- 7  count of subject quads
 8-15  count of object quads
16-23  count of resources
24-31  count of subject models (distinct)
32-39  count of object models (distinct)

0x16 FS_GET_IMPORT_TIMES

(no message contents, length zero)

0x17 FS_IMPORT_TIMES

byte
 0-    opaque query statistics structure

0x18 FS_INSERT_QUAD

 0- 3  flags value
  ..   padding
 8-    64-bit rids x 4 per triple

0x19 FS_COMMIT_QUAD

byte
 0- 3  flags value

A single 32-bit flag value only is to be sent

0x1A FS_GET_QUERY_TIMES

(no message contents, length zero)

0x1B FS_QUERY_TIMES

byte
 0-    opaque query statistics structure

0x1C FS_BIND_LIMIT

byte
 0- 3  query-flags value
 4- 7  offset of query
 8-11  limit of query
12-15  count of model rids
16-19  count of subject rids
20-23  count of predicate rids
24-27  count of object rids
  ..   padding
32-    64-bit rids

0x1D FS_BNODE_ALLOC

byte
 0- 3  count

0x1E FS_BNODE_RANGE

byte
 0- 7  start of bnode rids
 8-15  end of bnode rids

0x1F FS_RESOLVE_ATTR

 0-   64-bit rids

Contents are rids, eight octets per rid. It is an error for there to
be no rids, or partial rids (length not a multiple of 8)

0x20 FS_RESOURCE_ATTR_LIST

One or more records of the form....

byte
 0- 7  64-bit rid
 8-15  64-bit DT/lang rid for resource
16-19  32-bit unsigned offset of next such record
20-    resource string incl/ terminating NUL

0x21 FS_RESERVED ...