RDF::T...RDFXML(3pm)

πŸ“¦
version 1.019 Β· 7 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 for XML::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 ⭐


πŸ‘‘ AUTHOR πŸ‘‘

Gregory Todd Williams <gwilliams@cpan.org>


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