So at a minimum, ResourceIdImpl needs to accept null Version / date range gracefully. This was where I was getting failures last week, hence the application of the default value, so I'll need to look back and find out what that was breaking.
I'm also hitting some interesting concerns when both the ResourceId and Query versioning bits are specified. So far I'm taking the Query versioning details to narrow those on the ResourceId. A nice example is a date range specified on each: ResourceId asks for Tuesday through Thursday, while Query asks for Monday through Tuesday. The result is everything from Tuesday (sorry no code examples). When most other combinations are used, in particular specifying a single version, then no results would be returned if the specification doesn't result in the same version. In the case of a single date being specified on both ResourceId and Query, I expect to resolve the nearest version to each date and return it only if it resolves to the same version, regardless of differences in the date. This doesn't really sit too well with me, but it seems consistent with the definitions. Gabriel, As an aside, I've been looking at the wfs-2 datastore work you pointed me at and trying to find a graceful way of adding the query version filtering that won't be limited to ResourceId filters. I was hoping to have something sensible to discuss with you about that, but haven't had any time on it today :( On 7 November 2011 12:30, Jody Garnett <[email protected]> wrote: > In your example, though, the versioning info is handled by Rid, which > is as specific as a Version object. > > Rid should be its own thing (and not a Version object.. > Version can be one of the following: > - relative to the current RID - (ALL, PREVIOUS, etc...) > - index (this is a count starting from the 1,2,3,4,5,6... and has nothing to > do with RID (that was surprising to me) > - Date (with the understanding that the nearest value to the provided date > should be returned) > It was my intension that FeatureID consist of both FID and RID; and I made > two implementations of FeatureId in order to accomplish this goal. > I have added an example of each use here: > - http://docs.geotools.org/latest/userguide/library/opengis/filter.html#identifer > // grab a specific revision > filter = ff.id( ff.featureId("CITY.98734597823459687235","A457") ); > > // grab the one before that > filter = ff.id(ff.resourceId("CITY.98734597823459687235","A457",new > Version(Action.PREVIOUS) )); > > // grab the one after that > filter = ff.id(ff.resourceId("CITY.98734597823459687235","A457",new > Version(Action.NEXT) )); > > // grab the first one > filter = ff.id(ff.resourceId("CITY.98734597823459687235","A457",new > Version(Action.FIRST) )); > > // grab the first one (ie index = 1 ) > filter = ff.id(ff.resourceId("CITY.98734597823459687235","A457",new > Version(1) )); > > // grab the twelfth record in the sequence (ie index = 12 ) > filter = ff.id(ff.resourceId("CITY.98734597823459687235","A457",new > Version(12) )); > > // Grab the entry close to Jan 1985 > DateFormat df = DateFormat.getDateInstance( DateFormat.SHORT ); > df.setTimeZone(TimeZone.getTimeZone("GMT")); > filter = ff.id(ff.resourceId("CITY.98734597823459687235","A457",new > Version(df.parse("1985-1-1")))); > Jody > > for ResourceIdImpl should be changed to requiring Version, date range > This also isn't settable in other > FeatureId implementations, which makes me think that the requirement > OR featureVersion, and the default only applied when no featureVersion > is supplied. This would add a constructor for ResourceIdImpl(String > fid). Alternately, we rid ourselves of the default and document the > fact that something must be explicitly set. > -- > Mark > On 5 November 2011 13:43, Jody Garnett <[email protected]> wrote: > > I thought hard on this one as well; let me read the spec again. > Right I remember: This case is represent that as a specific FeatureId ( fid > + rid ) to identify a specific record. > Please not if you are updating geogit mark has been making good progress so > you may want verify you are not duplicating work. He was asking about the > relationship with query.getVersion() for example; hopefully you find those > java docs clear. > > -- > Jody Garnett > On 04/11/2011, at 7:25 AM, Gabriel Roldan <[email protected]> wrote: > > Hello Jody, > in updating my geoserver wfs2 versioning branch to use ResourceId from > GeoTools trunk I found what looks like an inconsistency in > ResourceIdImpl: > The following constructor should left the version be null: > public ResourceIdImpl(String fid, String featureVersion) { > this(fid, featureVersion, new Version(Version.Action.LAST)); > } > like in just: > public ResourceIdImpl(String fid, String featureVersion) { > super(fid, featureVersion, null ); > } > Rationale being that when both fid and version is specified, you're > asking for that specific version of the feature, which is not > necessarily the LAST one. On the same line, if the specified version > is not the last one, defaulting to Version.LAST doesn't make sense, as > there are no other possible states for that specific version. So in > that case version should be null. At least that's how jdeolive and I > interpreted the spec and wrote the versioning tests for. > Does that make sense? > Cheers, > Gabriel > -- > Gabriel Roldan > OpenGeo - http://opengeo.org > Expert service straight from the developers. > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > Geotools-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-devel > -- Mark Leslie Geospatial Software Architect LISAsoft ------------------------------------------------------------- Ph: +61 2 8570 5000 Fax: +61 2 8570 5099 Mob: +61 Suite 112, Jones Bay Wharf 19-21 Pirrama Rd Pyrmont NSW 2009 ------------------------------------------------------------- LISAsoft is part of the A2end Group of Companies http://www.ardec.com.au http://www.lisasoft.com http://www.terrapages.com ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
