Jeremy, Thanks. Duration operations are much more 'interesting' than I expected, and I like your advice on ensuring apples-to-apples comparisons of durations.
Arthur On Nov 19, 2014, at 4:10 PM, Jeremy J Carroll <[email protected]> wrote: > > The IMO correct way to do duration processing, that unfortunately has only > got through the XML bit of the standards process is to use either > > http://www.w3.org/TR/xpath-functions/#dt-yearMonthDuration > <http://www.w3.org/TR/xpath-functions/#dt-yearMonthDuration> > > or > > http://www.w3.org/TR/xpath-functions/#dt-dayTimeDuration > <http://www.w3.org/TR/xpath-functions/#dt-dayTimeDuration> > > but not both in the same expression. This avoids the ambiguities. > > XPath also defines arithmetic between dates and durations in a useful fashion > > Jeremy > > > > >> On Nov 19, 2014, at 10:57 AM, Arthur Keen <[email protected]> wrote: >> >> Thanks Dave, interesting that RDF 1.1 calls out duration but SPARQL 1.1 does >> not. This could be related to SPARQL 1.1 being released before RDF 1.1 >> >> On Nov 19, 2014, at 3:20 AM, Dave Reynolds <[email protected]> wrote: >> >>> On 19/11/14 05:41, Arthur Keen wrote: >>>> When comparing 28 days to 1 month and 365 days to 1 year in Fuseki 1.1.1 >>>> >>>> SELECT ("P28D"^^<http://www.w3.org/2001/XMLSchema#duration> >>>> ="P1M"^^<http://www.w3.org/2001/XMLSchema#duration> as ?same) {} >>>> -------- >>>> | same | >>>> ======== >>>> | true | >>>> -------- >>>> SELECT ("P365D"^^<http://www.w3.org/2001/XMLSchema#duration> >>>> ="P1Y"^^<http://www.w3.org/2001/XMLSchema#duration> as ?same) {} >>>> -------- >>>> | same | >>>> ======== >>>> | true | >>>> -------- >>>> Shouldn't this be indeterminate in both cases? >>> >>> xsd:duration was not a supported datatype in RDF 1.0 and isn't included in >>> the SPARQL 1.1 specification [1] so I wouldn't rely on behaviour here. >>> >>> SPARQL 1.1 does allow = to be extended to other datatypes but as far as I >>> can see it doesn't specify how indeterminate values should be handled. >>> >>> I see that RDF 1.1 does list xsd:duration as a supported datatype (!) which >>> seems like a terrible idea, no idea why they did that. >>> >>> I can't speak for whether there is any intention for ARQ to support >>> xsd:duration fully. >>> >>> Dave >>> >>> [1] http://www.w3.org/TR/sparql11-query/#OperatorMapping >> >
