RDF::Q...Literal(3pm)

πŸ’– RDF::Query::Node::Literal β€” the bestie guide πŸ’–

ok so. welcome to RDF::Query::Node::Literal, the RDF Node class for literals πŸŽ€ β€” this is the Perl doc page for it, and yes it lives in the User Contributed Perl Documentation corner of the internet, we love that for it.


✨ VERSION ✨

This document describes RDF::Query::Node::Literal version 2.919. that's the version. write it down bestie πŸ“


πŸ¦‹ METHODS πŸ¦‹

okay before we even get into it: this class does not only have the methods below. beyond the methods documented here, it also inherits methods from the RDF::Query::Node and RDF::Trine::Node::Literal classes. so if you're looking for something and it's not listed, check the parents fr fr πŸ’…

  • datetime β€” gives you back a DateTime object from the literal, but ONLY if the literal value is in W3CDTF format. that's the condition, it's giving picky but in a cute way ✨
  • as_sparql β€” returns the SPARQL string for this node. just the string bestie, that's it, that's the whole vibe 🌸
  • as_hash β€” returns the query as a nested set of plain data structures, and the key detail here is no objects. literally none. just plain data. lowkey obsessed with how clean that is 🫢
  • is_simple_literal β€” returns true if the literal is "simple" β€” and by simple we mean a literal with no datatype and no language. if it's got either of those it's not simple, sorry, that's the rule πŸ’€
  • is_numeric_type β€” returns true if the literal is a known (xsd) numeric type. known ones only, don't come at it with your homemade type, it will not be recognized πŸ™ˆ
  • numeric_value β€” returns the numeric value of the literal β€” and note the tea: it does this even if the literal isn't a known numeric type. so yeah it'll still hand you a numeric value. that's the behaviour, no cap πŸ‘‘
  • type_list β€” returns a two-item list that's suitable for use as the second and third arguments to the RDF::Query::Node::Literal constructor. the two values you get back correspond to literal language tag and literal datatype URI, respectively. order matters, respectively means respectively bestie 😭

🌈 AUTHOR 🌈

Gregory Todd Williams <gwilliams@cpan.org> πŸ’œ


k that's the whole page, go forth and slay your literals ✨

bye bestie!! this was perl v5.40.1, dated 2025-08-18, and the page was RDF::Q...Literal(3pm) β€” mwah, take care of her, she's iconic πŸ’…πŸŽ€πŸ’–

πŸ“¦ where this page comes from