RDF::G...ectList(3pm)

πŸ“¦
version 0.16 Β· 4 versions
, in debian bookworm, ubuntu noble

πŸ’– RDF::Generator::Void::Meta::Attribute::ObjectList πŸ’–

okay bestie, welcome to RDF::G...ectList(3pm) β€” yes that's the manual name, the terminal did a little ✨abbreviation✨ thing, don't worry about it. It's part of the User Contributed Perl Documentation crew, and it's literally just a lil trait that makes your RDF object lists behave. Let's go πŸ¦‹


✨ NAME ✨

RDF::Generator::Void::Meta::Attribute::ObjectList β€” a trait for a list of RDF objects. that's it, that's the whole name, no notes πŸ’…


🌸 SYNOPSIS 🌸

like, here's the vibe in actual code, copy it exactly, i'm not retyping it for you:

has _endpoints => ( traits => ['ObjectList'] );
has _titles => (
                                 traits => ['ObjectList'],
                                 isa      => 'ArrayRef[RDF::Trine::Node::Literal]',
                                );
has resources => ( traits => ['ObjectList'] );

πŸŽ€ DESCRIPTION πŸŽ€

so this module hands you a trait that manages a list of RDF resources β€” the kind you'd typically drop into an object position in an RDF triple. iykyk. 🧚

when you're declaring attributes, you can just throw traits => ['ObjectList'] in there all by itself, and it'll hook you up with an arrayref of strings plus the methods to:

  • push to the array 🫢
  • list all the strings in the array ✨
  • check if it's empty πŸ’€

and those methods get made by prefixing add_, all_, and has_no_ onto your attribute name β€” respectively, in that order, no cap.

now, plot twist: if you start your attribute name with an underscore, the attribute itself will not be a method. but don't panic!! you can still pass the non-prefixed attribute name as an argument to the constructor, and you still get all the same methods as above. main character behavior, honestly. πŸ‘‘

you may also pass an isa argument to the attribute. in that case you can set the arrayref to hold something that is not strings β€” exactly like the RDF::Trine::Node::Literal situation in the synopsis up there. iconic. 🌈


πŸ’œ FURTHER DOCUMENTATION πŸ’œ

bestie if you want more, please see RDF::Generator::Void for further documentation. that's the mothership, go read it. πŸ“š


this module was prototyped by Konstantin Baierer and it's mostly his work. respect the architect. πŸ†

and for all the info about authors and copyright for this module, please see RDF::Generator::Void β€” they got the receipts over there. ⭐


πŸ’Œ quick sign-off from ur fave: this page came to you via perl v5.34.0, dated 2022-06-17. mwah. go write some triples. πŸ“
πŸ“¦ where this page comes from