-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Sergio Fernández wrote: >> Look at the attached program (...) > > If you attach the file perhaps we could help you... ;-) >
That's not such a bad point :) I do this a lot. I wish thunderbird would not let me send a message without attachment if I mention the word "attach*" Thanks for the heads up, - - Gunnar -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGgDDhfD15aMgAOfcRAvC0AJ9Ftt8+lNDhZVOxyTQx5/3YC5dRzwCeLTES NtDKkEVUI4tizESMn5g93lE= =ekKm -----END PGP SIGNATURE-----
import StringIO import rdflib from rdflib.Graph import Graph g=Graph() g.parse(StringIO.StringIO(""" @prefix ex: <http://example.org/>. ex:x ex:p1 ex:a ; ex:p2 ex:b ; ex:p3 ex:c ; ex:p4 ex:d . """), format='n3') q=""" PREFIX ex: <http://example.org/> SELECT ?a ?b ?c ?d WHERE { ex:x ex:p1 ?a OPTIONAL { ?x ex:p2 ?b. }. OPTIONAL { ?x ex:p3 ?c. }. OPTIONAL { ?x ex:p4 ?d. }. } """ for l in g.query(q): print l
_______________________________________________ Dev mailing list Dev@rdflib.net http://rdflib.net/mailman/listinfo/dev