Quick to learn
Cecily toddled not only by herself, but stopped mid toddle (usually only walks to us then falls into our arms), turned around, and started up again. Boy this is going quick now!!!
Cecily toddled not only by herself, but stopped mid toddle (usually only walks to us then falls into our arms), turned around, and started up again. Boy this is going quick now!!!
I’ve been using sparta for my RDF serialization lately, and have come up with a useful patch. Turns out a frequent use case (for me, anyway) is getting all objects of a specific type.
I’ve found the following addition to ThingFactory does exactly what I want it to do:
def instancesOf(self, typeUri): return [self(s) in self.store.subjects(TYPE, URI(typeUri))]
What it’s doing is getting all objects in the store that have the given rdf:type. I use this all the time when hooking things up to the UI.
My usage looks like this:
def loadPeople(self, store): self.create = ThingFactory(store) people = self.create.instancesOf(example_person)
Powered by WordPress