Re: Action 695 argument

Gary Hallmark wrote:
> 
> 
> On Tue, Feb 10, 2009 at 10:03 AM, Jos de Bruijn <debruijn@inf.unibz.it
> <mailto:debruijn@inf.unibz.it>> wrote:
> 
> 
> 
>     Gary Hallmark wrote:
>     >
>     > Jos pointed out most of my "missing" builtins are actually there,
>     in the
>     > casting builtins.  I think we are missing maybe 2 builtins:
>     >
>     >   * How can I change a datetime from one timezone to another?
> 
>     There is indeed no built-in for that specific purpose.  However, one
>     could extract all the components from a dateTime and construct a new
>     one, e.g., using the string casting function.
> 
> 
> xpath provides the following
>         10.7.1 fn:adjust-dateTime-to-timezone
> <http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#func-adjust-dateTime-to-timezone>
>         10.7.2 fn:adjust-date-to-timezone
> <http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#func-adjust-date-to-timezone>
>         10.7.3 fn:adjust-time-to-timezone
> <http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#func-adjust-time-to-timezone>

I missed those.
I wonder why they have not been included.  I suspect they have been
overlooked.

>  
> 
> 
> 
>     >   * How do I reference the current datetime (e.g.
>     fn:current-dateTime)?
> 
>     In a declarative formalism like BLD there cannot be such
>     context-dependent things like "current" datetime, because then the
>     formalism would not be declarative anymore.
>     One would need to define the semantics relative to a context given by
>     the user.  This would make things kind of ugly.
> 
> 
> Semantically, fn:current-dateTime returns a literal dateTime D.  D is
> fixed just prior to rule evalutation.  So if I evaluate some ruleset at
> 2009-02-10T00:00Z, then all references to fn:current-dateTime refer
> to 2009-02-10T00:00Z.  If I subsequently evaluate the ruleset
> at 2009-02-11T00:00Z, then all references to fn:current-dateTime refer
> to 2009-02-11T00:00Z.  That shouldn't cause problems, I think.  It's how
> SQL's SYSDATE works.

Yes, D can be fixed before evaluation by the context.
As I pointed out, BLD would not be declarative anymore.

> 
> 
> 
>     I could imagine, though, that in PRD this would not really be a problem.
>      PRD does not need to restrict itself to the built-ins in BLD.
> 
> 
>     Best, Jos
> 
>     >
>     >
>     > Gary Hallmark wrote:
>     >>
>     >>
>     >>
>     >> Dave Reynolds wrote:
>     >>> So it sounds like you might need to propose that RIF adds xsd:date
>     >>> and xsd:time (with and without timezone).
>     >>>
>     >> according to DTB, RIF already has xsd:date and xsd:time.
>     >>
>     >> why does xml schema add xsd:datetimestamp, but not add xsd:datestamp
>     >> and xsd:timestamp that makes the timezone mandatory for dates and
>     >> times as well as datetimes?
>     >>
>     >> It looks like DTB is incomplete in its support for date, time,
>     >> datetime, and duration builtins.  For example,
>     >>
>     >>    * how can I construct a date from a string like "2009-02-09"?    *
>     >> How can I construct a datetime from a date and a time?    * How can I
>     >> split a datetime into a date and a time?    * How can I add a (int)
>     >> number of hours to a datetime?
>     >>    * How can I change a datetime from one timezone to another?
>     >>    * How do I reference the current datetime (e.g.
>     fn:current-dateTime
>     >>      <#func-current-dateTime>)
>     >>
>     >>
>     >
> 
>     --
>     Jos de Bruijn            debruijn@inf.unibz.it
>     <mailto:debruijn@inf.unibz.it>
>     +390471016224         http://www.debruijn.net/
>     ----------------------------------------------
>     No one who cannot rejoice in the discovery of
>     his own mistakes deserves to be called a
>     scholar.
>      - Donald Foster
> 
> 
> 
> 
> -- 
> Cheers,
> 
> Gary Hallmark
> 

-- 
Jos de Bruijn            debruijn@inf.unibz.it
+390471016224         http://www.debruijn.net/
----------------------------------------------
No one who cannot rejoice in the discovery of
his own mistakes deserves to be called a
scholar.
  - Donald Foster

Received on Wednesday, 11 February 2009 10:33:30 UTC