kasei/perlrdf — pull request #46 by kjetilk (2012-01-01 22:27:42+00:00)
Title: New store touch method updates etag

Hi! Happy new year!

I was thinking about a way to track changes for mtime in a way that could work OK for many stores with little effort.

So, I figured, perhaps a touch method would do. This could track mtimes for real, or just do like I did now, update an etag attribute to something. This could be a hash, but I figured, that is perhaps not even needed, so I just set it to time, i.e. seconds after epoch.

Implementations would have to do two things,

1) In the constructor, set $self->{etag} to something reasonable,
2) In every methods where updates are done, call $self->touch

I've done this in Hexastore's constructor and add_statement as an example. Do you think this will work OK?

I've added Time::HiRes as a dep, but that could be made optional if people would be content with resolution of a second.

So, I throw this at you for discussion, does this make sense?