#!/usr/bin/perl
use strict;
package testRdfParser;
use W3C::Util::Exception;
use W3C::Rdf::RdfApp;
use vars qw(@ISA);
@ISA = qw(W3C::Rdf::RdfApp);

eval {
    my $tester = new testRdfParser;
    $tester->execute(\@ARGV);
}; if ($@) {if (my $ex = &catch('W3C::Util::Exception')) {
	die $ex->toString;
    } else { die $@; }
}

sub render {
    my ($self) = @_;
    my $queryHandler = $self->{RDF_DB}->getAlgaeInterface;

    foreach my $query (@{$self->{ARGS}{-algae}}) {
	my ($nodes, $selects, $messages, $proofs) = $queryHandler->algae($query, undef, {-uniqueResults => 1});
	my $rows = @$nodes;
	print "\"$query\" got $rows rows.\n";
    }
}

# ./simpleRdfApp.pm ../test/medium.rdf -a"(ask '((?p ?s ?o)) collect '(?p ?s ?o))"

