NAME
RDF::Query::Functions::Buzzword::Util - plugin for buzzword.org.uk
utility functions
SYNOPSIS
use RDF::TrineShortcuts qw[:all];
use Data::Dumper;
my $data = rdf_parse(<<'TURTLE', type=>'turtle');
@prefix foaf: .
@prefix rdf: .
foaf:name "Toby Inkster" ;
foaf:page [ foaf:name "Toby Inkster" ] ;
foaf:junk "Foo Bar"^^rdf:XMLLiteral ;
foaf:mbox .
TURTLE
$r = rdf_query(<<'SPARQL', $data);
PREFIX foaf:
PREFIX util:
PREFIX junk:
SELECT
?name
(util:uc(?name) AS ?ucname)
(util:trim(util:sprintf(" I am %s "@en, ?name)) AS ?intro)
(util:skolem(?page, "oid") AS ?skolempage)
(util:preg_replace("t", "x", ?name, "ig") AS ?mangled)
(util:find_xpath("//junk:ex", ?junk, 0) AS ?found)
WHERE
{
?person foaf:name ?name ; foaf:page ?page ; foaf:junk ?junk.
}
SPARQL
print Dumper(flatten_iterator($r, literal_as=>'ntriples'));
DESCRIPTION
This is a plugin for RDF::Query providing a number of extension
functions.
* http://buzzword.org.uk/2011/functions/util#defragment
* http://buzzword.org.uk/2011/functions/util#find_xpath
* http://buzzword.org.uk/2011/functions/util#lc
* http://buzzword.org.uk/2011/functions/util#ltrim
* http://buzzword.org.uk/2011/functions/util#oid
* http://buzzword.org.uk/2011/functions/util#oid_uri
* http://buzzword.org.uk/2011/functions/util#preg_replace
* http://buzzword.org.uk/2011/functions/util#rand
* http://buzzword.org.uk/2011/functions/util#rtrim
* http://buzzword.org.uk/2011/functions/util#skolem
* http://buzzword.org.uk/2011/functions/util#sprintf
* http://buzzword.org.uk/2011/functions/util#str_replace
* http://buzzword.org.uk/2011/functions/util#trim
* http://buzzword.org.uk/2011/functions/util#uc
* http://buzzword.org.uk/2011/functions/util#uuid
* http://buzzword.org.uk/2011/functions/util#uuid_uri
SEE ALSO
RDF::Query.
.
AUTHOR
Toby Inkster .
COPYRIGHT
Copyright 2010-2011 Toby Inkster
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.