quick snapshot of rdfquery soap client (perl)

#!/usr/bin/perl -w

use SOAP::Lite;
my $term = shift || 'Car';
my $query ="
SELECT ?x, ?l, ?c
FROM     http://xmlns.com/wordnet/1.6/$term
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/$term";

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";
  }
}

Received on Monday, 6 August 2001 12:08:26 UTC