Re: datetime-difference

On 12/04/12 10:50, Polleres, Axel wrote:
> Hi,
>
> </chair-hat>
>
>
> just as I was stumbling over it something for the wish-list...
>
> We need datetime-difference for some use case.

> Was that ever considered in previous discussions in the functions-library?

Yes.

1/ You can do it by operator extension.
2/ The decision was not to require all of XSD (datatypes, functions) in 
core SPARQL.

See also charter for LDP-WG.

> I am looking at the XPath arithmetics delegation in Table "SPARQL Binary Operators" in Section 17.3 of the query doc, cf. www.w3.org/TR/sparql11-query/
>
>
> It's probably too much of a burden to add it now, but "nice-to have" for my use case would be

Slippery slope!

We would have to add required support for xsd duration hierarchy 
(xs:dayTimeDuration, xs:yearMonthDuration).

And xs:g*? -- probably more generally useful.

Next step is xsd:time ...

(Disclosure: ARQ does g* and some of durations but not all arithmetic on 
datetimes - someone contributed the duration support)

>
> 1) delegating "-"
> to
>
>    op:subtract-dateTimes ( http://www.w3.org/TR/xpath-functions/#func-subtract-dateTimes )
>
> For
>
>     xsd:dateTime - xsd:dateTime
>
>
> 2) delegating "+"
>
>   to
>
>   op:add-dayTimeDuration-to-dateTime

FYI: Only applies to DT+dayTimeDuration, not the other way round.

>
> for either
>
>    xsd:dateTime + xsd:dayTimeDuration
>   or
>    xsd:dayTimeDuration + xsd:dateTime
>
>
> Best,
> Axel

Implementation burden for compliance.

Personally, don't care - I'll add as much as users want.

	Andy

Received on Thursday, 12 April 2012 10:09:21 UTC