Attean...RQLXML(3pm)

πŸ’… AtteanX::Parser::SPARQLXML β€” the SPARQL XML parser bestie

okay so real talk, this page lives in the User Contributed Perl Documentation section of the manual, and it's all about AtteanX::Parser::SPARQLXML, version 0.035. That's the whole vibe. Let's get into it ✨


🌸 SYNOPSIS 🌸

use Attean;
my $parser = Attean->get_parser('SPARQLXML')->new();
$parser->parse_cb_from_io( $fh );

that's literally the entire flex. three lines. grab the parser through Attean->get_parser('SPARQLXML'), call ->new() on it, then feed it a filehandle. slay πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

...

no fr that's what it says 😭 the description is literally just .... it's giving mysterious. it's giving "figure it out yourself, bestie." iconic honestly πŸŽ€


✨ METHODS ✨

canonical_media_type

hands you back the canonical media type for SPARQL XML, which is:

application/sparql-results+xml

that's the one. the main character media type πŸ‘‘

media_types

gives you a list of media types this SPARQL XML parser can handle. and the list is... drumroll... application/sparql-results+xml. yes it's the same one. yes it's a list with one entry. we support her 🫢

file_extensions

returns a list of file extensions that can be parsed with this parser. that's it, that's the method β€” it just tells you which file extensions are valid for it πŸ“

parse_cb_from_io( $fh )

okay this one's the workhorse. it calls the "$parser->handler" function once for every Attean::API::Binding object that results from parsing the data read out of the IO::Handle object $fh. one callback per binding, no cap. so bring your filehandle and your handler and let it cook πŸ”₯

parse_cb_from_bytes( $data )

same energy, different input. this one calls the "$parser->handler" function once for each Attean::API::Binding object that comes out of parsing the data in the UTF-8 encoded byte string $data. key detail bestie β€” it's UTF-8 encoded bytes, not just any old string πŸ™ˆ


πŸ’€ BUGS πŸ’€

found a bug? got a feature request? please report either one through the GitHub web interface at <https://github.com/kasei/perlrdf/issues>. don't suffer in silence, bestie, tell the maintainers πŸ’œ


🌈 AUTHOR 🌈

Gregory Todd Williams "<gwilliams@cpan.org>" β€” the legend themselves ✨


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.


lowkey important: this is free software under the same terms as Perl itself, so you can redistribute and/or modify it β€” just keep the copyright notice and don't be weird about it 🫢

and that's the whole page, bestie πŸ’– sign-off time: this was perl v5.40.0, dated 2025-01-26, and the page is Attean...RQLXML(3pm) from the User Contributed Perl Documentation. go forth and parse that SPARQL XML πŸ‘‘πŸ’…

πŸ“¦ where this page comes from