make container methods chainable
@@ -183,6 +183,8 @@ class Container(object):
self.graph.add((container, URIRef(elem_uri), item))
self._len += 1
+ return self
+
def append_multiple(self, other):
"""Adding multiple elements to the container to the end which are in python list other"""
@@ -196,6 +198,8 @@ class Container(object):
elem_uri = str(RDF) + "_" + str(end)
self.graph.add((container, URIRef(elem_uri), item))
+ return self
+
def clear(self):
"""Removing all elements from the container"""
@@ -210,6 +214,7 @@ class Container(object):
else:
break
self._len = 0
+ return self
class Bag(Container):
@@ -254,6 +259,7 @@ class Seq(Container):
elem_uri_pos = str(RDF) + "_" + str(pos)
self.graph.add((container, URIRef(elem_uri_pos), item))
self._len += 1
+ return self
class NoElementException(Exception):
