diff --git a/rdflib/collection.py b/rdflib/collection.py index 14351f95b..3983c1758 100644 --- a/rdflib/collection.py +++ b/rdflib/collection.py @@ -85,9 +85,6 @@ def __len__(self): count = 0 links = set() for item in self.graph.items(self.uri): - assert item not in links, \ - "There is a loop in the RDF list! " + \ - "(%s has been processed before)" % item links.add(item) count += 1 return count diff --git a/test/test_issue223.py b/test/test_issue223.py index 378b7db0b..8a05da88a 100644 --- a/test/test_issue223.py +++ b/test/test_issue223.py @@ -12,6 +12,7 @@ def test_collection_with_duplicates(): for _,_,o in g.triples((URIRef("http://example.org/s"), URIRef("http://example.org/p"), None)): break c = list(Collection(g, o)) + assert c == list(URIRef("http://example.org/" + x) for x in ["a", "b", "a"]) if __name__ == '__main__': test_collection_with_duplicates()