Struct NodeSerializationOpts

Struct Documentation

struct NodeSerializationOpts

Options to control the serialization of Nodes/Literals

Public Members

bool use_short_form

use the short form of the literals, for example: if this option is true “1”^^xsd:integer serializes to 1

bool use_prefixes

use prefixes for fixed datatypes (by default all registered xsd and rdf datatypes), for example: if this option is true “1”^^xsd:byte serializes to “1”^^xsd:byte

Public Static Functions

static inline NodeSerializationOpts long_form() noexcept

Do not use short forms and do not use prefixes. This is used in N-Triples for example.

Examples: “1”^^xsd:integer serializes to “1”^^http://www.w3.org/2001/XMLSchema#integer “1”^^xsd:byte serializes to “1”^^http://www.w3.org/2001/XMLSchema#byte

static inline NodeSerializationOpts short_form() noexcept

Use the short form of literals, but do not use prefixes. This is used in sparql TSV results for example.

Examples: “1”^^xsd:integer serializes to 1 “1”^^xsd:byte serializes to “1”^^http://www.w3.org/2001/XMLSchema#byte

static inline NodeSerializationOpts prefixed() noexcept

Do not use the short form of literals, but do use prefixes.

Examples: “1”^^xsd:integer serializes to “1”^^xsd:integer “1”^^xsd:byte serializes to “1”^^xsd:byte

static inline NodeSerializationOpts prefixed_and_short_form() noexcept

Use the short form of literals and use prefixes. This is commonly used in turtle (with prefix definitions).

Examples: “1”^^xsd:integer serializes to 1 “1”^^xsd:byte serializes to “1”^^xsd:byte