import rdflib """ In py3, some objects are not comparable. When the turtle serializer tries to sort them everything breaks. * Timezone aware datetime objects and "naive" datetime objects are not comparable https://github.com/RDFLib/rdflib/issues/648 https://github.com/RDFLib/rdflib/issues/613 * DocumentFragment https://github.com/RDFLib/rdflib/issues/676 """ def test_sort_dates(): g = rdflib.Graph() y = """@prefix ex: . ex:X ex:p "2016-01-01T00:00:00"^^, "2016-01-01T00:00:00Z"^^ . """ p = g.parse(data=y, format="turtle") p.serialize(format="turtle") def test_sort_docfrag(): g = rdflib.Graph() y = """@prefix ex: . @prefix rdf: . ex:X ex:p "

hi

"^^rdf:HTML, "

ho

"^^rdf:HTML . """ p = g.parse(data=y, format="turtle") p.serialize(format="turtle") if __name__ == "__main__": test_sort_docfrag()