From: Justin D. <jde...@op...> - 2013-03-01 20:11:39
|
Thanks for the feedback Mauricio, comments inline. On Fri, Mar 1, 2013 at 3:50 AM, Mauricio Pazos <mau...@gm...>wrote: > On Thursday, February 28, 2013 03:48:15 PM Justin Deoliveira wrote: > > Hi Mauricio et al, > > > > As per our previous discussion I have put together a pull request some > > (what i consider) improvements to CQL/ECQL parsing with regard to date > and > > date time literals. The pull request is here: > > > > https://github.com/geotools/geotools/pull/140 > > > > To provide an explanation of the changes. > > > > - Addition of a TEQUALS operator that results in a TEquals filter as > > defined by OGC filter. I am happy to name this something else if folks > > would like. > Good!, this is a necessary extension. > > > > > - Changes to the CQL/ECQL grammer to allow for date time literals in > > "normal" binary comparisons. > Short history about this issue: > > Some years ago, I found that the BNF grammar (from OGG CSW specification) > did > have a mistake, because the rule <datetime literal> is not present. On the > other hand you can find a rule for <date-time>, in the temporal predicate > context. So, I asked for this issue to the OGC's Catalog Wroking Group . > They > replied that it is a mistake in the <comparison predicate> rule. Thus > <datetime literal> should be removed from <literal> rule. They told me that > the idea is to use the <temporal predicates> . > > Thus I modified the CQL implementation taking into account the OGC's > Catalog > Wroking Group suggestions. > > I think we shouldn't include this extension in CQL grammar. > > Now that you have included TEQUALS the user can write predicates for "<", > ">", "=" using temporal rules BEFORE, AFTER and TEQUALS > Hmmm... this is less than ideal for me, but makes sense now that I realize that the rationale comes from OGC. The biggest thing is simplicity. CQL is so nice because its such a simple syntax. "=" is much more intuitive than "TEQUALS". And if you think about someone trying out a filter they wil try "=" before thinking that there is a special construct for date equality. For example, i myself spent about 15 minutes trying to determine what the format was for "=" with a date literal, thinking i just had the wrong datetime format. And what about other binary predicates, for example "<=". Yes they can be expressed with the temporal predicates by doing: FOO BEFORE <DT> OR FOO TEQUALS <DT> Which seems needlessly verbose compared to: FOO <= <DT> So if the only argument against not including it is strict compliance with the spec I would ask that we consider this as an extension to it. The precedent for which has been set before in GeoTools, mostly notably with SLD. It would be interesting if other devs could weigh in with an opinion on this one. > > > > - Some fixes with regard to datetime parsing in general. > > > > * handling time zone offsets of the form "0000", "00:00", "00" as > > defined by ISO 8601 > > I talked about this with Catalog Wroking Group too. Because only "Z" (zulu > zone) is include in the grammar present (in the ogc specification). So, we > debated about the conclusion was the following lexical rule > > "Z" | ("+"|"-") <DIGIT><DIGIT> ":" <DIGIT><DIGIT> > > You have proposed two more offset rules "0000" and "00". That is > | ("+"|"-") <DIGIT><DIGIT> <DIGIT><DIGIT> > | ("+"|"-") <DIGIT><DIGIT> > > So, I agree. This extension looks right from my view point because ISO > standard was taken into account in the debate. > > > > * some robustness fixes with regard to extracting the > date/time/timezone > > from datetime strings > > > great > > > That is about it. Let me know you think. > > > > Once/if I get feedback that it looks ok I will start on updating the > docs. > Nice > > > > I can also throw this into a proposal if folks would like. > > > > Thanks! > > > Thanks you > > -Justin > -- > Mauricio Pazos > -- Justin Deoliveira OpenGeo - http://opengeo.org Enterprise support for open source geospatial. |