RDF::AREF(3PM) - Linux man page online | Library functions

Another RDF Encoding Form.

RDF::aREF(3pm) User Contributed Perl Documentation RDF::aREF(3pm)


RDF::aREF - Another RDF Encoding Form


use RDF::aREF; my $rdf = { _id => '', foaf_name => 'Alice Smith', foaf_age => '42^xsd_integer', foaf_homepage => [ { _id => '', dct_modified => '2010-05-29^xsd_date', }, '', ], foaf_knows => { dct_description => 'a nice guy@en', }, }; decode_aref( $rdf, callback => sub { my ($subject, $predicate, $object, $language, $datatype) = @_; ... } ); my @lastmod = aref_query $rdf, 'foaf_homepage.dct_modified^'; my $model = RDF::Trine::Model->new; decode_aref( $rdf, callback => $model ); print RDF::Trine::Serializer->new('Turtle')->serialize_model_to_string($model); my $model = RDF::Trine::Model->new; RDF::Trine::Parser->parse_url_into_model($url, $model); my $aref = encode_aref $model;


aREF (another RDF Encoding Form <>) is an encoding of RDF graphs in form of arrays, hashes, and Unicode strings. This module provides methods for decoding from aREF data to RDF triples (RDF::aREF::Decoder), for encoding RDF data in aREF (RDF::aREF::Encoder), and for querying parts of an RDF graph (RDF::aREF::Query).


The following functions are exported by default. decode_aref $aref [, %options ] Decodes an aREF document given as hash reference with RDF::aREF::Decoder. Equivalent to "RDF::aREF::Decoder->new(%options)->decode($aref)". encode_aref $graph [, %options ] Construct an aREF subject mapfrom an RDF graph. The RDF::aREF::Encoder for possible options. The $graph can be supplied as: · instance of RDF::Trine::Model · instance of RDF::Trine::Model::Iterator · an URL or a filename (only if RDF::Trine is installed) · instance of Attean::API::TripleIterator (experimental) · instance of Attean::API::TripleStore (experimental) · hash reference with RDF/JSON <> format (as returned by method "as_hashref" in RDF::Trine::Model) aref_query $graph, [ $origin ], @queries Query parts of an aREF data structure by aREF query expressions <> and return a list. See RDF::aREF::Query for details. aref_query_map( $graph, [ $origin ], $query_map ) Map parts of an aREF data structure to a flat key-value structure.


· aREF is specified at <>. · See Catmandu::RDF for an application of this module. · Usee RDF::Trine for more elaborated handling of RDF data in Perl. · See RDF::YAML for a similar (outdated) RDF encoding in YAML.
Copyright Jakob Voss, 2014- This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.24.1 2016-12-15 RDF::aREF(3pm)
Download raw manual
Main page User Contributed Perl Documentation (+23303) perl v5.24.1 (+3427) № 3 (+68044)
Go top