=encoding utf8
=head1 NAME
rdf/parser/nquads - N-Quads parser.
=head1 SYNOPSIS
from rdf/parser/nquads import NQuadsParser;
let parser := new NQuadsParser();
let quads := parser.parse_string("<s> <p> \"o\" <g> .\n");
=head1 DESCRIPTION
C<NQuadsParser> parses RDF 1.1 N-Quads into RDF quads. Lines without an
explicit graph are loaded into the default graph. It accepts C<base> and
C<into> parser options for consistency with the other RDF parsers, though
N-Quads requires absolute IRIs.
=head1 EXPORTS
=head2 Classes
=over
=item C<NQuadsParser>
=over
=item C<< parse_string(String text, ... options) >>
Parses C<text>. Returns an array of quads, or the supplied C<into> store
after adding the quads. Throws C<RDFSyntaxError> on invalid input.
=item C<< parse_file(path, ... options) >>
Reads UTF-8 from C<path> and parses it.
=item C<< parse_lines(Array lines, ... options) >>
Parses concatenated line chunks.
=item C<< parse_chunks(Array chunks, ... options) >>
Parses concatenated string or nested-array chunks.
=back
=back
=head1 COPYRIGHT AND LICENCE
B<< rdf/parser/nquads >> is copyright Toby Inkster.
It is free software; you may redistribute it and/or modify it under
the terms of either the Artistic License 1.0 or the GNU General Public
License version 2.
=cut
from rdf/parser import RdfParser;
from rdf/parser/common import RDFReader, _parser_result;
class NQuadsParser with RdfParser {
method parse_string ( String text, ... PairList options ) {
return _parser_result(
( new RDFReader(source: text) ).read_nt_all(true),
options,
);
}
}
modules/rdf/parser/nquads.zzm
rdf-0.0.3 source code
Package
- Name
- rdf
- Version
- 0.0.3
- Uploaded
- 2026-06-12 23:55:02
- Repository
- https://github.com/tobyink/zuzu-rdf
- Dependencies
-
-
std/data/xml>= 0 -
std/data/xml/escape>= 0 -
std/data/json>= 0 -
std/db>= 0 -
std/digest/sha>= 0 -
std/getopt>= 0 -
std/internals>= 0 -
std/io>= 0 -
std/math>= 0 -
std/proc>= 0 -
std/string>= 0 -
std/time>= 0 -
std/uuid>= 0
-
- Metadata
- zuzu-distribution.json
- Archive
- Download .tar.gz