Make compatbile with rdflib and python 2/3