Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: prefix declarations in Jelly-RDF #12

Open
Ostrzyciel opened this issue Nov 22, 2024 · 1 comment
Open

Proposal: prefix declarations in Jelly-RDF #12

Ostrzyciel opened this issue Nov 22, 2024 · 1 comment
Labels
new protocol feature Discussion about a new feature in the Jelly protocol

Comments

@Ostrzyciel
Copy link
Member

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!).
    • valueRdfIri 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.

Motivation and related issues:

@Ostrzyciel Ostrzyciel added the new protocol feature Discussion about a new feature in the Jelly protocol label Nov 22, 2024
@Ostrzyciel
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new protocol feature Discussion about a new feature in the Jelly protocol
Projects
None yet
Development

No branches or pull requests

1 participant