gjhiggins/rdfextras — Issue #5: graph.query should return collections.namedtuple
Author: gjhiggins
Created: 2011-10-19 02:58:19+00:00
State: open

Originally filed by gjhigg...@gmail.com on 2010-09-14T20:57:46

Migrated from rdflib issues, posted by drewpca

graph.query returns a sequence of tuples, but for almost no cost, and full
backward compatibility, they could be collections.namedtuple objects instead.

Then we can write code like this:

for row in graph.query("SELECT ?huge ?list ?of ?vars ..."):
print row.huge, row.vars
print repr(row) # nicer than before

I would expect unbound variables to still be in the tuple, as they are now.