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 (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