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

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

πŸ’– RDF::Trine::Serializer::Turtle β€” the Turtle Serializer, bestie πŸ’–

okay so real talk, this is the manual for RDF::Trine::Serializer::Turtle, living in the User Contributed Perl Documentation zone. it's the class that takes your RDF graphs and turns them into Turtle syntax. iconic behavior honestly. 🐒✨


✨ VERSION ✨

this doc is describing RDF::Trine::Serializer::Turtle version 1.019. write it down, it's on the quiz. πŸ“


🌸 SYNOPSIS 🌸

here's the whole vibe in four lines, no notes:

use RDF::Trine::Serializer::Turtle;
my $serializer = RDF::Trine::Serializer::Turtle->new( namespaces => { ex => 'http://example/' } );
print $serializer->serialize_model_to_string($model);

see how easy that was?? you import it, you build a serializer with a namespace map, you print your model out as Turtle. slay. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so RDF::Trine::Serializer::Turtle is a whole class that gives you an API for serializing RDF graphs into Turtle syntax. that's the whole job and she does it gorgeously.

and here's the cute part: XSD numeric types get serialized as bare literals β€” no extra wrapping, no drama, just the number. and whenever it's possible, it uses the more concise syntax for rdf:Lists. she's efficient, she's tidy, she's that girl. πŸ‘‘


πŸ’« METHODS πŸ’«

lowkey important note first: beyond everything listed down here, this class also inherits methods from the RDF::Trine::Serializer class. so there's lore beyond this page, iykyk. 🫢


πŸ’– new ( namespaces => \%namespaces, base_uri => $base_uri )

returns a brand new Turtle serializer object. that's it, that's the function. give her namespaces, maybe a base uri, and she's ready. ✨


πŸŽ€ serialize_model_to_file ( $fh, $model )

serializes $model into Turtle, and prints the results into the filehandle you hand her β€” that's <$fh>. she writes, you relax. πŸ’–


🌈 serialize_model_to_string ( $model )

same energy, different delivery: serializes $model into Turtle and returns the whole thing as a string. perfect for when you wanna keep it, print it, or send it to the group chat. πŸ“©


🧚 serialize_iterator_to_file ( $file, $iter )

serializes the iterator into Turtle and prints the results into the supplied filehandle <$fh>. (yes, the signature says $file and the description says <$fh> β€” that's the original, we're not touching it, we don't edit the queen.) πŸ™ˆ


πŸ“ serialize_iterator ( $sink, $iter )

serializes the iterator into Turtle, printing the results into the supplied sink object. sink object, bestie. it goes in the sink. 🚰


⭐ serialize_iterator_to_string ( $iter )

serializes the iterator into Turtle and returns the result as a string. string girlies rise. ✨


πŸ‘‘ serialize_node ( $node )

returns a string containing the Turtle serialization of $node. one node, one string, no cap. πŸ’―


πŸ’œ node_as_concise_string

returns a string representation using common Turtle syntax shortcuts β€” think numeric literals and all that pretty abbreviated stuff. concise queen. πŸ’…


😭 BUGS 😭

found a bug? got a feature request? please report it through the GitHub web interface at https://github.com/kasei/perlrdf/issues. she reads the issues, she responds, we love that for her. 🫢


🌸 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. free software, generous queen πŸ’š


fr fr that's the whole page, every flag, every method, every last detail preserved. no crumbs left behind. πŸ’…βœ¨

and that's the wrap, bestie β€” this was RDF::T...Turtle(3pm) from perl v5.38.2, dated 2024-01-13. mwah, take care of her. πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from