-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper calulation of datetime of duration #13
Comments
It can be done with core
and the query
will give
|
That said, there is some danger in doing so as each month (and also each year) is not an equal amount of seconds. |
There is now an extra
|
Wow, nice work.
And the output was @prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix : <http://example.org/>.
"P1YT10H30M"^^xsd:duration :cronTime "2024-09-15T20:35:20Z"^^xsd:dateTime.
"P2MT10H30M"^^xsd:duration :cronTime "2023-11-15T20:35:20Z"^^xsd:dateTime.
"P3DT10H30M"^^xsd:duration :cronTime "2023-09-18T20:35:20Z"^^xsd:dateTime.
"P1Y2M3DT10H30M"^^xsd:duration :cronTime "2024-11-18T20:35:20Z"^^xsd:dateTime.
"P1Y"^^xsd:duration :cronTime "2024-09-15T10:05:20Z"^^xsd:dateTime.
:currentTime :is "2023-09-15T10:05:10.272Z"^^xsd:dateTime. So exactly what I had expected. I'll wait to add this to the code however until eye-js and koreografeye use EYE v4.16.2. |
Solid-Agent/rules/usage-control/CronRule.n3
Lines 60 to 63 in 09b80a7
Following part of the rule uses built-ins to calculate a new time for a duration.
However it fails when the duration contains Months or Years (e.g.
P1Y2M3DT10H30M^^xsd:duration
).This should be fixed such that everything from duration is handled.
Suggestion, this can maybe even make a backward chaining rule to not reproduce it in multiple parts in the codebase?
Pointer: https://eulersharp.sourceforge.net/2003/03swap/eye-builtins.html
The text was updated successfully, but these errors were encountered: