NAME
RDF::RDFa::Template::Unit - An individual graph pattern of an RDFa Template
SYNOPSIS
This class holds an individual graph pattern of an RDFa Template. This has several elements, a Basic Graph Pattern, a query endpoint and a graph name from the RDFa document.
$doc = RDF::RDFa::Template::Unit->new(triples => \@triples,
endpoint => 'http://dbpedia.org/sparql',
doc_graph => 'http://example.org/graph'
METHODS
new
The constructor. Takes three named arguments:
triples
-
An arrayref with RDF::Trine::Statements, or subclasses thereof.
endpoint
-
A SPARQL endpoint can optionally be set in the constructor.
doc_graph
-
A graph name for the document. TODO: Not used.
pattern
Will return an RDF::Query::Algebra::BasicGraphPattern object containing the Basic Graph Pattern of this unit.
endpoint
If no argument is given and the unit contains a SPARQL endpoint, this will be returned as a string. If a string argument is given, this will be used to set the endpoint URL.
results
Used to set and get a RDF::Trine::Iterator object that can be used to explore the query results for this unit.
To set the iterator, send a RDF::Trine::Iterator object as the only argument.
If no argument is given, this will return an RDF::Trine::Iterator object that can be used to explore the query results for this unit, or an empty hashref if no results are available.
AUTHOR
Kjetil Kjernsmo, <kjetilk at cpan.org>
COPYRIGHT & LICENSE
Copyright 2010 Kjetil Kjernsmo.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.