14 Module io🔗ℹ

 (require rdf/core/io) package: rdf-core

This package provides basic capabilities for writing RDF values. The representations supported are N-Triples ([RDF11NT]), N-Quads ([RDF11NQ]), Turtle ([RDF11TTL]), and TriG ([RDF11TRIG]). These are chosen as they can easily be combined given that the specifications refer to each other. The following figure shows the relationship between the various components as formatters.

Core Representations

Both N-Triple and N-Quad statement formats rely on the resource, blank-node, and literal formats which are common to both. A degenerate form of Turtle uses N-Triples as-is, but even if the writer uses more compact structures the basic components are formatted in the same manner. As the statement forms are aggregated into N-Triple and N-Quad graph formatters these are simply lists of statements with no additional syntax. However, the Turtle formatter builds upon this to allow for more syntax that compacts the output and improves readability.

    14.1 N-Triple Formatting

    14.2 N-Quad Formatting

    14.3 Turtle/TriG Formatting

    14.4 SPARQL Formatting