sample SOAP RDF query client in Python

Dan Brickley daniel.brickley at b...
Wed Aug 8 20:45:23 UTC 2001

A quick demo of rdfquery over soap, this time in Python (see #rdfig logs
for Perl, Java-in-progress).

thanks to Aaron for help with the Python learning curve :)

Inspired by
I tried the library. Below is a sample script that talks to my
experimental rdf query SOAP service.


---------- Forwarded message ----------
Date: Wed, 8 Aug 2001 22:45:00 +0100
To: danbri at r...

# experimental rdf query client in SOAP
# By danbri at w... with help from Aaron Swartz

import SOAP

query = """SELECT ?x, ?title, ?a, ?moddate, ?createddate, ?name, ?creatormail
(dc::title ?x ?title)
(dcq::abstract ?x ?a)
(dcq::modified ?x ?m)
(dcq::created ?x ?cd)
(rdf::value ?m ?moddate)
(rdf::value ?cd ?createddate)
(dc::creator ?x ?cr)
(vcard::FN ?cr ?name)
(vcard::EMAIL ?cr ?creatormail)
USING dcq for 
rdf for 
vcard for 
dc for"""

data = """""";

server = SOAP.SOAPProxy("",
namespace = "")

rs = server.squish(query, data)

# print "result set is ", rs

for row in rs:
for item in row._asdict.items():
print item[0] + ':' + item[1]

# TODO: need to look into how we want the server
# to serialise hashes, and how deals with these, compared to java
# and perl implementations
# see also:
# from
# Article at
# related hacks:
# sean's python stuff

More information about the foaf-dev mailing list