Skip to content
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

Fix for issue #629 - Arithmetic Operations of DateTime in SPARQL #1061

Merged
merged 4 commits into from Sep 18, 2020

Conversation

Akash-Sharma-1
Copy link
Contributor

@Akash-Sharma-1 Akash-Sharma-1 commented May 23, 2020

Added the functionality for performing arithmetic operations of DateTime/Date/Time in SPARQL Queries.

This will fix the issue of #629 which requires handling of the arithmetic operation of dateTime variables in the SPARQL query. This fix also extends this operation handling to other similar Date, Time, Duration based variables. These operations are also discussed in official w3c Sparql work - (https://github.com/w3c/sparql-12/blob/master/SEP/SEP-0002/sep-0002.md)

This is the list of handled operations :

- xsd:dateTime - xsd:dateTime
- xsd:date - xsd:date
- xsd:time - xsd:time
- xsd:dateTime - (xsd:dayTimeDuration or xsd:yearMonthDuration or xsd:duration)
- xsd:dateTime + (xsd:dayTimeDuration or xsd:yearMonthDuration or xsd:duration)
- xsd:date - (xsd:dayTimeDuration or xsd:yearMonthDuration or xsd:duration)
- xsd:date + (xsd:dayTimeDuration or xsd:yearMonthDuration or xsd:duration)
- xsd:time - (xsd:dayTimeDuration or xsd:duration)
- xsd:time + (xsd:dayTimeDuration or xsd:duration)

In this PR, I have added the code to handle these operations in SPARQL queries. I have also added tests for the same operations. (Some test cases were also taken from (https://github.com/kasei/sparql-12/tree/xsd_datetime_duration/tests/xsd_functions)).

Closes #629

…QL Queries

Added the functionality for performing arithmetic operations of DateTime/Date/Time for SPARQL Queries
@coveralls
Copy link

coveralls commented May 23, 2020

Coverage Status

Coverage increased (+0.04%) to 75.804% when pulling f5b7b56 on Akash-Sharma-1:master into 037ea51 on RDFLib:master.

@nicholascar
Copy link
Member

nicholascar commented May 26, 2020

@Akash-Sharma-1 please merge in master branch since a whole host of changes were recently merged in to remove Python 2 code. You already have a conflict here that needs to be resolved too. The merger or conflict resolution will trigger a re-checking of the code by Travis. Then it may be ready for merging.

@ashleysommer
Copy link
Contributor

ashleysommer commented May 27, 2020

@Akash-Sharma-1
I resolved the merge conflict for you in your fork

@Akash-Sharma-1
Copy link
Contributor Author

Akash-Sharma-1 commented May 27, 2020

Hi @ashleysommer !
Thanks for the help !
I see in the details of Travis build for this PR and it shows all the checks as completed and passed. However, here it shows the checks as pending - this seems strange. Is that a problem with the Travis?

@ashleysommer
Copy link
Contributor

@Akash-Sharma-1
You're right. That is odd. Tests have all passed, but Travis still says Pending.
Once the other maintainers have approved this, we will merge it despite what Travis says.

@Akash-Sharma-1
Copy link
Contributor Author

@ashleysommer

Ohh great! Thank you!
Yes, I was searching and I found that its a common and known issue of Travis. Hopefully, they'll fix it.

@nicholascar
Copy link
Member

Open Close Travis

@nicholascar nicholascar reopened this Jul 30, 2020
@ashleysommer
Copy link
Contributor

Sorry for delay in getting back to this. This should've been merged in after our review in July. Merging now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support for xsd:duration
4 participants