NQuadsCodec class final

Format definition for the N-Quads RDF serialization format.

N-Quads is a line-based, plain text RDF serialization format defined by the W3C. It is a simplified subset of Turtle, where each line represents exactly one triple statement. N-Quads is designed to be simple to parse and generate.

The format is specified in the RDF 1.1 N-Quads W3C Recommendation.

N-Quads characteristics:

  • Each line contains exactly one triple statement
  • No abbreviations or prefixes are supported
  • Everything is written out explicitly, making it verbose but simple
  • All IRIs are enclosed in angle brackets
  • The format is line-based, making it easy to process with standard text tools

Example N-Quads document:

<http://example.org/subject> <http://example.org/predicate> <http://example.org/object> .
<http://example.org/subject> <http://example.org/predicate> "Literal value" .
<http://example.org/subject> <http://example.org/predicate> "Value"@en .
Inheritance

Constructors

NQuadsCodec.new({NQuadsEncoderOptions encoderOptions = const NQuadsEncoderOptions(), NQuadsDecoderOptions decoderOptions = const NQuadsDecoderOptions(), IriTermFactory iriTermFactory = IriTerm.validated})
Creates a new N-Quads format definition
const

Properties

decoder → RdfDatasetDecoder
Returns a decoder configured with the current decoder options
no setteroverride
encoder → RdfDatasetEncoder
Returns an encoder configured with the current encoder options
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
inverted Codec<String, RdfDataset>
Inverts this.
no setterinherited
primaryMimeType String
Returns the primary MIME type for N-Quads: 'application/n-quads'
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedMimeTypes Set<String>
Returns the set of all supported MIME types for N-Quads
no setteroverride

Methods

canParse(String content) bool
Determines if the given content is likely in N-Quads format.
override
decode(String input, {String? documentUrl, RdfGraphDecoderOptions? options}) RdfDataset
Decodes a string containing RDF data into an RDF graph
inherited
encode(RdfDataset input, {String? baseUri, RdfGraphEncoderOptions? options}) String
Encodes an RDF graph to a string representation in this codec
inherited
fuse<R>(Codec<String, R> other) Codec<RdfDataset, R>
Fuses this with other.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns a string representation of this codec
override
withOptions({RdfGraphEncoderOptions? encoder, RdfGraphDecoderOptions? decoder, IriTermFactory? iriTermFactory}) NQuadsCodec
Creates a new codec instance with the specified options
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

alternativeMimeTypes → const List<String>
The additional MIME types that should be recognized as N-Quads
fileExtensions → const List<String>
The file extensions associated with N-Quads files