Toby Inkster > RDF-Query-Functions-Buzzword-Util > RDF::Query::Functions::Buzzword::Util

Download:
RDF-Query-Functions-Buzzword-Util-0.003.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.003   Source  

NAME ^

RDF::Query::Functions::Buzzword::Util - plugin for buzzword.org.uk utility functions

SYNOPSIS ^

  use RDF::TrineX::Functions -shortcuts;
  
  my $data = rdf_parse(<<'TURTLE', type => 'turtle', base => $base_uri);
  @prefix foaf: <http://xmlns.com/foaf/0.1/> .
  @prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
  
  <http://tobyinkster.co.uk/#i>
    foaf:name "Toby Inkster" ;
    foaf:page [ foaf:name "Toby Inkster" ] ;
    foaf:junk "Foo <ex xmlns=\"urn:junk\">Bar</ex>"^^rdf:XMLLiteral ;
    foaf:mbox <mailto:tobyink@cpan.org> .
  TURTLE
  
  my $query = RDF::Query->new(<<'SPARQL');
  PREFIX foaf: <http://xmlns.com/foaf/0.1/>
  PREFIX util: <http://buzzword.org.uk/2011/functions/util#>
  PREFIX junk: <urn: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 $query->execute($data)->as_xml;

DESCRIPTION ^

This is a plugin for RDF::Query providing a number of extension functions.

Some of these are somewhat close to new functions introduced in SPARQL 1.1.

SEE ALSO ^

RDF::Query.

http://www.perlrdf.org/.

AUTHOR ^

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT ^

Copyright 2010-2012 Toby Inkster

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: