Module ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults ListLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BoolOpOr NameLoad Call NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BinOpMod Str Call AttributeLoad Str attr ListComp Call AttributeLoad NameLoad attr comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assert Call NameLoad NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore Num While CompareLt NameLoad NameLoad body AugAssignAdd NameStore Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Break Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Num Assign NameStore Call NameLoad For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Assert CompareNotIn NameLoad NameLoad BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Num While NameLoad body If CompareIn TupleLoad NameLoad AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body Return NameLoad orelse Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr AugAssignAdd NameStore Num If CompareEq NameLoad ListLoad AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr orelse If UnaryOpNot NameLoad body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr orelse Assert CompareEq Call NameLoad NameLoad Num BinOpMod Str AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr If NameLoad body Return NameLoad orelse Raise NameLoad NameLoad orelse Raise NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad AttributeLoad NameLoad attr NameLoad orelse Raise NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr SubscriptLoad NameLoad Index NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert NameLoad If BoolOpAnd CompareEq Call NameLoad NameLoad Num CompareGt NameLoad Num body Pass orelse If CompareEq NameLoad BinOpSub Call NameLoad NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr BinOpSub NameLoad Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr BinOpSub NameLoad Num Assert BoolOpAnd NameLoad NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr While NameLoad body If CompareEq NameLoad AttributeLoad NameLoad attr body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad Break orelse If CompareNotEq NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr If UnaryOpNot CompareEq NameLoad AttributeLoad NameLoad attr body Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr While NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad decorator_list decorator_list FunctionDef arguments args defaults body Import alias Expr Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Expr Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call NameLoad NameLoad Call NameLoad Assert CompareEq Call NameLoad NameLoad Num Assign NameStore Call NameLoad NameLoad Call NameLoad ListLoad Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Assert CompareEq Call NameLoad NameLoad Num Assert CompareEq SubscriptLoad NameLoad Index Num Call NameLoad Str SubscriptLoad NameLoad Index Num Delete SubscriptDel NameLoad Index Num Assert CompareEq Call NameLoad NameLoad ListLoad Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad NameLoad TryExcept body Delete SubscriptDel NameLoad Index Num handlers ExceptHandler type NameLoad name NameStore body Pass Expr Call AttributeLoad NameLoad attr Call NameLoad Str Print Call NameLoad NameLoad For NameStore NameLoad body Print NameLoad Delete SubscriptDel NameLoad Index Num Expr Call AttributeLoad NameLoad attr Assert CompareEq Call NameLoad NameLoad Num
N/A rdflib.namespace RDF rdflib.term BNode rdflib.term Literal rdflib.graph Graph Collection N/A object N/A N/A 
    See 3.3.5 Emulating container types: http://docs.python.org/ref/sequence-types.html#l2h-232

    >>> from rdflib.graph import Graph    
    >>> 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)
    [rdflib.term.Literal(u'1', datatype=rdflib.term.URIRef('http://www.w3.org/2001/XMLSchema#integer')), rdflib.term.Literal(u'2', datatype=rdflib.term.URIRef('http://www.w3.org/2001/XMLSchema#integer')), rdflib.term.Literal(u'3', datatype=rdflib.term.URIRef('http://www.w3.org/2001/XMLSchema#integer'))]
    >>> 1 in c
    True
    >>> len(c)
    3
    >>> c._get_container(1) == listItem1
    True
    >>> c.index(Literal(2)) == 1
    True
     __init__ N/A N/A self graph uri seq N/A N/A N/A N/A N/A self graph graph N/A N/A self uri N/A uri N/A BNode N/A item seq N/A N/A N/A N/A self append item N/A n3 N/A N/A self N/A N/A N/A 
        >>> from rdflib.graph import Graph    
        >>> 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 c.n3()
        ( "1"^^<http://www.w3.org/2001/XMLSchema#integer> "2"^^<http://www.w3.org/2001/XMLSchema#integer> "3"^^<http://www.w3.org/2001/XMLSchema#integer> )
         N/A N/A ( %s ) N/A N/A join N/A N/A N/A i n3 N/A i self N/A _get_container N/A N/A self index N/A N/A N/A Gets the first, rest holding node at index. N/A N/A isinstance index int N/A graph N/A self graph N/A container N/A self uri N/A i 0 N/A N/A i index N/A N/A i 1 N/A container N/A N/A graph value container N/A RDF rest N/A N/A container None N/A N/A N/A container N/A __len__ N/A N/A self N/A N/A N/A length of items in collection. N/A count 0 N/A links N/A set N/A item N/A N/A N/A self graph items N/A self uri N/A N/A N/A item links N/A There is a loop in the RDF list! (%s has been processed before) item N/A N/A N/A links add item N/A count 1 N/A count N/A index N/A N/A self item N/A N/A N/A 
        Returns the 0-based numerical index of the item in the list          
         N/A listName N/A self uri N/A index 0 N/A True N/A N/A N/A N/A listName N/A RDF first item N/A self graph N/A N/A index N/A N/A newLink N/A list N/A N/A N/A self graph objects listName N/A RDF rest N/A index 1 N/A N/A newLink N/A N/A RDF nil N/A N/A N/A ValueError N/A %s is not in %s N/A item N/A self uri N/A N/A N/A newLink N/A N/A N/A Exception N/A Malformed RDF Collection: %s N/A self uri N/A N/A N/A N/A len newLink 1 N/A Malformed RDF Collection: %s N/A self uri N/A listName N/A newLink N/A 0 N/A __getitem__ N/A N/A self key N/A N/A N/A TODO N/A c N/A N/A self _get_container key N/A c N/A N/A v N/A N/A N/A self graph value c N/A RDF first N/A v N/A N/A v N/A N/A KeyError key N/A N/A IndexError key N/A __setitem__ N/A N/A self key value N/A N/A N/A TODO N/A c N/A N/A self _get_container key N/A c N/A N/A N/A N/A N/A self graph add N/A c N/A RDF first value N/A N/A IndexError key N/A __delitem__ N/A N/A self key N/A N/A N/A 
        >>> from rdflib.namespace import RDF, RDFS
        >>> from rdflib import Graph
        >>> from pprint import pformat
        >>> g=Graph()
        >>> a=BNode('foo')
        >>> b=BNode('bar')
        >>> c=BNode('baz')
        >>> g.add((a,RDF.first,RDF.type))
        >>> g.add((a,RDF.rest,b))
        >>> g.add((b,RDF.first,RDFS.label))
        >>> g.add((b,RDF.rest,c))
        >>> g.add((c,RDF.first,RDFS.comment))
        >>> g.add((c,RDF.rest,RDF.nil))
        >>> len(g)
        6
        >>> def listAncestry(node,graph):
        ...   for i in graph.subjects(RDF.rest,node): 
        ...     yield i
        >>> [str(node.n3()) for node in g.transitiveClosure(listAncestry,RDF.nil)]
        ['_:baz', '_:bar', '_:foo']
        >>> lst=Collection(g,a)
        >>> len(lst)
        3
        >>> b==lst._get_container(1)
        True
        >>> c==lst._get_container(2)
        True
        >>> del lst[1]
        >>> len(lst)
        2
        >>> len(g)
        4
        
         N/A N/A self N/A key N/A graph N/A self graph N/A current N/A N/A self _get_container key N/A current N/A N/A N/A N/A len self 1 N/A key 0 N/A N/A N/A N/A N/A key N/A N/A len self 1 N/A N/A priorLink N/A N/A self _get_container N/A key 1 N/A N/A N/A N/A self graph set N/A priorLink N/A RDF rest N/A RDF nil N/A N/A N/A graph remove N/A current None None N/A N/A next N/A N/A self _get_container N/A key 1 N/A prior N/A N/A self _get_container N/A key 1 N/A N/A next prior N/A N/A N/A graph remove N/A current None None N/A N/A N/A graph set N/A prior N/A RDF rest next N/A __iter__ N/A N/A self N/A N/A N/A Iterator over items in Collections N/A N/A N/A N/A self graph items N/A self uri N/A append N/A N/A self item N/A N/A N/A 
        >>> from rdflib.graph import Graph    
        >>> listName = BNode()
        >>> g = Graph()
        >>> c=Collection(g,listName,[Literal(1),Literal(2)])
        >>> links = [list(g.subjects(object=i,predicate=RDF.first))[0] for i in c]
        >>> len([i for i in links if (i,RDF.rest,RDF.nil) in g])
        1
        
         N/A container N/A self uri N/A graph N/A self graph N/A rest N/A N/A graph value container N/A RDF rest N/A rest N/A N/A N/A rest N/A RDF nil N/A N/A node N/A BNode N/A N/A N/A graph set N/A container N/A RDF rest node N/A container node N/A N/A N/A N/A container N/A self uri N/A N/A rest N/A N/A graph value rest N/A RDF rest N/A N/A N/A rest N/A RDF nil N/A N/A container rest N/A N/A N/A graph add N/A container N/A RDF first item N/A N/A N/A graph add N/A container N/A RDF rest N/A RDF nil N/A clear N/A N/A self N/A N/A N/A container N/A self uri N/A graph N/A self graph N/A container N/A N/A rest N/A N/A graph value container N/A RDF rest N/A N/A N/A graph remove N/A container N/A RDF first None N/A N/A N/A graph remove N/A container N/A RDF rest None N/A container rest N/A N/A test N/A N/A N/A N/A N/A doctest N/A N/A N/A doctest testmod N/A N/A N/A __name__ __main__ N/A N/A N/A test N/A g N/A Graph N/A c N/A Collection g N/A BNode N/A N/A N/A len c 0 N/A c N/A Collection g N/A BNode N/A N/A Literal 1 N/A Literal 2 N/A Literal 3 N/A Literal 4 N/A N/A N/A len c 4 N/A N/A N/A c N/A 1 N/A Literal 2 N/A c N/A 1 N/A N/A c N/A 1 N/A N/A N/A list c N/A N/A Literal 1 N/A Literal 3 N/A Literal 4 N/A list c N/A N/A N/A N/A c N/A 500 N/A N/A N/A IndexError N/A i N/A N/A N/A N/A N/A c append N/A Literal 5 N/A N/A list c N/A i c N/A N/A i N/A N/A c N/A 3 N/A N/A N/A c clear N/A N/A N/A len c 0