FYI (on this thread), I discovered that Ivan's rdflibUtils
'extensions' to rdflib might be worth taking a look at instead of
doing this from scratch:

http://dev.w3.org/cvsweb/~checkout~/2004/PythonLib-IH/Doc/public/rdflibUtils.myTripleStore.Container-class.html

As well some other graph operator implementations that should be
considered 'core' to Graph manipulation (Set theoretical
union/intersection/difference):

http://dev.w3.org/cvsweb/~checkout~/2004/PythonLib-IH/Doc/public/rdflibUtils.myTripleStore.myTripleStore-class.html

> It would probably make sense for this to be promoted to a top level
> utility class in Graph (Collection, perhaps) which has a constructor
> that mimics this  (with the default being an empty Collection) and
> overiddes for *all* Python container methods:
>
> __getitem__(self, k)
> __setitem__(self, k, value)
> _delitem__(self, k) <-- this could probably use an index function
> (same as lists)
> __contains__(self, elt)
> not __contains__(self, elt)
> __iter__(self)  <-- could probably port over Graph.items
> __len__(self)
>
> As well as append and extend.  I could write a test suite for such a
> class :) and it would be incredibly useful once implemented.d
>
_______________________________________________
Dev mailing list
[email protected]
http://rdflib.net/mailman/listinfo/dev

Reply via email to