RDF::a...ecoder(3pm)
β¨ NAME β¨
RDF::aREF::Decoder β bestie, it decodes another RDF Encoding Form (to RDF triples). That's the whole gig. π
This is the manual page <cyan>RDF::a...ecoder(3pm)</cyan>, and yes the header is giving truncated-name energy, we love that for it.
π¦ SYNOPSIS π¦
use RDF::aREF::Decoder;
RDF::aREF::Decoder->new( %options )->decode( $aref );
πΈ DESCRIPTION πΈ
Okay so this module implements a decoder from another RDF Encoding Form (aREF) β you feed it Perl arrays, hashes, and Unicode strings, and it hands you back RDF triples. It's giving β¨transformationβ¨. No cap.
π OPTIONS π
nsβ a default namespace map, and you can pass it either as a hash reference or as a version string of the moduleRDF::NS. It's set to the most recent version ofRDF::NSby defaultβ¦ but lowkey, relying on a default value is not recommended! πcallbackβ a code reference that gets called for each triple, with a list of three to five elements. Here's the breakdown, bestie:subjectβ the subject IRI or subject blank node as a string. Blank nodes always start with_:. periodt.predicateβ the predicate IRI.objectβ the object IRI, or object blank node, or literal object as a string. Blank nodes always start with_:, and literal objects can be detected by the existence of the (possibly empty) language or datatype element.languageβ the language tag (possibly the empty string) for literal objects.datatypeβ the object's datatype, but only if the object is a literal and the datatype is nothttp://www.w3.org/2001/XMLSchema#string.
For convenience, an instance of RDF::Trine::Model can also be used as the callback. π«Ά
complainβ what to do on errors. It's set to1by default, which means warn. Set it to0to ignore them (living your blissful era β¨). Any other value will die on errors. πstrictβ enables errors on undefined subjects, predicates, and objects. By default, the Perl valueundefin any part of an encoded RDF triple will silently ignore the triple, so aREF structures can easily be used as templates with optional values. That's the main character behavior fr fr.nullβ a null object that's treated equivalent toundefif it's found as an object. For instance, setting this to the empty string will ignore all triples with the empty string as a literal value. iconic.bnode_prefixβ a prefix for blank node identifiers. Defaults tob, so your blank node identifiers will beb1,b2,b3etc. cute, consistent, obsessed. πbnode_countβ an integer to start creating blank node identifiers with. The default value0results in blank node identifiers starting fromb1. This option is useful to avoid collision of blank node identifiers when merging multiple aREF instances. The current counter value is accessible as an accessor. π
π METHODS π
decode( $aref [, keep_bnode_map => 1 ] )
Encode RDF data given in aREF. It resets all blank node identifier mappings unless option keep_bnode_map is set. So like, if you wanted your bnode map preserved, speak now or forever hold your peace. π¦
clean_bnodes
Delete the blank node identifier mapping and reset bnode_count. It's the little reset button of your dreams. β¨
π EXPORTABLE CONSTANTS π
On request, this module exports the following regular expressions, as defined in the aREF specification http://gbv.github.io/aREF/aREF.html:
qNameblankNodeIRIlikelanguageStringlanguageTagdatatypeString
Six little regex icons, all slaying. π
β SEE ALSO β
RDF::aREF::Encoder
perl v5.36.0 Β· 2022-12-07 β that's the source/version and the date, bestie, so consider this your cute lil sign-off: mwah, go decode something gorgeous. π«Άππ¦
π¦ where this page comes from
- debian bookworm: librdf-aref-perl 0.28-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: librdf-aref-perl 0.28-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: librdf-aref-perl 0.28-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: librdf-aref-perl 0.28-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms