RDFLib/rdflib — Issue #50: graph.query should return collections.namedtuple
Author: gjhiggins
Created: 2012-02-20 08:31:27+00:00
State: closed

drewpca, 2009-03-24T00:09:05.000Z

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.

Comment 1 by eik...@gmail.com

Comment 2 by eik...@gmail.com

Comment 3 by eik...@gmail.com
These issues involve bits that have been moved out of rdflib proper for now. We will re-open them
or move them to rdfextas as appropriate.