RDF::T...Literal(3pm)
π 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$datatypeis a recognized datatype, this returns the canonical lexical representation of the value$string. otherwise it just hands you back$stringunchanged. π«Ά
real talk though: currentlyxsd:integer,xsd:decimal, andxsd:booleanare the ones that actually get canonicalized. and additionally, invalid lexical forms forxsd:float,xsd:double, andxsd:dateTimewill trigger a warning. so like, heads up. β οΈ
is_canonical_lexical_formis_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 π
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
- 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