| Home | Trees | Index | Help |
|---|
| Package rdflib :: Module Collection :: Class Collection |
|
object --+
|
Collection
>>> listName = BNode() >>> g = Graph('IOMemory') >>> listItem1 = BNode() >>> listItem2 = BNode() >>> g.add((listName,RDF.first,Literal(1))) >>> g.add((listName,RDF.rest,listItem1)) >>> g.add((listItem1,RDF.first,Literal(2))) >>> g.add((listItem1,RDF.rest,listItem2)) >>> g.add((listItem2,RDF.rest,RDF.nil)) >>> g.add((listItem2,RDF.first,Literal(3))) >>> c=Collection(g,listName) >>> print list(c) [long(1), long(2), long(3)] >>> 1 in c True >>> len(c) 3 >>> c._get_container(1) == listItem1 True >>> c.index(Literal(2)) == 1 True
| Method Summary | |
|---|---|
__init__(self,
graph,
uri,
seq)
| |
... | |
TODO | |
Iterator over items in Collections | |
length of items in collection. | |
TODO | |
append(self,
item)
| |
clear(self)
| |
Returns the 0-based numerical index of the item in the list | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
| Method Details |
|---|
__delitem__(self,
key)
...
|
__getitem__(self,
key)
TODO
|
__iter__(self)Iterator over items in Collections |
__len__(self)
length of items in collection.
|
__setitem__(self,
key,
value)
TODO
|
index(self, item)Returns the 0-based numerical index of the item in the list |
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Mon Oct 23 14:11:25 2006 | http://epydoc.sf.net |