RDF::aREF::Query - aREF query expression
my $rdf = { 'http://example.org/book' => { dct_creator => [ 'http://example.org/alice', 'http://example.org/bob' ] }, 'http://example.org/alice' => { foaf_name => "Alice" }, 'http://example.org/bob' => { foaf_name => "Bob" } }; my $getnames = RDF::aREF::Query->new( query => 'dct_creator.foaf_name' ); my @names = $getnames->apply( $rdf, 'http://example.org/boo' ); $getnames->query; # 'dct_creator.foaf_name' use RDF::aREF qw(aref_query_map); my $record = aref_query_map( $rdf, $publication, { 'dct_creator@' => 'creator', 'dct_creator.foaf_name' => 'creator', });
Implements aREF query, a query language to access strings and nodes from agiven RDF graph.
See also functions aref_query and aref_query_map in RDF::aREF for convenient application.
aref_query
aref_query_map
The constructor expects the following options:
aREF query expression
Instance of RDF::aREF::Decoder to map qNames to URIs. A new instance is created unless given.
Optional namespace map (RDF::NS), passed to the constructor of RDF::aREF::Decoder if no decoder is given.
Perform the query on a given RDF graph. The graph can be given as aREF structure (subject map or predicate map) or as instance of RDF::Trine::Model. An origin subject node must be provided unless the RDF graph is provided as predicate map.
Returns the aREF query expression
Use SPARQL for more complex queries, e.g. with RDF::Trine::Store::SPARQL.
To install RDF::aREF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RDF::aREF
CPAN shell
perl -MCPAN -e shell install RDF::aREF
For more information on module installation, please visit the detailed CPAN module installation guide.