The following of rdflib.Graph.Graph
def seq(self, subject): """Check if subject is an rdf:Seq If yes, it returns a Seq class instance, None otherwise. """ if (subject, RDF.type, RDF.Seq) in self: return Seq(self, subject) else: return None would make more sense if it were named collection not seq and tested for more than just RDF.Seq - I do this by looking for any type derived from RDFS.Container (which requires the schema definitions of these to be loaded into the graph), but even just testing for RDF.Seq, RDF.Bag, and RDF.Alt would be a good start. For backwards compatibility I imagine it would be better to add alt and bag as their own methods as well as a general collection interface. The same also goes for class Seq(object): """Wrapper around an RDF Seq resource .... The mechanism in here works fine for Alt and Bag also. If this makes sense, I don't mind adding in support for these. I have also developed support for rdf Collections (i.e. the first rest structure), which I could add in. cheers matt (a.k.a greenman on freenode) _______________________________________________ Dev mailing list Dev@rdflib.net http://rdflib.net/mailman/listinfo/dev