Hi all,
some not so quick updates on the verioning front, as well as
a request for feedback on the following.
So far the early prototype has getfeature, getlog, getdiff
and rollback working, so it's ready to be tested by a wider
audience. If you're interested, follow instructions here:
http://docs.codehaus.org/display/GEOS/Trying+out+the+early+WFS-V+prototype
Yet, quite a bit or work still needs to be done on the response
side of the equations, as well as some thinking.
GetFeature is able to properly answer queries that do use featureVersion, allowing revision specific extraction (point in
time extraction is still not there, but easy to add).
The issue here is that we can have multiple queries, all hitting
the same features, but at different revisions, resulting in duplicated
features in the output. Well, not really duplicated, but same feature
at different revision without the ability to tell which version is which.
Here my suggestion is to create a new VersionedFeature element, same substition group as gml:Feature, but sporting a featureVersion attribute . We can activate generation of those features only if the version is different than the latest one. Code wise, it means we need a Feature subclass that has this attribute (may be a straight subclass, or a wrapper). There is also the question on where we do use that: shall the versioned data store always answer with these special features, or do we handle this inside the wfs Transaction code? The answer is not trivial,
since when you make queries on the datastore you specify the revision you're asking for, so you know what you get.
On the other side, knowing the verison you get is a by product of the
svn-like behaviour, that is, all features you get are at the revision
you asked for. If you do the same with a cvs like approach, with a point in time query, you would get features at different versions.
Rollback is just a new element in the transaction call, and it's ok response wise, that is, provides a correct record of features
that have been updated, deleted and inserted as a result of the rollback. The fids are preserved, that is, if a deletion is rolled back, the re-created feature will have the same fid as before deletion.
The issue here is that at the current stage rollback does not support user filtering, and works only if the fromVersion is the current one.
Having a fromVersion different than the latest one effectively
turns rollback into a merge operation, and raises the question or
what to do with deleted features: what if the deleted feature has already been restored? The diff tells us to create it, but it's already there. Moreover, having the ability to specify from and to version
means that people could ask to merge a forward diff.
So, in the end, it seems that if we go that way, rollback can be
thrown away, and replaced by a merge instead. In fact, that's what
we're using with subversion, that is, we only do merges, some or which
can be thought as rollbacks. Merge could in fact be asked to be fid
preserving with a new attributes, if the fid is already there, no big issues, we just have to fail the transaction.
GetDiff and GetLog are good, in that the response is correct and complete afaik, thought it's not really human readable.
GetDiff provides a proper wfs:Transaction as a response, it's the transaction you should run to go from version x to version y (and works both forwards and backwards, that is, both if x < y and if x > y).
GetLog provides a GML2 response.
Both could use a more human oriented answer, that I plan to add
when all calls have at least one fully working response.
If you have suggestions on this, I'm all ears (and eyes :-))
Finally, versioning would not be complete if the WMS side of the equation is not filled as well. I plan to add a VERSION attribute to the GetMap request, that would be a list of featureVersion specs.
This would allow for visual diffs and the like: just request two
times the same layer, at different revision, and eventually use filter
to gather exactly the features you want to look at.
This also raises the question on how to do the same with GetMap post requests, we'll have to extend the GetMap syntax there to allow for
revision specification... at the moment, each layer can have a filter,
but that won't include the revision. This stinks a little, because we would have to extend the SLD portion of the GetMap request
Once all of this is fixed, we'll have to think about authentication and the client side of the equation.
Well, suggestions, comments, feedback in general would be very welcomed.
Cheers
Andrea