From a972e7beacee9b56611ea3a9bf85a4bcdb98f05b Mon Sep 17 00:00:00 2001 From: William Waites Date: Thu, 19 Jan 2017 12:23:16 +0000 Subject: [PATCH] remove incorrect check in container for rdf:List that prevents duplicate elements --- rdflib/collection.py | 3 --- test/test_issue223.py | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) 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()