Expand description
RDF Format Serializers for QualiaDB
Serializes NQuin data to standard RDF formats: N-Triples, Turtle, N-Quads, TriG, N3, JSON-LD.
Terms are resolved through the shared resolver primitives
(write_iri_term / write_object_term), so subjects/predicates render as
<iri> and objects render as <iri> or a typed literal
("42"^^<…#integer>) exactly as in the N-Triples path. The grouped
formats (Turtle/TriG/N3) additionally produce valid surface syntax —
subject joined to its predicate–object list with ; separators and a single
trailing ., not the previous malformed “subject .” per line.
Known boundary (shared by every path here, including N-Triples): a plain or
language-tagged string literal that was interned into the lexicon at
ingest is indistinguishable from an IRI at this layer and renders as <…>.
Inline-typed literals (integer/decimal/boolean/float) are distinguished and
render correctly. Resolving interned string literals to "…"@lang output is
an ingest-layer concern (the term must carry its literal flag) tracked
separately; it is not silently faked here.
Functions§
- serialize_
to_ cborld - Serialize Quins to CBOR-LD: a CBOR array of JSON-LD-shaped node maps
(
{"@id": <subject>, <predicate>: <object>}), one map per triple. - serialize_
to_ jsonld - Serialize Quins to JSON-LD (expanded node objects, grouped by subject).
- serialize_
to_ n3 - Serialize Quins to N3 format.
- serialize_
to_ nquads - Serialize Quins to N-Quads format (zero-heap via resolver).
- serialize_
to_ ntriples - Serialize Quins to N-Triples format (zero-heap via resolver).
- serialize_
to_ trig - Serialize Quins to TriG format (named graphs of Turtle blocks).
- serialize_
to_ turtle - Serialize Quins to Turtle format.