-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Running sparql queries is actually much easier:
from rdflib.Graph import Graph
g=Graph()
# add some data. ...
res=g.query("SELECT ?x WHERE { ?x ?y ?z. }")
res is now iterable over a tuple of variable bindings, and res also has methods
for doing json, xml, etc. and also variable names.
Easy!
- - Gunnar
Jeroen van der Ham wrote:
> Hi all,
>
> Today I tried to update some old code I had lying around that was built
> using an older version of rdflib, and used rdflib.sparql.SPARQLGraph().
>
> I have not yet managed to update all my code, but looking at examples
> and bare documentation so far has led me to one conclusion:
>
> Could you please, pretty please, have a look at how you structure the
> module, do a complete overhaul and release this as version 2.5 or something?
>
> To me, the following seems broken:
>
>>>> import rdflib.Graph
>>>> rdflib.Graph.Graph()
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> AttributeError: type object 'BackwardCompatGraph' has no attribute 'Graph'
>>>> from rdflib.Graph import Graph
>>>> Graph()
> <Graph identifier=aHJJWZSf0 (<class 'rdflib.Graph.Graph'>)>
>
> And having to do this:
> import rdflib.sparql.sparqlGraph
> import rdflib.sparql.graphPattern
> import rdflib.sparql.Query
>
> To be able to run sparql queries seems a bit strange as well. Why can't
> I just import rdflib.sparql and be done with it?
>
> Jeroen.
> _______________________________________________
> Dev mailing list
> [email protected]
> http://rdflib.net/mailman/listinfo/dev
- --
Gunnar Aastrand Grimnes
gunnar.grimnes [AT] dfki.de
DFKI GmbH
Knowledge Management
Trippstadter Strasse 122
D-67663 Kaiserslautern
Germany
Office: +49 631 205 75-117
Mobile: +49 177 277 4397
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGscmIfD15aMgAOfcRAiFxAKDPCfGo3XpaF04bK6K28fbRg7itPwCggw4f
dXWaduwiEIdEeAmWI7TPuks=
=uDj1
-----END PGP SIGNATURE-----
_______________________________________________
Dev mailing list
[email protected]
http://rdflib.net/mailman/listinfo/dev