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

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

πŸ’– RDF::Trine::Parser::Turtle πŸ’–

okay bestie, so this is RDF::Trine::Parser::Turtle β€” the Turtle RDF Parser from the User Contributed Perl Documentation. yes it's a manpage. yes it's about parsing RDF. and yes, we're gonna make it cute. 🐒✨


✨ VERSION ✨

this doc describes RDF::Trine::Parser::Turtle version 1.019. that's the one. periodt. πŸ’…


🌸 SYNOPSIS 🌸

the vibe check, in code form:

use RDF::Trine::Parser;
my $parser     = RDF::Trine::Parser->new( 'turtle' );
$parser->parse_into_model( $base_uri, $data, $model );

that's literally it. make a parser, tell it 'turtle', feed it a base URI, some data, and a model. slay. πŸ¦‹


πŸŽ€ DESCRIPTION πŸŽ€

so basically this module implements a parser for the Turtle RDF format. that's the whole thing. no cap, that's the description. iconic brevity. πŸ‘‘


πŸ’… METHODS πŸ’…

lowkey important: beyond the methods listed below, this class inherits methods from the RDF::Trine::Parser class. so don't come for this module for stuff it got from its parent. iykyk. 🫢

  • new ( [ namespaces => $map ] ) β€” hands you a brand new Turtle parser. fresh out the box. ✨
  • parse ( $base_uri, $rdf, \&handler ) β€” parses the bytes in $data, using the given $base_uri. it calls the triple method for each RDF triple parsed. and here's the tea: this method does nothing by default, but you can set it by using one of the default parse_* methods. so yeah, it's giving "potential" until you actually wire it up. πŸ’€
  • parse_file ( $base_uri, $fh, $handler ) β€” parses all the data read from the filehandle or file $fh, using the given $base_uri. cute bonus: if $fh is a filename, this method can guess the associated parse. for each RDF statement parsed, $handler gets called. πŸ“
  • parse_node ( $string, $base, [ token => \$token ] ) β€” returns the RDF::Trine::Node object that matches the node whose N-Triples serialization is found at the beginning of $string. and if you pass a reference to $token, it gets dereferenced and set to the RDF::Trine::Parser::Turtle::Token tokenizer object β€” which means you get access to info like the token's position in the input string. main character energy for your tokenizer. πŸ‘‘πŸ”

😭 BUGS 😭

found a bug? got a feature request? please report it through the GitHub web interface at https://github.com/kasei/perlrdf/issues. do not suffer in silence, bestie, the issues tab is right there. 🫢


🌈 AUTHOR 🌈

Gregory Todd Williams <gwilliams@cpan.org> β€” the legend who wrote this. πŸŽ€


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.


fr fr, that's the whole page. go parse some turtle. πŸ’πŸ’–

and a lil sign-off for you: this was rendered by perl v5.38.2, dated 2024-01-13, and it's the RDF::T...Turtle(3pm) page. bye bestie, drink water πŸ’…πŸŒΈ

πŸ“¦ where this page comes from