There is a bunch of different articles out there on handling ordered lists in a triple store.
An ActivityStreams inbox is a
though after mostly getting list insertion working I ended up deciding entries
should always be added to the end. (The client can decide to re-order them, but
should always know which ones are newly added that way.) I preserved the other
Inbox.pm.snippet for this commit only.
I’ve poked around looking for list handling in the RDF::Trine libraries, with little success. RDF::Trine::Parser::Turtle, for instance, has some handling because Turtle syntax can pass lists. But because RTPT just returns the triples for the parsed Turtle, rather than adding items to an existing list in an existing store, it just does the most basic iteration over the list, adding the first/rest nodes. Which is one way of handling it: just delete all the nodes and re-create them every time an item is added or removed.
turns triples into lists, but again doesn’t have to do any modification of the
lists. RDF::Trine::Model has
remove_list; it also (wait for it…) treats lists
as all-or-nothing items.
All of which means I should either start treating lists that way myself, or else think about writing an RDF::Trine/X library for lists. Only… GWILLIAMS is moving from RDF::Trine over to Attean::, which eventually (when it’s stable and documented) I also will eventually do.
In other news: ironically it isn’t the Pi’s SD card throwing errors, it’s the spinner in my desktop machine. I still picked up a cheap 32GB thumb drive at Costco, and shifted the Wirebird directories onto it… including switching to SQLite in the data directory. Now rather than sshfs-mounting the shared directory, I’m physically carrying the drive back and forth between the Pi and desktop, which is less than ideal, but I do get to see the performance difference between the Pi and the desktop. It’s interesting, but I’ll probably move the directory to the desktop machine (sshfs-mounting it the other direction) once the spinner is replaced.