RDF::T...Turtle(3pm)
π 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 πΈ
- http://www.w3.org/TeamSubmission/turtle/ β go read the Turtle spec, it's giving academic but it's worth it π
π 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. 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
- 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