RDF::a...ecoder(3pm)

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

✨ 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 module RDF::NS. It's set to the most recent version of RDF::NS by 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 not http://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 to 1 by default, which means warn. Set it to 0 to 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 value undef in 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 to undef if 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 to b, so your blank node identifiers will be b1, b2, b3 etc. cute, consistent, obsessed. πŸŽ€
  • bnode_count β€” an integer to start creating blank node identifiers with. The default value 0 results in blank node identifiers starting from b1. 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:

  • qName
  • blankNode
  • IRIlike
  • languageString
  • languageTag
  • datatypeString

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