pre-binding results in RDF::Query

Toby Inkster mail at tobyinkster.co.uk
Wed Jun 9 17:50:58 CEST 2010


Greg, there seems to be support for something like this in RDF::Query:

	$sparql = <<SPARQL;
	PREFIX foaf: <http://xmlns.com/foaf/0.1/>
	SELECT *
	WHERE { ?person foaf:name ?name . }
	SPARQL
	
	$query = RDF::Query->new($sparql);
	$result = $query->execute($model,
		bind => {
		  name => RDF::Trine::Node::Literal->new('Bob')
		});

It works, but I only discovered it by chance as it doesn't seem to be
documented anywhere. Can this be documented as it's super awesome!

-- 
Toby A Inkster
<mailto:mail at tobyinkster.co.uk>
<http://tobyinkster.co.uk>



More information about the Dev mailing list