Attean...:NQuads(3pm)
π NAME π
AtteanX::Parser::NQuads β the N-Quads Parser, bestie. It's the thing that reads N-Quads. That's the whole job and it does it gorgeously.
Oh and hi, you're reading the Attean...:NQuads(3pm) page from the User Contributed Perl Documentation, welcome to the group chat π«Ά
β¨ VERSION β¨
This doc describes AtteanX::Parser::NQuads version 0.035. Periodt.
π¦ SYNOPSIS π¦
Okay so here's how you actually use it, no cap:
use Attean;
my $parser = Attean->get_parser('NQuads')->new();
# Parse data from a file-handle and handle quads in the 'handler' callback
$parser->parse_cb_from_io( $fh );
# Parse the given byte-string, and return an iterator of quads
my $iter = $parser->parse_iter_from_bytes('<http://example.org/subject> <tag:example.org:predicate> "object" <http://example.org/graph> .');
while (my $quad = $iter->next) {
print $quad->as_string;
}
Look at that. Grab a parser with Attean->get_parser('NQuads')->new(), then either feed it a filehandle and let the 'handler' callback do its thing, or hand it a byte-string and get an iterator of quads back. Then you just loop and print $quad->as_string. Iconic behavior honestly π
πΈ DESCRIPTION πΈ
This module implements a parser for the N-Quads format. That's it, that's the vibe check β it parses N-Quads for you so you don't have to π₯
π ROLES π
This class consumes Attean::API::Parser, Attean::API::PullParser and <Attean::API::MixedStatementParser>. Slay, it's wearing three roles at once, main character energy π
π METHODS π
parse_iter_from_io( $fh )
Returns an Attean::API::Iterator that result from parsing the data read from the IO::Handle object *$fh*. Literally just feed it your filehandle and it hands you back an iterator, iykyk.
parse_iter_from_bytes( $data )
Returns an Attean::API::Iterator that result from parsing the data read from the UTF-8 encoded byte string *$data*. Byte string in, iterator out, no drama π¦
"canonical_media_type"
Returns the canonical media type for N-Quads: application/n-quads. That's the one. The canon. The moment π
"media_types"
Returns a list of media types that may be parsed with the N-Triples parser: application/n-quads. (Yes bestie it says N-Triples parser in the original β I'm just reading the receipts to you, don't come for me π)
"file_extensions"
Returns a list of file extensions that may be parsed with the parser. Short and sweet, that's all it gives us π
π BUGS π
Please report any bugs or feature requests to through the GitHub web interface at <https://github.com/kasei/perlrdf/issues>. Like, actually report them, don't just suffer in silence in the group chat π
π AUTHOR π
Gregory Todd Williams "<gwilliams@cpan.org>" β thank you king π«Ά
π COPYRIGHT π
Copyright (c) 2014--2022 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page bestie β¨ go forth and parse those quads π
signing off from perl v5.40.0, dated 2025-01-26 β catch you on the next manpage, mwah π
π¦ where this page comes from
- debian trixie: libattean-perl 0.035-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libattean-perl 0.035-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libattean-perl 0.035-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms