DBD::RDFStore - Simple DBI driver for RDFStore using RDQL:Parser
use DBI;
# on the local disk
$dbh = DBI->connect( "DBI:rdfstore:database=cooltest", "user", "password" );
# on a remote dbmsd(8) server
$dbh = DBI->connect( "DBI:rdfstore:database=cooltest;host=localhost;port=1234", "user", "password" );
# or in the fly
$dbh = DBI->connect( "DBI:rdfstore", "user", "password" );
$sth = $dbh->prepare(<<QUERY);
SELECT
?title, ?link
FROM
<http://xmlhack.com/rss10.php>
WHERE
(?item, <rdf:type>, <rss:item>),
(?item, <rss::title>, ?title),
(?item, <rss::link>, ?link)
USING
rdf for <http://www.w3.org/1999/02/22-rdf-syntax-ns#>,
rss for <http://purl.org/rss/1.0/>
QUERY;
my $num_rows = $sth->execute();
print "news from XMLhack.com\n" if($num_rows == $sth->rows);
$sth->bind_columns(\$title, \$link);
while ($sth->fetch()) {
print "title=$title lin=$link\n";
};
$sth->finish();
DBI(3) RDQL::Parser(3) RDFStore(3)
Alberto Reggiori <areggiori@webweaving.org>