W3C home > Mailing lists > Public > www-archive@w3.org > August 2001

quick snapshot of rdfquery soap client (perl)

From: Dan Brickley <danbri@w3.org>
Date: Mon, 6 Aug 2001 12:08:26 -0400 (EDT)
To: <www-archive@w3.org>
Message-ID: <Pine.LNX.4.30.0108061208000.15857-100000@tux.w3.org>

#!/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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:17:13 GMT