Many RDF serialization formats (e.g., Turtle, RDF/XML, some binary formats) have a way to preserve named prefix declarations. For example, in Turtle:
PREFIX stax: <https://w3id.org/stax/ontology#>
This is currently not possible in Jelly-RDF. Although we do have the prefix lookup table, this is not the same thing as a prefix declaration. Prefixes in the lookup table are arbitrary and only are there to improve the compression ratio, they also don't have names.
This proposal is to introduce such a functionality to Jelly-RDF.
Scope:
Add a new RdfStreamRow type: RdfPrefixDeclaration
To make this as frugal as possible, the prefix declarations should reuse our existing infrastructure for encoding IRIs. So, I think it would make sense for this message to have two fields:
name – string, short name of the prefix. This probably SHOULD correspond to the PN_PREFIX production in Turtle (colon not included!).
value – RdfIri message
Implementation:
Extend rdf.proto with the new message.
Update the specification to include the new message.
Make a new Jelly release – 1.1, binary version 2.
Implement this in Jelly-JVM, but keep the feature disabled by default (see compat notes below).
Compatibility:
Jelly-JVM will throw an exception when it encounters an unknown row type, so we cannot pretend this is the same version as 1.0. It will also by default not parse Jelly files with versions higher than the supported one.
This feature is very "optional" and will have a very slight negative impact on performance, so it should be always disabled by default. When it's disabled, we can label the file as written with Jelly 1.0.
Because we will disable this by default, but allow parsing both Jelly 1.0 and 1.1, this will create a soft grace period for consumers to be updated to the new version of the protocol.
This note about compatibility (i.e., 1.1 without prefix declarations = 1.0) should be included in the spec as the recommended behavior.
Maybe call this "namespace declarations" instead, to avoid confusion with the prefix lookup table. The "namespace" terminology is already used by RDF4J and rdflib (but not Jena), so it would make sense.
Many RDF serialization formats (e.g., Turtle, RDF/XML, some binary formats) have a way to preserve named prefix declarations. For example, in Turtle:
This is currently not possible in Jelly-RDF. Although we do have the prefix lookup table, this is not the same thing as a prefix declaration. Prefixes in the lookup table are arbitrary and only are there to improve the compression ratio, they also don't have names.
This proposal is to introduce such a functionality to Jelly-RDF.
Scope:
RdfStreamRow
type:RdfPrefixDeclaration
name
– string, short name of the prefix. This probably SHOULD correspond to the PN_PREFIX production in Turtle (colon not included!).value
–RdfIri
messageImplementation:
rdf.proto
with the new message.2
.Motivation and related issues: