Hi,
You can use default_world._unabbreviate() to translate these integer identifiers into the corresponding IRI, e.g.
>>> print(default_world._unabbreviate(6))
http://www.w3.org/1999/02/22-rdf-syntax-ns#typeBy the way, you may be interested by the new SPARQL engine (independent from RDFlib), introduced in version 0.30:
>>> print(list(default_world.sparql(query)))
[[6, 12], [6, a.Pizza], [a.has_topping, a.cheese1]]
Jiba