You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
As part of my project, I store the start and end times of query execution in a dataset. As a post-treatment, I would like to be able to compute the duration of each query execution and add this information to the dataset using a SPARQL query.
Currently, the following query returns no result:
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?duree (DATATYPE(?duree) AS ?dt) WHERE {
BIND(("2023-09-12T15:19:41.963Z"^^xsd:datetime - "2023-09-12T14:19:41.963Z"^^xsd:datetime) AS ?duree)
}
Describe the solution you'd like
Ideally, I would like the previous query to return something such as:
duree
dt
"PT1H"^^xsd:duration
xsd:duration
It would work for operations between literals of the same type such as date, datetime, time, gYear, etc.
Operations between literals of different types maybe more complex to implement.
Describe alternatives you've considered
The alternative right now is to decompose each datetime to its component (day, hours, minutes, etc.) and do arithmetic operations on them, or do the computation outside the query.
Additional context
Tested on Corese server corese-server-4.4.1.jar
The text was updated successfully, but these errors were encountered:
MaillPierre
changed the title
[Request] substraction of two dates (type with xsd) returns a xsd:duration
[Request] substraction of two dates (typed with xsd) returns a xsd:duration
Sep 13, 2023
Is your feature request related to a problem? Please describe.
As part of my project, I store the start and end times of query execution in a dataset. As a post-treatment, I would like to be able to compute the duration of each query execution and add this information to the dataset using a SPARQL query.
Currently, the following query returns no result:
Describe the solution you'd like
Ideally, I would like the previous query to return something such as:
It would work for operations between literals of the same type such as
date
,datetime
,time
,gYear
, etc.Operations between literals of different types maybe more complex to implement.
Describe alternatives you've considered
The alternative right now is to decompose each datetime to its component (day, hours, minutes, etc.) and do arithmetic operations on them, or do the computation outside the query.
Additional context
Tested on Corese server corese-server-4.4.1.jar
The text was updated successfully, but these errors were encountered: