RDF::aREF::Decoder->new( %options )->decode( $aref );
DESCRIPTIONThis module implements a decoder from another RDF Encoding Form (aREF), given as in form of Perl arrays, hashes, and Unicode strings, to RDF triples.
nsA default namespace map, given either as hash reference or as version string of module RDF::NS. Set to the most recent version of RDF::NS by default, but relying on a default value is not recommended!
callbackA code reference that is called for each triple with a list of three to five elements:
- The subject IRI or subject blank node as string. Blank nodes always start with "_:".
- The predicate IRI.
- The object IRI or object blank node or literal object as string. Blank nodes always start with "_:" and literal objects can be detected by existence of the (possibly empty) language or datatype element.
- The language tag (possible the empty string) for literal objects.
- The object's datatype if object is a literal and datatype is not "http://www.w3.org/2001/XMLSchema#string".
For convenience an instance of RDF::Trine::Model can also be used as callback.
complainWhat to do on errors. Set to 1 be default (warn). Set to 0 to ignore. Other values will die on errors.
strictEnables 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.
nullA null object that is treated equivalent to "undef" if found as object. For instance setting this to the empty string will ignore all triples with the empty string as literal value.
bnode_prefixA prefix for blank node identifiers. Defaults to ``b'', so blank node identifiers will be ``b1'', ``b2'', ``b3'' etc.
bnode_countAn integer to start creating blank node identifiers with. The default value ``0'' results in blank node identifiers starting from ``b1''. This option can be useful to avoid collision of blank node identifiers when merging multiple aREF instances. The current counter value is accessible as accessor.
decode( $aref [, keep_bnode_map => 1 ] )Encode RDF data given in aREF. Resets all blank node identifier mappings unless option c<keep_bnode_map> is set.
clean_bnodesDelete blank node identifier mapping and reset bnode_count.
EXPORTABLE CONSTANTSOn request this module exports the following regular expressions, as defined in the aREF specification <http://gbv.github.io/aREF/aREF.html>: