Hi, thanks for your answer. I am aware of all of these. Unfortunately fn:years-from-duration does not work but how can it since
"P25045DT0H0M0.000S"^^<http://www.w3.org/2001/XMLSchema#duration> does not have years part :( 2013/12/6 Alexander Dutton <[email protected]> > Hi Ewa, > > On 06/12/13 16:03, Ewa Szwed wrote: > > Got it! > > Done: > > > > * BIND(str(floor(fn:days-from-duration(?date_of_death - > ?date_of_birth) > > / 365)) as ?age_at_death)* > > Careful; that'll only get you the days component¹. Even if it did what > you were hoping for, you'll end up with off-by-one errors if they die > close to their birthday due to the cumulative effects of leap years. > > You probably want: > > BIND(fn:years-from-duration(?date_of_death - ?date_of_birth) AS > ?age_at_death) > > Best regards, > > Alex > > ¹ <http://www.w3.org/TR/xpath-functions/#func-days-from-duration> > > -- > Alexander Dutton > Linked Open Data Architect, Office of the CIO; data.ox.ac.uk, OxPoints > IT Services, University of Oxford > > >
