[Geoserver-devel] [Geotools-devel] Versioning WFS-T and protocol extensions

Jody Garnett ha scritto:

Hi Andrea,

...

You are clear on your scope (and yes everyone's hopes ask for more, but I respect your decision to start small).

Datastore Desgin:

Data table:
- I was not going to assume the revisionCreated - revisionExpired columns; instead used to a single "revision" column that only becomes non 0 when it is replaced (so revision==0 always represents the "live" data). Having two columns is not bad, does having both help you ask for data in a specific range? Or could we get by with just a single column.

I could get by with a single column but at high performance price.
Let's assume instead of 0 I do use maxint, since it simplifies queries (
if I used 0, the query below would need a special case to handle features that do not have a min for the subquery...)
In order to extract what was live at version x I would have
to query for record with the lowest revision number bigger than x,
something like:

select *
from data d1
where d1.revision = (
   select min(revision)
   from data d2
   where d2.id = d1.id
   and d2.revision > x
)

which is a lot slower than the single table access I propose.

I'm doing performance tests now, to see how much performance I give
up by using my schema, especially on extracting the last revision, which
is the most common operation anyways.
I'll keep you posted on the results.

GetFeature
- so out of the box it returns the latest

I am a bit concerned that making the revision columns available messes up the origional schema (this simply will not work in the case where the schema is provided by a third party authority for example). Although this is not your use case (I recognize that) I am going to work through how it can be done:

Use getFeature with a vendor specific parameter describing the revision range.

The result of which is a GML document where the revision is either:
- part of the feature identifier
<Feature fid="people.fred.432456">..</Feature><Feature fid="people.wilma.432455">...</Feature>
- separate attribute on each feature (ie not element)
<Feature fid="people.fred" revision="432456">..</Feature><Feature fid="people.wilma" revision="432455">...</Feature> (preferred approach?)

By making the concept of revision available as an attribute the normal describeFeatureType method can provide the correct description as part of the schema - ie the exact revision range that will work.

Hmm... I hear ya, yet there are downsides:
* I would no more be able to query the feature type for a specific revision using a plain GetFeature. This could be done in a GetFeatureVersioning extra method instead (something we are thinking about anyways to expand what we can ask a version based system), but
forces an API change in the version datastore as well (since what I'm
looking for is not in the gt2 filters anymore, unless we expand the
filter and expression sets to cope... hum, what would you do in this
regard?).
* the first approach would make it hard to build a checkout, how do
   you know how to parse the revision out of the identifier?
* the second approach would require for a different GML producer, and
   for a place in DefaultFeature to describe the revision (there's
   none at the moment).

So, I'm really wondering, if the schema is mandated by an external authority, could we avoid messing with versioning and use the complex
data store instead to get the same result?

GetLog
- making it available as a normal feature is fine, collections support can be done if you need it.

Indeed, it's true... I just don't have any idea of how complex that would be and which GML producer we would need to use...

Transation:
- throwing errors out of Transaction is cool; consider any conflict to be the same as a locking conflict (ie the modification has been made by another so that feature is "locked")
- leave revision columns out of the describe feature type so that you do not have to worry about user's supplying the details...

See above, I would like to avoid that.

The Transaction "handle" is where your changelog message comes from. No additional extra attribute is needed from the Transaction element.

Did not thought about it, but this would be a way to bend the specification... The WFS 1.1, which is commented, says:

The handle attribute allows a client application
to assign a client-generated request identifier
to a WFS request. The handle is included to
facilitate error reporting. A WFS may report the
handle in an exception report to identify the
offending request or action. If the handle is not
present, then the WFS may employ other means to
localize the error (e.g. line numbers).

Forcing handle to be used as a commit message would be wrong in my opinion...

GetDiff - GetFeature option
Good summary; the allowing each attribute to be optional is tough. One way to consider this is the WFS1.1 idea of different formats; define a "diff" format that produces an xml document such as you describe; you can always include the modified XSD information incline as part of the document (since in this case the amount of data is small, and the modifications to the original XSD are known).

Yeah, indeed that's what I was thinking (but failed to communicate :slight_smile: )

GetDiff - GetTransaction Request option
It would be *nice* if the result was *not* a GetFeatures extensions but instead the exact Transaction request documented required to make the change; no messing around or inventing new xml schema is requried here.

This is consistent with Galdos cascading WFS-T approach and would be a *great* benefit for keeping servers in sync.
(Please consider this idea).

Rollback - don't do it, use GetDiff

No comment on the SQL - as I am out of time. Except that after we prototype it would be smart to roll this stuff into the database side; although not as Paul suggests straight into PostGIS (smarter to do it as part of DataStore initialization, so the java code "owns" the SQL).

I have the same objection as with Paul's... this would turn into a
maintenance nightmare. I do really want this to be database independent
so that I don't have to fix bugs three times in three different database languages (that's why I'm using really plain queries too, they are
standard SQL supported by every database I know, besides maybe old
versions of Mysql that did not support sub-queries).

When a customer chooses a db, you don't have any way to make him change
his mind. See it with geoserver, people do complain about Oracle datastore, but this does not make them switch to Postgis, they simply
cannot. It's easier for them to drop Geoserver than Oracle.

So, if someone likes the idea and wants to do a Postgis integrated thing
that can be reused from PHP, python and whatnot clients,
then he should step out, do it, and maintain it too, because once you do
that, implementations do drift apart and each starts doing its own
(it's just a matter of time).

Oh, having a Postgres integrated vernsioning which would be great, btw, I would not be happy myself if postgis would haven been a middleware extension written in python.

Cheers
Andrea

Andrea wrote:

GetFeature
- so out of the box it returns the latest

I am a bit concerned that making the revision columns available messes up the origional schema (this simply will not work in the case where the schema is provided by a third party authority for example). Although this is not your use case (I recognize that) I am going to work through how it can be done:

Hmm... I hear ya, yet there are downsides:
* I would no more be able to query the feature type for a specific revision using a plain GetFeature. This could be done in a GetFeatureVersioning extra method instead (something we are thinking about anyways to expand what we can ask a version based system), but forces an API change in the version datastore as well (since what I'm looking for is not in the gt2 filters anymore, unless we expand the filter and expression sets to cope... hum, what would you do in this regard?).

I think that is a *good* thing; remember you want the revision to be invisible to the casual use of the system. Do not break out a new GetFeatureVersioning method - this is *exactly* the kind of thing that should be done with a vendor specific parameter.

* the first approach would make it hard to build a checkout, how do you know how to parse the revision out of the identifier?

Indeed that idea is poor; lets go with the second one <Feature fid="people.fred" revision="432456">...</Feature>

* the second approach would require for a different GML producer, and for a place in DefaultFeature to describe the revision (there's
  none at the moment).

Version was part of the GeoTools 2.0 feature model (and was removed as it was unused), and it is part of the general OGC feature model. So add it back in now that you have a use for it.

So, I'm really wondering, if the schema is mandated by an external authority, could we avoid messing with versioning and use the complex
data store instead to get the same result?

My brain - pop! I don't think so ... perhaps I need an example to understand what you are suggesting.

Andrea Aime wrote:

becomes non 0 when it is replaced (so revision==0 always represents the "live" data). Having two columns is not bad, does having both help you ask for data in a specific range? Or could we get by with just a single column.

I'm doing performance tests now, to see how much performance I give
up by using my schema, especially on extracting the last revision, which
is the most common operation anyways.

Let's assume then you will measure and make the best choice - and move on to another topic.

Andrea Aime wrote:

GetLog
- making it available as a normal feature is fine, collections support can be done if you need it.

Indeed, it's true... I just don't have any idea of how complex that would be and which GML producer we would need to use...

Same one as for GetFeatures ....
<FeatureCollection>
     <!--Log of revision 43235 onward-->
     <Feature fid="people.fred" version="43235">..<Feature>
     <Feature fid="people.fred" version="43242">..<Feature>
</FeatureCollection>

To be evil you can save space using xml references (so each feature does not need to duplicate the same unchanged geometry).

Transation:
- throwing errors out of Transaction is cool; consider any conflict to be the same as a locking conflict (ie the modification has been made by another so that feature is "locked")
- leave revision columns out of the describe feature type so that you do not have to worry about user's supplying the details...

See above, I would like to avoid that.

Ah circles.

The Transaction "handle" is where your changelog message comes from. No additional extra attribute is needed from the Transaction element.

Did not thought about it, but this would be a way to bend the specification... The WFS 1.1, which is commented, says:

The handle attribute allows a client application to assign a client-generated request identifier to a WFS request. The handle is included to
facilitate error reporting. A WFS may report the handle in an exception report to identify the offending request or action. If the handle is not present, then the WFS may employ other means to localize the error (e.g. line numbers).

I have only ever seen it used by external applications to note what they were doing (often in human readable or supplied terms).

I like the idea of using handle here - gives us a chance pick up what non version aware clients thought they were doing:
#1 Use Handle (even if we are bending)

Forcing handle to be used as a commit message would be wrong in my opinion...

#2 Use a <!-- comment -->, and consider myself requesting you store the "handle" as a seperate addition to your table

Jody Garnett ha scritto:

Andrea wrote:

GetFeature

Hmm... I hear ya, yet there are downsides:
* I would no more be able to query the feature type for a specific revision using a plain GetFeature. This could be done in a GetFeatureVersioning extra method instead (something we are thinking about anyways to expand what we can ask a version based system), but forces an API change in the version datastore as well (since what I'm looking for is not in the gt2 filters anymore, unless we expand the filter and expression sets to cope... hum, what would you do in this regard?).

I think that is a *good* thing; remember you want the revision to be invisible to the casual use of the system. Do not break out a new GetFeatureVersioning method - this is *exactly* the kind of thing that should be done with a vendor specific parameter.

Good point, I have to look into it...

* the first approach would make it hard to build a checkout, how do you know how to parse the revision out of the identifier?

Indeed that idea is poor; lets go with the second one <Feature fid="people.fred" revision="432456">...</Feature>

* the second approach would require for a different GML producer, and for a place in DefaultFeature to describe the revision (there's
  none at the moment).

Version was part of the GeoTools 2.0 feature model (and was removed as it was unused), and it is part of the general OGC feature model. So add it back in now that you have a use for it.

Jody, if I start to implement the thing this week, it'll be against gt2
2.3 or at best 2.4 (the latter being unlikely, I don't see a Geoserver
come out against 2.4 before March 2007, althought this is just my gut
feeling). Geotools 2.0 is something distant and dangerous for my geoserver codebase (aka, it'll probably tear it apart during the port...)

So, I'm really wondering, if the schema is mandated by an external authority, could we avoid messing with versioning and use the complex
data store instead to get the same result?

My brain - pop! I don't think so ... perhaps I need an example to understand what you are suggesting.

If schema is mandated, I cannot have "version" attribute around.
Ok, that schema evidently does not care about versioning, I take
my feature with versions and make them go thru a mapping datastore
that create a new feture type with not extra attributes.

Cheers
Andrea

Jody Garnett ha scritto:

Andrea Aime wrote:

becomes non 0 when it is replaced (so revision==0 always represents the "live" data). Having two columns is not bad, does having both help you ask for data in a specific range? Or could we get by with just a single column.

I'm doing performance tests now, to see how much performance I give
up by using my schema, especially on extracting the last revision, which
is the most common operation anyways.

Let's assume then you will measure and make the best choice - and move on to another topic.

No need to measure Jody, a subquery adds an O(n) to the mix, so it would
make everything real slow... or I'm missing something... Chris,what do you think, let's add another half a day to it and measure the single
version column performance too?

Cheers
Andrea

Jody Garnett ha scritto:

Andrea Aime wrote:

GetLog
- making it available as a normal feature is fine, collections support can be done if you need it.

Indeed, it's true... I just don't have any idea of how complex that would be and which GML producer we would need to use...

Same one as for GetFeatures ....
<FeatureCollection>
    <!--Log of revision 43235 onward-->
    <Feature fid="people.fred" version="43235">..<Feature>
    <Feature fid="people.fred" version="43242">..<Feature>
</FeatureCollection>

Huh?
GetLog does not return the various states of a feature, it returns
the equivalent of svn log, that is, who, revision number,
commit message, and if you add a verbose parameter, a list of
changed features ids, that would be all. So I would need
support for a plain list as an attribute of the ChangeLog feature:

svn log "my feature with fid roads.2045":

<FeatureCollection>
   <ChangeLog fid="100">
     <author>Jody</author>
     <revision>100</revision>
     <msg>Connected two lines</msg>
     <featuresChanged>
  <fid>roads.2056</fid>
         <fid>roads.2030</fid>
     </featuresChanged>
   </ChangeLog>
   <ChangeLog fid="45">
     <author>Aaime</author>
     <revision>45</revision>
     <msg>Created new road</msg>
     <featuresChanged>
  <fid>roads.2056</fid>
     </featuresChanged>
   </ChangeLog>
   ...
</FeatureCollection>

Cheers
Andrea

Chris, need help here... what do you think?

Message from the gt2/geoserver mailing list...
I have the impression Jody not only wants to provide feedback,
but also wants to leave his on mark on the thing :-p
Or maybe it's just me being too defensive...

---------------------------------------------------------------------

Transation:
- throwing errors out of Transaction is cool; consider any conflict to be the same as a locking conflict (ie the modification has been made by another so that feature is "locked")
- leave revision columns out of the describe feature type so that you do not have to worry about user's supplying the details...

See above, I would like to avoid that.

Ah circles.

The Transaction "handle" is where your changelog message comes from. No additional extra attribute is needed from the Transaction element.

Did not thought about it, but this would be a way to bend the specification... The WFS 1.1, which is commented, says:

The handle attribute allows a client application to assign a client-generated request identifier to a WFS request. The handle is included to
facilitate error reporting. A WFS may report the handle in an exception report to identify the offending request or action. If the handle is not present, then the WFS may employ other means to localize the error (e.g. line numbers).

I have only ever seen it used by external applications to note what they
were doing (often in human readable or supplied terms).

I like the idea of using handle here - gives us a chance pick up what
non version aware clients thought they were doing:
#1 Use Handle (even if we are bending)

Forcing handle to be used as a commit message would be wrong in my opinion...

#2 Use a <!-- comment -->, and consider myself requesting you store the
"handle" as a seperate addition to your table

!DSPAM:1023,456dd184314621362196140!

Andrea Aime wrote:

Version was part of the GeoTools 2.0 feature model (and was removed as it was unused), and it is part of the general OGC feature model. So add it back in now that you have a use for it.

Jody, if I start to implement the thing this week, it'll be against gt2
2.3 or at best 2.4 (the latter being unlikely, I don't see a Geoserver
come out against 2.4 before March 2007, althought this is just my gut
feeling). Geotools 2.0 is something distant and dangerous for my geoserver codebase (aka, it'll probably tear it apart during the port...)

Andrea can you "make the cut" with a suggestion before 2.3.0 goes out the door? That seems to be the best of both worlds:
I assume:
GeoTools changes:
#1 Feature.getVersion(): String, default implementation returns null (for unknown)
#2 Fix up the Transform to output the version if it is non null

And then this one is just a "use" of GeoTools:
#3 You use Transaction properties as how to pass your vendor specific parameters into your custom datastore (this is exactly what they were created for; indeed it was for a GeoServer vendor specific parameter controlling decimation that they were added).
#4 Create your custom datastore...

So, I'm really wondering, if the schema is mandated by an external authority, could we avoid messing with versioning and use the complex
data store instead to get the same result?

My brain - pop! I don't think so ... perhaps I need an example to understand what you are suggesting.

If schema is mandated, I cannot have "version" attribute around.

It is part of the general feature model (they cannot avoid it IMHO)

Ok, that schema evidently does not care about versioning, I take my feature with versions and make them go thru a mapping datastore
that create a new feture type with not extra attributes.

Oh okay; yeah I can get that - I just hoped that they could use your serverice as a WFS-T with out knowing that secretly the application was keeping a history....

Cheers
Andrea

Aside: Andrea I am done w/ feedback ... I feel what you are doing is important so I gave you one round of feedback, and then tried to answer any questions you had about my comments.

You can carefully ignore me (I won't even mind); part of it being a review by your peers is knowing when to ignore them and meet your deadlines. Remember the "unsupported" module idea provides a second opportunity for review when you upgrade to supported status...

All the best;
Jody

Chris, need help here... what do you think?

Message from the gt2/geoserver mailing list...
I have the impression Jody not only wants to provide feedback,
but also wants to leave his on mark on the thing :-p
Or maybe it's just me being too defensive...

---------------------------------------------------------------------

Transation:
- throwing errors out of Transaction is cool; consider any conflict to be the same as a locking conflict (ie the modification has been made by another so that feature is "locked")
- leave revision columns out of the describe feature type so that you do not have to worry about user's supplying the details...
      

See above, I would like to avoid that.
    

Ah circles.
  

The Transaction "handle" is where your changelog message comes from. No additional extra attribute is needed from the Transaction element.
      

Did not thought about it, but this would be a way to bend the specification... The WFS 1.1, which is commented, says:

The handle attribute allows a client application to assign a client-generated request identifier to a WFS request. The handle is included to
facilitate error reporting. A WFS may report the handle in an exception report to identify the offending request or action. If the handle is not present, then the WFS may employ other means to localize the error (e.g. line numbers).
    

I have only ever seen it used by external applications to note what they
were doing (often in human readable or supplied terms).

I like the idea of using handle here - gives us a chance pick up what
non version aware clients thought they were doing:
#1 Use Handle (even if we are bending)

Forcing handle to be used as a commit message would be wrong in my opinion...
    

#2 Use a <!-- comment -->, and consider myself requesting you store the
"handle" as a seperate addition to your table

!DSPAM:1023,456dd184314621362196140!

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
  

Andrea Aime ha scritto:

Chris, need help here... what do you think?

Message from the gt2/geoserver mailing list...
I have the impression Jody not only wants to provide feedback,
but also wants to leave his on mark on the thing :-p
Or maybe it's just me being too defensive...

Crap... this was not meant to be public.
Well, my public apologies too, then... I'm definitely overeacting,
and being an idiot too, I've asked for feedback, and you've used
your time to provide it, so I shall not complain. Please, keep the
feedback coming and ignore this retarded writing stupid mails...

Sorry again
Cheers
Andrea

Andrea - of course your apology is accepted. Indeed I had not take offense :slight_smile:
I would rather have more peer review in blunt terms then anybody worrying about being perfectly polite.
Jody

Andrea Aime ha scritto:
  

Chris, need help here... what do you think?

Message from the gt2/geoserver mailing list...
I have the impression Jody not only wants to provide feedback,
but also wants to leave his on mark on the thing :-p
Or maybe it's just me being too defensive...
    
Crap... this was not meant to be public.
Well, my public apologies too, then... I'm definitely overeacting,
and being an idiot too, I've asked for feedback, and you've used
your time to provide it, so I shall not complain. Please, keep the
feedback coming and ignore this retarded writing stupid mails...

Sorry again
Cheers
Andrea

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
  

Andrea Aime wrote:

Jody Garnett ha scritto:

Andrea Aime wrote:

becomes non 0 when it is replaced (so revision==0 always represents the "live" data). Having two columns is not bad, does having both help you ask for data in a specific range? Or could we get by with just a single column.

I'm doing performance tests now, to see how much performance I give
up by using my schema, especially on extracting the last revision, which
is the most common operation anyways.

Let's assume then you will measure and make the best choice - and move on to another topic.

No need to measure Jody, a subquery adds an O(n) to the mix, so it would
make everything real slow... or I'm missing something... Chris,what do you think, let's add another half a day to it and measure the single
version column performance too?

Let's just go with two for this prototype. We're more wanting to experiment with the protocol and get things out there, it's not worth over optimizing now, and I see no big downsides to having two columns. If client implementors hate it then we can change it down the road.

Chris

Cheers
Andrea

!DSPAM:1003,456dd3e2316929771116852!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

The handle attribute allows a client application to assign a client-generated request identifier to a WFS request. The handle is included to
facilitate error reporting. A WFS may report the handle in an exception report to identify the offending request or action. If the handle is not present, then the WFS may employ other means to localize the error (e.g. line numbers).

I have only ever seen it used by external applications to note what they were doing (often in human readable or supplied terms).

I like the idea of using handle here - gives us a chance pick up what non version aware clients thought they were doing:
#1 Use Handle (even if we are bending)

I kind of like using the handle. It's never used by people, if you put a commit message in there then it can still be used for error reporting, it's ostensible purpose. Just like the versioning stuff that's in the WFS spec it's a piece that's not thought out and used, so we can exploit it.

The big problem I see is the semantics are wrong. It won't be intuitive to the writer of a new client that they the 'handle' attribute is the place to put their 'comment' or 'message' for their commit.

Another somewhat open question I have is how wise it is to try to bootstrap everything on top of WFS-T. I do think it makes sense for the first crack, so we get a bit of extra versioning on WFS-T commits from clients that may not know our versioning protocol, and make it super easy for them to add it.

So the question for you Jody, or maybe more accurately for DavidZ if he was still around, is how easily could you add versioning support on top of the existing gt2 WFS-T stuff? Not _necessarily_ what matches the WFS-T spec as close as possible, but what would make it easy for you as an implementor? This also informs like what and how we respond to a GetDiff call.

In the future it might also make sense to just throw out the whole WFS-T way of doing things, and adopt something more RESTful, and perhaps use like GeoJSON: http://icon.stoa.org/trac/pleiades/wiki/GeoJSON maybe expand to use WKT?

Forcing handle to be used as a commit message would be wrong in my opinion...

#2 Use a <!-- comment -->, and consider myself requesting you store the "handle" as a seperate addition to your table

I don't understand this. You're talking in the XML? If it's in the XML I don't think there's a way for DOM or SAX to get at the comments? So we wouldn't be able to read them in GeoServer...

Chris

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

!DSPAM:1003,456dd188314807785049143!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Andrea Aime ha scritto:

Jody Garnett ha scritto:

Andrea Aime wrote:

becomes non 0 when it is replaced (so revision==0 always represents the "live" data). Having two columns is not bad, does having both help you ask for data in a specific range? Or could we get by with just a single column.

I'm doing performance tests now, to see how much performance I give
up by using my schema, especially on extracting the last revision, which
is the most common operation anyways.

Let's assume then you will measure and make the best choice - and move on to another topic.

Oh well, it just occurred to me that a single column design requires
you to store in the version column either the fact that the row
is the last one, or store the version it has expired, since when
creating a new version you don't have any idea when the row was
created.
An alternative would be to use a negative number for the last revision,
so that you can simply change its sign when it expires and have
the revision created stored.

Anyways, let's assume the first design for a second, since it allows
me to do a quick check directly against my current schema: it's just
like working with the expire column alone.

Extracting the last revision is exactly the same query, I only use
expired anyways. What makes the difference is extracting a specific
revision, somethign which is used by rollback, diff and eventually
in the future by branch merge. Extracting revision 2000 on my
test data set requires the following query:

select *
from testdata td1
where td1.expired = (
   select min(expired)
   from testdata td2
   where td2.expired > 2000
   and td2.id = td1.id)

I've inserted this into my benchmark, with the same rules as the
other queries (that is, fully scan the result) and... I lost patience
after a few _minutes_ is was running and killed it (and had to kill
postgres as well since it was still processing the query after I closed the connection), so I can only tell you it's at least two orders of magnitude slower than the one using two columns...

And it's not because of the lack of indexes, since (expired, id)
is indexed, but because the subquery forces a nested loop on all rows
in the table... I don't know if there's a better way to express the
same query, I'm still a bit sleepy...
If you find a better one, let me know.

Cheers
Andrea

Andrea Aime ha scritto:

Jody Garnett ha scritto:

Andrea Aime wrote:

GetLog
- making it available as a normal feature is fine, collections support can be done if you need it.

Indeed, it's true... I just don't have any idea of how complex that would be and which GML producer we would need to use...

Same one as for GetFeatures ....
<FeatureCollection>
    <!--Log of revision 43235 onward-->
    <Feature fid="people.fred" version="43235">..<Feature>
    <Feature fid="people.fred" version="43242">..<Feature>
</FeatureCollection>

Huh?
GetLog does not return the various states of a feature, it returns
the equivalent of svn log, that is, who, revision number,
commit message, and if you add a verbose parameter, a list of
changed features ids, that would be all. So I would need
support for a plain list as an attribute of the ChangeLog feature:

svn log "my feature with fid roads.2045":

<FeatureCollection>
   <ChangeLog fid="100">
     <author>Jody</author>
     <revision>100</revision>
     <msg>Connected two lines</msg>
     <featuresChanged>
  <fid>roads.2056</fid>
         <fid>roads.2030</fid>
     </featuresChanged>
   </ChangeLog>
   <ChangeLog fid="45">
     <author>Aaime</author>
     <revision>45</revision>
     <msg>Created new road</msg>
     <featuresChanged>
  <fid>roads.2056</fid>
     </featuresChanged>
   </ChangeLog>
   ...
</FeatureCollection>

Gah, yesterday I was really braindead... it's not the features I wanted
to list, but the feature type changed (that is, the tables that have been impacted by the "transaction" operation that created the new revision). Ok, the technical problem does not change, I have an attribute which is a list of strings and I'd like to output it...

For the first implementation I'll simple give up and not provide
this info to the user, but it would be nice to in the long run.

Cheers
Andrea

Jody Garnett ha scritto:

Andrea wrote:

GetFeature
- so out of the box it returns the latest

I am a bit concerned that making the revision columns available messes up the origional schema (this simply will not work in the case where the schema is provided by a third party authority for example). Although this is not your use case (I recognize that) I am going to work through how it can be done:

Oh, sleeping on things helps understanding.
I finally realized that your suggestion about using version as a feature
  attribute is the only way to go, it just took a night to my bonehead
to process it.

The real problem in having version as an attribute in the schema is
that I cannot limit the user to express only equality filters on top
of it, he can make really any kind of filter he wants, and that would
turn into a nightmare for me because with the two columns design
encoding filters is real hard (and apparently the one column approach
is not fast enough, see my other comment).

Having it as an attribute forces people to use the revision number
in the WFS 1.0 versioned extension, or the new version attribute in WFS 1.1, where you can _only_ express an equality comparison with a number
(or say "ALL" in WFS 1.1 to gather all revisions of a feature).

So, thank you muchly Jody, I wouldn't have realized this without your
feedback :slight_smile:
Cheers
Andrea

Jody Garnett ha scritto:

Andrea Aime wrote:

Version was part of the GeoTools 2.0 feature model (and was removed as it was unused), and it is part of the general OGC feature model. So add it back in now that you have a use for it.

Jody, if I start to implement the thing this week, it'll be against gt2
2.3 or at best 2.4 (the latter being unlikely, I don't see a Geoserver
come out against 2.4 before March 2007, althought this is just my gut
feeling). Geotools 2.0 is something distant and dangerous for my geoserver codebase (aka, it'll probably tear it apart during the port...)

Andrea can you "make the cut" with a suggestion before 2.3.0 goes out the door? That seems to be the best of both worlds:
I assume:
GeoTools changes:
#1 Feature.getVersion(): String, default implementation returns null (for unknown)
#2 Fix up the Transform to output the version if it is non null

Yeah, this seems a good solution, see also my other mail on why I realized having version as an xml attribute is better than having it as
an xml entity (a FeatureAttribute value, that is).

Going to make a change request.
Cheers
Andrea