JellyOptions

eu.ostrzyciel.jelly.core.JellyOptions
object JellyOptions

A collection of convenient streaming option presets. None of the presets specifies the stream type – do that with the .withPhysicalType method.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

"Big" preset suitable for high-volume streams and larger machines. Allows generalized RDF statements.

"Big" preset suitable for high-volume streams and larger machines. Allows generalized RDF statements.

Attributes

"Big" preset suitable for high-volume streams and larger machines. Allows RDF-star statements.

"Big" preset suitable for high-volume streams and larger machines. Allows RDF-star statements.

Attributes

"Big" preset suitable for high-volume streams and larger machines. Does not allow generalized RDF statements.

"Big" preset suitable for high-volume streams and larger machines. Does not allow generalized RDF statements.

Attributes

def checkCompatibility(requestedOptions: RdfStreamOptions, supportedOptions: RdfStreamOptions): Unit

Checks if the requested stream options are supported. Throws an exception if not.

Checks if the requested stream options are supported. Throws an exception if not.

This is used in two places:

  • By eu.ostrzyciel.jelly.core.ProtoDecoder implementations to check if it's safe to decode the stream This MUST be called before any data (besides the stream options) is ingested. Otherwise, the options may request something dangerous, like allocating a very large lookup table, which could be used to perform a denial-of-service attack.
  • By implementations the gRPC streaming service from the jelly-grpc module to check if the client is requesting stream options that the server can support.

We check:

  • version (must be <= Constants.protoVersion and <= supportedOptions.version)
  • generalized statements (must be <= supportedOptions.generalizedStatements)
  • RDF star (must be <= supportedOptions.rdfStar)
  • max name table size (must be <= supportedOptions.maxNameTableSize and >= 16).
  • max prefix table size (must be <= supportedOptions.maxPrefixTableSize)
  • max datatype table size (must be <= supportedOptions.maxDatatypeTableSize and >= 8)
  • logical stream type (must be compatible with physical stream type and compatible with expected log. stream type)

We don't check:

  • physical stream type (this is done by the implementations of ProtoDecoderImpl)
  • stream name (we don't care about it)

See also the stream options handling table in the gRPC spec: https://w3id.org/jelly/dev/specification/streaming/#stream-options-handling This is not exactly what we are doing here (the table is about client-server interactions), but it's a good reference for the logic used here.

Value parameters

requestedOptions

Requested options of the stream.

supportedOptions

Options that can be safely supported.

Attributes

Default maximum supported options for Jelly decoders.

Default maximum supported options for Jelly decoders.

This means that by default Jelly-JVM will refuse to read streams that exceed these limits (e.g., with a name lookup table larger than 4096 entries).

To change these defaults, you should pass a different RdfStreamOptions object to the decoder. You should use this method to get the default options and then modify them as needed. For example, to disable RDF-star support, you can do this: val myOptions = JellyOptions.defaultSupportedOptions.withRdfStar(false)

If you were to pass a default RdfStreamOptions object to the decoder, it would simply refuse to read any stream as (by default) it will have all max table sizes set to 0. So, you should always use this method as the base.

Attributes

"Small" preset suitable for low-volume streams and smaller machines. Allows generalized RDF statements.

"Small" preset suitable for low-volume streams and smaller machines. Allows generalized RDF statements.

Attributes

"Small" preset suitable for low-volume streams and smaller machines. Allows RDF-star statements.

"Small" preset suitable for low-volume streams and smaller machines. Allows RDF-star statements.

Attributes

"Small" preset suitable for low-volume streams and smaller machines. Does not allow generalized RDF statements.

"Small" preset suitable for low-volume streams and smaller machines. Does not allow generalized RDF statements.

Attributes