RDF::T...RDFXML(3pm)
π RDF::Trine::Parser::RDFXML β the RDF/XML Parser π
okay so bestie. you're here for RDF::Trine::Parser::RDFXML, a whole RDF/XML Parser, living in the User Contributed Perl Documentation section of the manual (that's the 3pm vibe, iykyk). she's giving parser, she's giving XML, she's giving let me turn your angle brackets into triples. let's go. π¦
β¨ VERSION β¨
this doc is describing RDF::Trine::Parser::RDFXML version 1.019. iconic. periodt. π
πΈ SYNOPSIS πΈ
the three-line starter pack, no notes:
use RDF::Trine::Parser;
my $parser = RDF::Trine::Parser->new( 'rdfxml' );
$parser->parse_into_model( $base_uri, $data, $model );
that's it. that's the whole flex. π
π«Ά DESCRIPTION π«Ά
...
(literally. that's what it says. the original really did leave us on read. π we move.)
π METHODS π
okay so real talk: beyond the methods we're about to spill below, this class also inherits methods from the RDF::Trine::Parser class. so don't come for her about methods you can't find β check the parent, bestie. π
π new
she's the constructor. that's the whole tea. β¨
π parse_into_model ( $base_uri, $data, $model [, context => $context] )
this one parses the bytes sitting in $data, using the $base_uri you handed over. and for every single RDF statement she parses? she calls:
$model->add_statement( $statement )
yes ma'am, straight into the model. π
πΈ parse ( $base_uri, $rdf, \&handler )
π¦ parse_file ( $base_uri, $fh, \&handler )
these two parse all the data read from the filehandle $fh, using the given $base_uri. and for each RDF statement that gets parsed, $handler->( $st ) gets called. callback girlies rise up. π
β οΈ Note, and this one matters: the filehandle should NOT be opened with the:encoding(UTF-8)IO layer. this is known to cause problems forXML::SAX. so likeβ¦ don't. please. for me. π
π BUGS π
got bugs? feature requests? spill them through the GitHub web interface at:
https://github.com/kasei/perlrdf/issues
she reads every one. π«Ά
β SEE ALSO β
http://www.w3.org/TR/rdf-syntax-grammar/β the grammar herself. go read, it's giving lore. π
π AUTHOR π
Gregory Todd Williams <gwilliams@cpan.org>
π COPYRIGHT π
Copyright (c) 2006-2012 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 page, bestie. this one came from perl v5.38.2, dated 2024-01-13, and it's the RDF::Trine::Parser::RDFXML manual β so if you're still here, go parse something. slay. π
β¨π¦
π¦ where this page comes from
- debian trixie: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms