Catman...f_query(3pm)

πŸ“¦
version 0.32 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

πŸ’– Catmandu::Fix::aref_query β€” aka Catman...f_query(3pm) πŸ’–

ok so bestie, this is a page from the User Contributed Perl Documentation and it's literally all about one lil Fix module. yes the header truncates the name to Catman...f_query(3pm), we don't make the rules, we just vibe with them 🫢


✨ NAME ✨

Catmandu::Fix::aref_query β€” copy values of RDF in aREF to a new field πŸ’…


🌸 SYNOPSIS 🌸

So you can call this thing in Catmandu Fix language, like:

aref_query( dc_title => title )
aref_query( query => 'dc_title', field => 'title' )
aref_query( 'http://example.org/subject', dc_title => title )

and you can also call it straight up from Perl code, no cap:

use Catmandu::Fix::aref_query as => 'my_query';
use RDF::aREF;

my $rdf = encode_aref("example.ttl");
my_query( $rdf, dc_title => 'title' );

like, yes queen, that's the whole thing πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

ok so listen. This Catmandu::Fix is the one you want when you've imported some RDF and you need to map its values. It works on data given in the aREF structure, and the link for that is right here: <http://gbv.github.io/aREF/>. it's giving "translate my RDF into something a lil more friendly" energy and honestly? obsessed πŸ”₯


πŸ‘‘ ARGUMENTS πŸ‘‘

here's where the tea gets specific. three arguments, and you need to know what each one is doing:

  • subject β€” this one is optional, it's the subject URI and it goes first. But here's the quirky bit: by default, the fields "_uri" and "_uri" are used. yes. it says _uri twice. that's what the page says, that's what I'm telling you, we're not touching it πŸ’€
  • query β€” the aREF query expression, and it can be either the first or the second argument depending on how you're calling it.
  • path β€” the field name you're mapping the RDF data to, and it's the last argument. Good news bestie: existing values are also kept, nothing gets yeeted πŸ™ˆ

⭐ SEE ALSO ⭐

go look at the function "aref_query" in RDF::aREF β€” that's the whole list, iykyk πŸ’œ


and that's a wrap, gorgeous πŸ’– this page is from perl v5.36.0, dated 2022-12-06, and the footer calls it Catman...f_query(3pm) one more time because it loves a dramatic entrance. mwah πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from