#!/usr/bin/perl -w

use SOAP::Lite;

my $query = '
SELECT ?x, ?l, ?c
FROM     http://xmlns.com/wordnet/1.6/Job 
WHERE 
  (web::type ?x rdfs::Class) 
  (rdfs::label ?x ?l) 
  (rdfs::description ?x ?c) 
USING web FOR http://www.w3.org/1999/02/22-rdf-syntax-ns#
       rdfs FOR http://www.w3.org/2000/01/rdf-schema#
';

my $data = 'http://xmlns.com/wordnet/1.6/Job';

my $soap = SOAP::Lite            
  -> uri('http://rdfweb.org/RDF/RDFWeb/SOAPDemo')               
  -> proxy('http://fireball.dyndns.org/cgi-bin/soap');

#my $r = $soap->squish2algae($query, $data)->result(); # works :)
#my $r = $soap->textsquish($query, $data)->result(); # works :)
my $r = $soap->squish($query, $data)->result(); # get resultset

print "Result is $r \n\n"; 		

my @res = @{$r};

foreach my $row (@res) {
  my %h = %{$row } ;
  foreach (keys %h) {
	print " $_ -> ", $h{$_}, " \n";
  }
}
