@prefix xsd: . @prefix dce: . @prefix skos: . @prefix log: . @prefix math: . @prefix event: . @prefix e: . dce:title """Age rules"""@en; dce:creator """Hans Cools"""@en; dce:publisher """Agfa Healthcare/Belgium"""@en; dce:description """Rules to calculate an age of a being from its origination date time and/or beginning date time of its existence."""@en; skos:note """These rules are not deprecated, but a newer method is using backward chained rules."""@en. # CALCULATION OF AN AGE OF SOMETHING STARTING FROM ITS ORIGINATION DATE TIME # Note: age not restricted to a duration of life ## AGE EXPRESSED IN YEARS AND MONTHS { ?snapshot event:hasSnapshotDateTime ?snapshotDateTime. ?being event:hasOriginationDateTime ?originationDateTime. (?snapshotDateTime ?originationDateTime) math:difference ?seconds. ?seconds math:greaterThan 0. (?seconds "P1M"^^xsd:duration) math:integerQuotient ?monthsNumeral. ?monthsNumeral math:notLessThan 1. (?lexical xsd:yearMonthDuration) log:dtlit ?monthsNumeral, ?yearMonthDuration} => { ?being event:hasAge ?yearMonthDuration}. ## AGE EXPRESSED IN DAYS AND TIME { [event:hasSnapshotDateTime ?snapshotDateTime]. ?being event:hasOriginationDateTime ?originationDateTime. (?snapshotDateTime ?originationDateTime) math:difference ?seconds. ?seconds math:greaterThan 0. (?seconds "P1M"^^xsd:duration) math:quotient ?monthsNumeral. ?monthsNumeral math:lessThan 1. (?lexical xsd:dayTimeDuration) log:dtlit ?seconds, ?dayTimeDuration} => { ?being event:hasAge ?dayTimeDuration}. # CALCULATION OF AN AGE OF SOMETHING STARTING FROM BEGINNING DATE TIME OF ITS EXISTENCE ## AGE EXPRESSED IN YEARS AND MONTHS { [event:hasSnapshotDateTime ?snapshotDateTime]. ?being event:exists ?existence. ?existence event:begins ?beginning. (?snapshotDateTime ?beginning) math:difference ?seconds. ?seconds math:greaterThan 0. (?seconds "P1M"^^xsd:duration) math:integerQuotient ?monthsNumeral. ?monthsNumeral math:notLessThan 1. (?lexical xsd:yearMonthDuration) log:dtlit ?monthsNumeral, ?yearMonthDuration} => { ?being event:hasAge ?yearMonthDuration}. ## AGE EXPRESSED IN DAYS AND TIME { [event:hasSnapshotDateTime ?snapshotDateTime]. ?being event:exists ?existence. ?existence event:begins ?beginning. (?snapshotDateTime ?beginning) math:difference ?seconds. ?seconds math:greaterThan 0. (?seconds "P1M"^^xsd:duration) math:quotient ?monthsNumeral. ?monthsNumeral math:lessThan 1. (?lexical xsd:dayTimeDuration) log:dtlit ?seconds, ?dayTimeDuration} => { ?being event:hasAge ?dayTimeDuration}.