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

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

πŸ’– RDF::Trine::Node::Literal β€” the literal node glow-up πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation, and it's all about RDF::Trine::Node::Literal, the RDF Node class for literals. yes, the actual class that holds your strings and numbers and typed values. she's a whole vibe, let's get into it. πŸŽ€


✨ VERSION ✨

This document describes RDF::Trine::Node::Literal version 1.019. periodt. πŸ’…


🌸 METHODS 🌸

okay so before we even start: beyond the methods documented below, this class inherits methods from the RDF::Trine::Node class. so there's more where that came from, iykyk. πŸ¦‹

  • new ( $string, $lang, $datatype, $canonical_flag ) β€” hands you a brand-new Literal structure. fresh out the box. ✨
  • literal_value β€” gives you back the string value of the literal. the actual text, no cap. πŸ’–
  • literal_value_language β€” gives you back the language tag of the literal. like, which language bestie. 🌈
  • literal_datatype β€” gives you back the datatype of the literal. what kind of girl is she. πŸ‘‘
  • value β€” returns the literal value. yes queen, same energy. πŸ’œ
  • sse β€” returns the SSE string for this literal. ⭐
  • as_string β€” returns a string representation of the node. the classic stringified look. πŸŽ€
  • as_ntriples β€” returns the node in a string form suitable for NTriples serialization. very much a specific format moment. πŸ”₯
  • type β€” returns the type string of this node. πŸ¦‹
  • has_language β€” true if this literal is language-tagged, false otherwise. is she bilingual or not. πŸ’…
  • has_datatype β€” true if this literal is datatyped, false otherwise. is she typed or not. 🌸
  • equal ( $node ) β€” true if the two nodes are equal, false otherwise. are they twins or not. 😭
  • canonicalize β€” returns a new literal node object whose value is in canonical form (where applicable). note the new object, bestie, she's a whole separate girl. ✨
  • canonicalize_literal_value ( $string, $datatype, $warn ) β€” if $datatype is a recognized datatype, this returns the canonical lexical representation of the value $string. otherwise it just hands you back $string unchanged. 🫢
real talk though: currently xsd:integer, xsd:decimal, and xsd:boolean are the ones that actually get canonicalized. and additionally, invalid lexical forms for xsd:float, xsd:double, and xsd:dateTime will trigger a warning. so like, heads up. ⚠️
  • is_canonical_lexical_form
  • is_valid_lexical_form

okay these two share a description, so here it is: returns true if the node is of a recognized datatype and has a valid lexical form for that datatype. if the lexical form is invalid, returns false. and if the datatype is unrecognized, returns zero-but-true. yes bestie, zero-but-true is a real thing that exists. πŸ’€

  • is_numeric_type β€” returns true if the literal is a known (xsd) numeric type. math girlie check. πŸ”’
  • numeric_value β€” returns the numeric value of the literal, even if the literal isn't a known numeric type. she's gonna try regardless. πŸ’ͺ

πŸ› BUGS πŸ›

found a bug? need a feature? please report any bugs or feature requests to through the GitHub web interface at <https://github.com/kasei/perlrdf/issues>. don't be shy, they want the tea. πŸ™ˆ


πŸ‘‘ AUTHOR πŸ‘‘

Gregory Todd Williams β€” "<gwilliams@cpan.org>". iconic. the main character. πŸ’œ


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. πŸŽ€


okay that's the whole page bestie, you ate it up fr fr. πŸ’–

this was RDF::T...Literal(3pm) from perl v5.38.2, dated 2024-01-13 β€” so if you're reading this years later, hi, love you, hope the literals are literal. πŸ¦‹βœ¨πŸŒΈ

πŸ“¦ where this page comes from