Protocol Documentation
Table of Contents
-
- RdfColumn
- RdfColumnBatch
- RdfDatatypeEntry
- RdfDefaultGraph
- RdfGraphEnd
- RdfGraphStart
- RdfIri
- RdfLiteral
- RdfLookupEntryPacked
- RdfNameEntry
- RdfNamespaceDeclaration
- RdfPrefixEntry
- RdfQuad
- RdfStreamFrame
- RdfStreamFrame.MetadataEntry
- RdfStreamOptions
- RdfStreamRow
- RdfTriple
- PhysicalStreamType
- RdfBaseDirection
- RdfStreamType
- RdfVersion
grpc.proto
RdfStreamReceived
Acknowledgement of receiving a stream sent by the server to the client.
RdfStreamSubscribe
Subscribe command sent by the client to the server.
| Field | Type | Label | Description |
|---|---|---|---|
| topic | string | The topic to which the client wants to subscribe (UTF-8 encoded). | |
| requested_options | RdfStreamOptions | Optional: the stream options requested by the client. The server should respond with a stream that matches these options. In case that is not possible, the server must respond with the INVALID_ARGUMENT error. |
RdfStreamService
Pub/Sub service for RDF streams, to be implemented by the server.
| Method Name | Request Type | Response Type | Description |
|---|---|---|---|
| SubscribeRdf | RdfStreamSubscribe | RdfStreamFrame stream | Subscribe to an RDF stream. |
| PublishRdf | RdfStreamFrame stream | RdfStreamReceived | Publish an RDF stream. In case the server cannot process the stream, it must respond with the INVALID_ARGUMENT error. |
patch.proto
RdfPatchFrame
A batch of RDF patch rows.
| Field | Type | Label | Description |
|---|---|---|---|
| rows | RdfPatchRow | repeated | Patch rows |
RdfPatchHeader
Metadata header for RDF Patch. Header rows must occur at the start of the patch frame.
| Field | Type | Label | Description |
|---|---|---|---|
| key | string | Header key (required) | |
| h_iri | eu.ostrzyciel.jelly.core.proto.v1.RdfIri | IRI | |
| h_bnode | string | Blank node | |
| h_literal | eu.ostrzyciel.jelly.core.proto.v1.RdfLiteral | Literal | |
| h_triple_term | eu.ostrzyciel.jelly.core.proto.v1.RdfTriple | RDF-star quoted triple |
RdfPatchNamespace
| Field | Type | Label | Description |
|---|---|---|---|
| name | string | Short name of the namespace (e.g., "ex") Do NOT include the colon. | |
| value | eu.ostrzyciel.jelly.core.proto.v1.RdfIri | IRI of the namespace (e.g., "http://example.org/")..) Optional in the "prefix delete" (PD) operation, but required in the "prefix add" (PA) operation. | |
| g_iri | eu.ostrzyciel.jelly.core.proto.v1.RdfIri | IRI | |
| g_bnode | string | Blank node | |
| g_default_graph | eu.ostrzyciel.jelly.core.proto.v1.RdfDefaultGraph | Default graph | |
| g_literal | eu.ostrzyciel.jelly.core.proto.v1.RdfLiteral | Literal – only valid for generalized RDF streams |
RdfPatchOptions
RDF Patch stream options
| Field | Type | Label | Description |
|---|---|---|---|
| statement_type | PatchStatementType | Type of statements in the stream (required) | |
| stream_type | PatchStreamType | Type of the stream (required) | |
| generalized_statements | bool | Whether the stream may contain generalized triples, quads, or datasets | |
| rdf_star | bool | Whether the stream may contain RDF-star statements | |
| max_name_table_size | uint32 | Maximum size of the name lookup table (required, must be >= 8) | |
| max_prefix_table_size | uint32 | Maximum size of the prefix lookup table (required if the prefix lookup is used) | |
| max_datatype_table_size | uint32 | Maximum size of the datatype lookup table (required if datatype literals are used) | |
| version | uint32 | Protocol version (required) For Jelly-Patch 1.0.x (based on Jelly-RDF 1.1.x), the value must be 1. For custom extensions, the value must be 10000 or higher. |
RdfPatchPunctuation
RdfPatchRow
A row in an RDF Patch stream
| Field | Type | Label | Description |
|---|---|---|---|
| options | RdfPatchOptions | Stream options. Must be the first row in the stream. | |
| statement_add | eu.ostrzyciel.jelly.core.proto.v1.RdfQuad | Add a triple/quad statement (A) | |
| statement_delete | eu.ostrzyciel.jelly.core.proto.v1.RdfQuad | Delete a triple/quad statement (D) | |
| namespace_add | RdfPatchNamespace | Add a namespace/prefix declaration (PA) | |
| namespace_delete | RdfPatchNamespace | Delete a namespace/prefix declaration (PD) | |
| transaction_start | RdfPatchTransactionStart | Transaction start (TX) | |
| transaction_commit | RdfPatchTransactionCommit | Transaction commit (TC) | |
| transaction_abort | RdfPatchTransactionAbort | Transaction abort (TA) | |
| name | eu.ostrzyciel.jelly.core.proto.v1.RdfNameEntry | Entry in the name lookup table. | |
| prefix | eu.ostrzyciel.jelly.core.proto.v1.RdfPrefixEntry | Entry in the prefix lookup table. | |
| datatype | eu.ostrzyciel.jelly.core.proto.v1.RdfDatatypeEntry | Entry in the datatype lookup table. | |
| header | RdfPatchHeader | Header entry (H) | |
| punctuation | RdfPatchPunctuation | Punctuation mark, only used in stream type PUNCTUATED Indicates the end of a patch. |
RdfPatchTransactionAbort
RdfPatchTransactionCommit
RdfPatchTransactionStart
PatchStatementType
Type of statements in the stream. This determines whether the statements are interpreted as triples or quads.
| Name | Number | Description |
|---|---|---|
| PATCH_STATEMENT_TYPE_UNSPECIFIED | 0 | Unspecified stream type – invalid |
| PATCH_STATEMENT_TYPE_TRIPLES | 1 | RDF triples |
| PATCH_STATEMENT_TYPE_QUADS | 2 | RDF quads |
PatchStreamType
Type of the stream. This determines whether each RdfPatchFrame is a complete patch by itself, or part of a larger patch.
| Name | Number | Description |
|---|---|---|
| PATCH_STREAM_TYPE_UNSPECIFIED | 0 | Unspecified stream type – invalid |
| PATCH_STREAM_TYPE_FRAME | 1 | Each RdfPatchFrame is a complete patch. In this case, transactions cannot span multiple frames. |
| PATCH_STREAM_TYPE_FLAT | 2 | Entire stream is a single patch. Transactions may span multiple frames. |
| PATCH_STREAM_TYPE_PUNCTUATED | 3 | Stream contains multiple patches separated by punctuation marks. Patches and transactions may span multiple frames. Each frame must contain at most one patch. |
rdf.proto
RdfColumn
Column of RDF terms: the cells of one statement position (Jelly-RDF) or one variable (Jelly-SPARQL) across all rows of a batch, in row order. A cell is either an RDF term or unbound.
Each run of consecutive equal terms is stored once, as a run value, and
unbound cells are not stored. The run values are split by type into
separate lists. kinds gives the type of each run value, and layouts
gives the runs of repeated values and of unbound cells.
Used by the column layout and by Jelly-SPARQL.
| Field | Type | Label | Description |
|---|---|---|---|
| kinds | bytes | Type of each run value, 2 bits per value, four values per byte, starting from the least significant bits: 0 = IRI, 1 = literal, 2 = blank node, 3 = triple term. Should be empty if all run values are of one type. | |
| layouts | uint32 | repeated | Sequence layout: where the run values repeat, and where the unbound cells are. Each entry is a token (skip << 5) |
| name_ids | uint32 | repeated | Name identifiers of the IRIs, in row order. 0 means "previous name_id + 1", or 1 in the first IRI of the column. |
| prefix_ids | uint32 | repeated | Prefix identifiers of the IRIs: none (no prefix), one (the same prefix for all IRIs), or one per IRI. 0 means "the same prefix as the previous IRI", or no prefix in the first IRI of the column. |
| lex_values | string | repeated | Lexical forms of the literals, in row order. |
| literal_kinds | uint32 | repeated | Literal kinds of the literals: none (all are simple literals), one (the same kind for all literals), or one per literal. 0 – simple literal (xsd:string) odd v – literal with the datatype (v + 1) / 2 of the datatype lookup even v > 0 – language-tagged string with the language tag langtags[v / 2 - 1] |
| langtags | string | repeated | Language tags referred to by literal_kinds. |
| langtag_directions | uint32 | repeated | Base directions of the language tags (RdfBaseDirection values), parallel to langtags. Empty means no base direction for any tag. |
| bnodes | string | repeated | Labels of the blank nodes, in row order. |
| triple_terms | RdfTripleTerm | repeated | Triple terms, in row order. The IRIs inside the triple terms are inferred separately from name_ids and prefix_ids. |
RdfColumnBatch
The contents of a frame in the column layout: a batch of statements, and the lookup entries and namespace declarations they need.
Each statement is made up of the cells at the same position in the subjects, predicates, objects, and graphs columns.
| Field | Type | Label | Description |
|---|---|---|---|
| row_count | uint32 | Number of statements in the batch. At most 2^27 - 1. | |
| names | RdfLookupEntryPacked | repeated | Entries of the name lookup table. |
| prefixes | RdfLookupEntryPacked | repeated | Entries of the prefix lookup table. Note: the prefixes in the lookup table can be arbitrary strings, and are NOT meant to be user-facing. They are only used for IRI compression. To transmit user-facing namespace declarations, use namespaces. |
| datatypes | RdfLookupEntryPacked | repeated | Entries of the datatype lookup table. |
| namespaces | RdfNamespaceDeclaration | repeated | Namespace declarations. |
| subjects | RdfColumn | Subjects: IRIs or blank nodes. No cell may be unbound. | |
| predicates | RdfColumn | Predicates: IRIs. No cell may be unbound. | |
| objects | RdfColumn | Objects: IRIs, blank nodes, literals, or triple terms. No cell may be unbound. | |
| graphs | RdfColumn | Graph names: IRIs or blank nodes. An unbound cell is the default graph. Only valid if the physical type is QUADS. If not set, all statements of the batch are in the default graph. | |
| message_lengths | uint32 | repeated | Message boundaries: each value adds that many more statements to the current RDF Message, and then ends it. Only valid in streams of type RDF_STREAM_TYPE_MESSAGES. |
RdfDatatypeEntry
Entry in the datatype lookup table
Not used in the column layout.
| Field | Type | Label | Description |
|---|---|---|---|
| id | uint32 | 1-based identifier If id=0, it should be interpreted as previous_id + 1. If id=0 appears in the first RdfDatatypeEntry of the stream, it should be interpreted as 1. | |
| value | string | Value of the datatype (UTF-8 encoded) |
RdfDefaultGraph
Empty message indicating the default RDF graph.
Not used in the column layout.
RdfGraphEnd
End of a graph in a GRAPHS stream
Not used in the column layout.
RdfGraphStart
Start of a graph in a GRAPHS stream
In contrast to RdfQuad, setting the graph oneof to some value is always required. No repeated terms are allowed.
Not used in the column layout.
| Field | Type | Label | Description |
|---|---|---|---|
| g_iri | RdfIri | IRI | |
| g_bnode | string | Blank node | |
| g_default_graph | RdfDefaultGraph | Default graph | |
| g_literal | RdfLiteral | Literal – only valid for generalized RDF streams |
RdfIri
RDF IRI, encoded as a prefix and a name from the lookup tables. The IRI is the prefix followed by the name.
| Field | Type | Label | Description |
|---|---|---|---|
| prefix_id | uint32 | 1-based identifier of the prefix in the prefix lookup. 0 means "the same prefix as in the previous IRI", or no prefix in the first IRI. Which IRI is the previous one depends on the layout. | |
| name_id | uint32 | 1-based identifier of the name in the name lookup. 0 means "the name_id of the previous IRI + 1", or 1 in the first IRI. |
RdfLiteral
RDF literal
| Field | Type | Label | Description |
|---|---|---|---|
| lex | string | The lexical form of the literal. | |
| langtag | string | Language tag of a language-tagged string. | |
| datatype | uint32 | 1-based identifier of the datatype in the datatype lookup. 0 is invalid (in contrast to prefix_id and name_id in RdfIri). If column layout: must not refer to rdf:langString or rdf:dirLangString. | |
| direction | RdfBaseDirection | Base direction of a language-tagged string (RDF 1.2). If column layout: may be set only if langtag is set. If row layout: must not be set. |
RdfLookupEntryPacked
Packed entries of a lookup table (name, prefix, or datatype): the values of a run of consecutive identifiers.
Used by the column layout and by Jelly-SPARQL.
| Field | Type | Label | Description |
|---|---|---|---|
| id | uint32 | 1-based identifier of the first value. 0 means "the identifier after the last value of the previous entry of the same lookup table", or 1 in the first entry of the table. | |
| values | string | repeated | Values of the entries (UTF-8 encoded), for consecutive identifiers starting at id. |
RdfNameEntry
Entry in the name lookup table
Not used in the column layout.
| Field | Type | Label | Description |
|---|---|---|---|
| id | uint32 | 1-based identifier If id=0, it should be interpreted as previous_id + 1. If id=0 appears in the first RdfNameEntry of the stream, it should be interpreted as 1. | |
| value | string | Value of the name (UTF-8 encoded) |
RdfNamespaceDeclaration
Explicit namespace declaration
This is a hint to the consumer that the given IRI (namespace) may be associated with a short name, like in Turtle syntax: PREFIX ex: <http://example.org/>
This is a purely cosmetic feature, not part of the RDF data. It has nothing in common with the prefix lookup table. A declaration stays in effect until the same name is declared again.
| Field | Type | Label | Description |
|---|---|---|---|
| name | string | Short name of the namespace (e.g., "ex") Do NOT include the colon. | |
| value | RdfIri | IRI of the namespace (e.g., "http://example.org/")) |
RdfPrefixEntry
Entry in the prefix lookup table
Note: the prefixes in the lookup table can be arbitrary strings, and are NOT meant to be user-facing. They are only used for IRI compression. To transmit user-facing namespace declarations for cosmetic purposes, use RdfNamespaceDeclaration.
Not used in the column layout.
| Field | Type | Label | Description |
|---|---|---|---|
| id | uint32 | 1-based identifier If id=0, it should be interpreted as previous_id + 1. If id=0 appears in the first RdfPrefixEntry of the stream, it should be interpreted as 1. | |
| value | string | Value of the prefix (UTF-8 encoded) |
RdfQuad
RDF quad
Fields 1–12 are repeated from RdfTriple for performance reasons.
Similarly to RdfTriple, this message allows for representing generalized RDF quads (for example, with literals as predicates). Whether this is used in the stream is determined by the stream options (see RdfStreamOptions).
If no field in a given oneof is set, the term is interpreted as a repeated term – the same as the term in the same position in the previous quad. In the first quad of the stream, all terms must be set.
Not used in the column layout.
| Field | Type | Label | Description |
|---|---|---|---|
| s_iri | RdfIri | IRI | |
| s_bnode | string | Blank node | |
| s_literal | RdfLiteral | Literal Only valid in a generalized RDF stream. | |
| s_triple_term | RdfTriple | RDF-star quoted triple | |
| p_iri | RdfIri | IRI | |
| p_bnode | string | Blank node Only valid in a generalized RDF stream. | |
| p_literal | RdfLiteral | Literal Only valid in a generalized RDF stream. | |
| p_triple_term | RdfTriple | RDF-star quoted triple | |
| o_iri | RdfIri | IRI | |
| o_bnode | string | Blank node | |
| o_literal | RdfLiteral | Literal | |
| o_triple_term | RdfTriple | RDF-star quoted triple | |
| g_iri | RdfIri | IRI | |
| g_bnode | string | Blank node | |
| g_default_graph | RdfDefaultGraph | Default graph | |
| g_literal | RdfLiteral | Literal – only valid for generalized RDF streams |
RdfStreamFrame
RDF stream frame – base message for RDF streams.
| Field | Type | Label | Description |
|---|---|---|---|
| rows | RdfStreamRow | repeated | Stream rows. If row layout: the contents of the frame. If column layout: either empty, or exactly one row with the stream options. |
| columns | RdfColumnBatch | If column layout: the contents of the frame. If row layout: must not be set. | |
| metadata | RdfStreamFrame.MetadataEntry | repeated | Arbitrary metadata The keys are UTF-8 encoded strings, the values are byte arrays. This may be used by implementations in any way they see fit. The metadata does not affect the RDF data in any way, treat it as comments in a text file. |
RdfStreamFrame.MetadataEntry
| Field | Type | Label | Description |
|---|---|---|---|
| key | string | ||
| value | bytes |
RdfStreamOptions
RDF stream options
If row layout: the options may occur again later in the stream, but must be identical to the first occurrence. If column layout: a later frame may restate the options, which empties the lookup tables. This makes streams concatenable. physical_type, stream_type, and version must stay the same.
| Field | Type | Label | Description |
|---|---|---|---|
| stream_name | string | Name of the stream (completely optional). This may be used for, e.g., topic names in a pub/sub system. | |
| physical_type | PhysicalStreamType | Type of the stream (required). If row layout: TRIPLES, QUADS, or GRAPHS. If column layout: TRIPLES or QUADS. | |
| generalized_statements | bool | If row layout: whether the stream may contain generalized triples, quads, or datasets. If column layout: must not be set. | |
| rdf_star | bool | If row layout: whether the stream may contain RDF-star statements. If column layout: must not be set – use rdf_version instead. | |
| stream_type | RdfStreamType | If column layout: whether the stream is one RDF graph or dataset, or a stream of RDF Messages. Defaults to RDF_STREAM_TYPE_FLAT. If row layout: must not be set. | |
| rdf_version | RdfVersion | If column layout: version of RDF whose terms may occur in the stream. Unspecified (the default) means that no version is announced, and the stream may contain any RDF 1.2 term. If row layout: must not be set. | |
| max_name_table_size | uint32 | Maximum size of the name lookup table (required). If row layout: must be >= 8. If column layout: must be >= 128. | |
| max_prefix_table_size | uint32 | Maximum size of the prefix lookup table (required if the prefix lookup is used) | |
| max_datatype_table_size | uint32 | Maximum size of the datatype lookup table (required if datatype literals are used) | |
| logical_type | LogicalStreamType | If row layout: logical (RDF-STaX-based) stream type. In contrast to the physical type, this field is entirely optional. If column layout: must not be set – use stream_type instead. | |
| version | uint32 | Protocol version (required) For Jelly-RDF 1.0.x the value must be 1 (row layout). For Jelly-RDF 1.1.x the value must be 2 (row layout). For Jelly-RDF 1.2.x the value must be 3 (column layout). For custom extensions, the value must be 10000 or higher. |
RdfStreamRow
RDF stream row
If row layout: one element of a frame.
If column layout: only the options field may be set.
| Field | Type | Label | Description |
|---|---|---|---|
| options | RdfStreamOptions | Stream options. Must occur at the start of the stream. | |
| triple | RdfTriple | RDF triple statement. Valid in streams of physical type TRIPLES or GRAPHS. | |
| quad | RdfQuad | RDF quad statement. Only valid in streams of physical type QUADS. | |
| graph_start | RdfGraphStart | Graph boundary: ends the currently transmitted graph and starts a new one Only valid in streams of physical type GRAPHS. | |
| graph_end | RdfGraphEnd | Explicit end of a graph. Signals the consumer that the transmitted graph is complete. Only valid in streams of physical type GRAPHS. | |
| namespace | RdfNamespaceDeclaration | Explicit namespace declaration. | |
| name | RdfNameEntry | Entry in the name lookup table. | |
| prefix | RdfPrefixEntry | Entry in the prefix lookup table. | |
| datatype | RdfDatatypeEntry | Entry in the datatype lookup table. |
RdfTriple
RDF triple
For each term (subject, predicate, object), the fields are repeated for performance reasons. This is to avoid the need for boxing each term in a separate message.
Note: this message allows for representing generalized RDF triples (for example, with literals as predicates). Whether this is used in the stream is determined by the stream options (see RdfStreamOptions).
If no field in a given oneof is set, the term is interpreted as a repeated term – the same as the term in the same position in the previous triple. In the first triple of the stream, all terms must be set. All terms must also be set in quoted triples (RDF-star).
Not used in the column layout.
| Field | Type | Label | Description |
|---|---|---|---|
| s_iri | RdfIri | IRI | |
| s_bnode | string | Blank node | |
| s_literal | RdfLiteral | Literal Only valid in a generalized RDF stream. | |
| s_triple_term | RdfTriple | RDF-star quoted triple | |
| p_iri | RdfIri | IRI | |
| p_bnode | string | Blank node Only valid in a generalized RDF stream. | |
| p_literal | RdfLiteral | Literal Only valid in a generalized RDF stream. | |
| p_triple_term | RdfTriple | RDF-star quoted triple | |
| o_iri | RdfIri | IRI | |
| o_bnode | string | Blank node | |
| o_literal | RdfLiteral | Literal | |
| o_triple_term | RdfTriple | RDF-star quoted triple |
RdfTripleTerm
RDF 1.2 triple term. All three positions must be set, and only the object may be a nested triple term. The field numbers are the same as in RdfTriple.
Used by the column layout and by Jelly-SPARQL.
| Field | Type | Label | Description |
|---|---|---|---|
| s_iri | RdfIri | IRI | |
| s_bnode | string | Blank node | |
| p_iri | RdfIri | Predicate | |
| o_iri | RdfIri | IRI | |
| o_bnode | string | Blank node | |
| o_literal | RdfLiteral | Literal | |
| o_triple_term | RdfTripleTerm | Nested triple term |
LogicalStreamType
Logical stream type, according to the RDF Stream Taxonomy (RDF-STaX). If column layout: not used – use RdfStreamType instead.
Type 0 is reserved for the unspecified stream type. The rest of the type numbers follow the taxonomical structure of RDF-STaX. For example: 1 is a subtype of 0, 13 and 23 are subtypes of 3, 114 is a subtype of 14, etc.
Types 1–4 correspond to the four base concrete stream types. Their subtypes can be in most cases simply processed in the same way as the base types. Therefore, implementations can take the modulo 10 of the stream type to determine the base type of the stream and use this information to select the appropriate processing logic.
RDF-STaX version: 1.1.2 https://w3id.org/stax/1.1.2
Not used in the column layout.
| Name | Number | Description |
|---|---|---|
| LOGICAL_STREAM_TYPE_UNSPECIFIED | 0 | Unspecified stream type – invalid |
| LOGICAL_STREAM_TYPE_FLAT_TRIPLES | 1 | Flat RDF triple stream https://w3id.org/stax/ontology#flatTripleStream |
| LOGICAL_STREAM_TYPE_FLAT_QUADS | 2 | Flat RDF quad stream https://w3id.org/stax/ontology#flatQuadStream |
| LOGICAL_STREAM_TYPE_GRAPHS | 3 | RDF graph stream https://w3id.org/stax/ontology#graphStream |
| LOGICAL_STREAM_TYPE_DATASETS | 4 | RDF dataset stream https://w3id.org/stax/ontology#datasetStream |
| LOGICAL_STREAM_TYPE_SUBJECT_GRAPHS | 13 | RDF subject graph stream (subtype of RDF graph stream) https://w3id.org/stax/ontology#subjectGraphStream |
| LOGICAL_STREAM_TYPE_NAMED_GRAPHS | 14 | RDF named graph stream (subtype of RDF dataset stream) https://w3id.org/stax/ontology#namedGraphStream |
| LOGICAL_STREAM_TYPE_TIMESTAMPED_NAMED_GRAPHS | 114 | RDF timestamped named graph stream (subtype of RDF dataset stream) https://w3id.org/stax/ontology#timestampedNamedGraphStream |
PhysicalStreamType
Physical stream type: whether the stream contains triples or quads.
| Name | Number | Description |
|---|---|---|
| PHYSICAL_STREAM_TYPE_UNSPECIFIED | 0 | Unspecified stream type – invalid |
| PHYSICAL_STREAM_TYPE_TRIPLES | 1 | RDF triples |
| PHYSICAL_STREAM_TYPE_QUADS | 2 | RDF quads |
| PHYSICAL_STREAM_TYPE_GRAPHS | 3 | RDF triples grouped in graphs. If column layout: invalid. |
RdfBaseDirection
Initial text direction of a language-tagged string (RDF 1.2).
| Name | Number | Description |
|---|---|---|
| RDF_BASE_DIRECTION_UNSPECIFIED | 0 | No base direction: an ordinary language-tagged string (rdf:langString). |
| RDF_BASE_DIRECTION_LTR | 1 | Left-to-right ("ltr"): a directional language-tagged string (rdf:dirLangString). |
| RDF_BASE_DIRECTION_RTL | 2 | Right-to-left ("rtl"): a directional language-tagged string (rdf:dirLangString). |
RdfStreamType
Type of an RDF stream. Not used in the row layout.
| Name | Number | Description |
|---|---|---|
| RDF_STREAM_TYPE_FLAT | 0 | The entire stream is one RDF graph (TRIPLES) or one RDF dataset (QUADS). This is the default. buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX |
| RDF_STREAM_TYPE_MESSAGES | 1 | The stream is a sequence of RDF Messages, each an RDF graph or dataset: https://w3c-cg.github.io/rsp/spec/messages The messages are delimited by RdfColumnBatch.message_lengths. |
RdfVersion
Version of RDF that a stream conforms to, following the version labels of RDF 1.2 Concepts: https://www.w3.org/TR/rdf12-concepts/#defined-version-labels
| Name | Number | Description |
|---|---|---|
| RDF_VERSION_UNSPECIFIED | 0 | Unspecified. Each format that uses this enum defines how to interpret it. |
| RDF_VERSION_1_1 | 1 | RDF 1.1 (version label "1.1"): no triple terms, no base directions. |
| RDF_VERSION_1_2_BASIC | 2 | RDF 1.2 Basic (version label "1.2-basic"): base directions are allowed, triple terms are not. |
| RDF_VERSION_1_2 | 3 | RDF 1.2 (version label "1.2"): base directions and triple terms are allowed. |
sparql.proto
SparqlAskResult
Boolean result of a SPARQL ASK query.
| Field | Type | Label | Description |
|---|---|---|---|
| value | bool | The boolean value of the result. |
SparqlResultsFrame
SPARQL results frame – base message of a SPARQL result stream. A frame contains a batch of rows (solutions).
| Field | Type | Label | Description |
|---|---|---|---|
| options | SparqlResultsOptions | Stream options. Must be set in the first frame of the stream. May be set again in a later frame, which empties the lookup tables. | |
| variables | string | repeated | Result set header: the names of the variables, in projection (SELECT clause) order, without the leading "?" or "$". Set in the first frame of a result set with a solution sequence, and in a frame that contains the options. |
| row_count | uint32 | Number of rows (solutions) in this frame. At most 2^27 - 1. | |
| names | eu.ostrzyciel.jelly.core.proto.v1.RdfLookupEntryPacked | repeated | Entries in the name lookup table. |
| prefixes | eu.ostrzyciel.jelly.core.proto.v1.RdfLookupEntryPacked | repeated | Entries in the prefix lookup table. Note: the prefixes in the lookup table can be arbitrary strings, and are NOT meant to be user-facing. They are only used for IRI compression. |
| datatypes | eu.ostrzyciel.jelly.core.proto.v1.RdfLookupEntryPacked | repeated | Entries in the datatype lookup table. |
| columns | eu.ostrzyciel.jelly.core.proto.v1.RdfColumn | repeated | Columns, one per variable, in the order of variables, or none. |
| ask_result | SparqlAskResult | Boolean (ASK) result. If set, the result set is a boolean result instead of a solution sequence. A boolean result is always the only frame of its result set. | |
| trailer | SparqlResultsTrailer | End-of-result-set marker. See SparqlResultsTrailer. | |
| metadata | SparqlResultsFrame.MetadataEntry | repeated | Arbitrary metadata The keys are UTF-8 encoded strings, the values are byte arrays. The metadata does not affect the result data in any way, treat it as comments in a text file. Well-known keys (their values must be valid UTF-8): link – zero or more IRIs separated by LF (U+000A), describing the result set as a whole (not the frame). Corresponds to head.link in the SPARQL Query Results JSON format. All other keys may be used by implementations in any way they see fit, and their values are arbitrary bytes. |
SparqlResultsFrame.MetadataEntry
| Field | Type | Label | Description |
|---|---|---|---|
| key | string | ||
| value | bytes |
SparqlResultsOptions
Stream options for SPARQL result streams.
| Field | Type | Label | Description |
|---|---|---|---|
| stream_name | string | Name of the stream (completely optional). This may be used for, e.g., topic names in a pub/sub system. | |
| stream_type | SparqlStreamType | Type of the stream: one result set, or a sequence of result sets. Defaults to SPARQL_STREAM_TYPE_FLAT. | |
| rdf_version | eu.ostrzyciel.jelly.core.proto.v1.RdfVersion | Version of RDF whose terms may occur in the stream. RDF_VERSION_1_1 – no triple terms, no base directions RDF_VERSION_1_2_BASIC – base directions, no triple terms RDF_VERSION_1_2 – base directions and triple terms Unspecified (the default) means that no version is announced: the stream may contain any RDF 1.2 term. | |
| max_name_table_size | uint32 | Maximum size of the name lookup table (required, must be >= 128) | |
| max_prefix_table_size | uint32 | Maximum size of the prefix lookup table (required if the prefix lookup is used) | |
| max_datatype_table_size | uint32 | Maximum size of the datatype lookup table (required if datatype literals are used) | |
| version | uint32 | Protocol version (required) For Jelly-SPARQL 1.0.x, the value must be 1. For custom extensions, the value must be 10000 or higher. |
SparqlResultsTrailer
End-of-result-set marker, saying whether the result set is complete. Producers must write it in the last frame of every result set, unless they cannot write anything more at all (for example, because the process died).
| Field | Type | Label | Description |
|---|---|---|---|
| error | string | Empty (the default) means the result set is complete. A non-empty value is a human-readable explanation of why the producer could not complete the result set (e.g., query failure mid-evaluation). |
SparqlStreamType
Type of a SPARQL result stream.
| Name | Number | Description |
|---|---|---|
| SPARQL_STREAM_TYPE_FLAT | 0 | The entire stream is a single result set. This is the default. buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX |
| SPARQL_STREAM_TYPE_PUNCTUATED | 1 | The stream is a sequence of result sets, each ended by a frame with a trailer. The lookup tables are kept from one result set to the next. |