rdf4j icon indicating copy to clipboard operation
rdf4j copied to clipboard

GH-4158 add xsd:date cast function

Open patrickwyler opened this issue 2 years ago • 3 comments

GitHub issue resolved: #4158

Added cast function for xsd:date.


PR Author Checklist (see the contributor guidelines for more details):

  • [X] my pull request is self-contained
  • [X] I've added tests for the changes I made
  • [X] I've applied code formatting (you can use mvn process-resources to format from the command line)
  • [X] I've squashed my commits where necessary
  • [X] every commit message starts with the issue number (GH-xxxx) followed by a meaningful description of the change

patrickwyler avatar Sep 09 '22 15:09 patrickwyler

Thanks for contributing this. Could you also add some SPARQL based tests?

hmottestad avatar Sep 09 '22 16:09 hmottestad

Sure, do you think the ones which I added are enough? Also added some tests for the comparison functionality.

patrickwyler avatar Sep 09 '22 20:09 patrickwyler

PS: @hmottestad I think the failed test is a flaky one.

Screenshot 2022-09-20 at 12 56 46

Error:  Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.868 s <<< FAILURE! - in org.eclipse.rdf4j.federated.MediumConcurrencyTest
Error:  org.eclipse.rdf4j.federated.MediumConcurrencyTest.queryMix  Time elapsed: 1.848 s  <<< ERROR!
java.util.concurrent.ExecutionException: org.eclipse.rdf4j.sail.SailException: Connection closed before all iterations were closed.
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:205)
	at org.eclipse.rdf4j.federated.MediumConcurrencyTest.lambda$queryMix$0(MediumConcurrencyTest.java:70)
	at org.junit.jupiter.api.AssertTimeout.lambda$assertTimeoutPreemptively$4(AssertTimeout.java:138)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.eclipse.rdf4j.sail.SailException: Connection closed before all iterations were closed.
	at org.eclipse.rdf4j.sail.helpers.AbstractSailConnection.close(AbstractSailConnection.java:289)
	at org.eclipse.rdf4j.repository.sail.SailRepositoryConnection.close(SailRepositoryConnection.java:240)
	at org.eclipse.rdf4j.federated.evaluation.iterator.CloseDependentConnectionIteration.handleClose(CloseDependentConnectionIteration.java:77)
	at org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration.close(AbstractCloseableIteration.java:52)
	at org.eclipse.rdf4j.federated.evaluation.join.JoinExecutorBase.handleClose(JoinExecutorBase.java:81)
	at org.eclipse.rdf4j.federated.evaluation.join.ControlledWorkerJoin.handleClose(ControlledWorkerJoin.java:88)
	at org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration.close(AbstractCloseableIteration.java:52)
	at org.eclipse.rdf4j.common.iteration.Iterations.closeCloseable(Iterations.java:189)
	at org.eclipse.rdf4j.common.iteration.ConvertingIteration.handleClose(ConvertingIteration.java:112)
	at org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration.close(AbstractCloseableIteration.java:52)
	at org.eclipse.rdf4j.federated.evaluation.iterator.StopRemainingExecutionsOnCloseIteration.handleClose(StopRemainingExecutionsOnCloseIteration.java:66)
	at org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration.close(AbstractCloseableIteration.java:52)
	at org.eclipse.rdf4j.common.iteration.Iterations.closeCloseable(Iterations.java:189)
	at org.eclipse.rdf4j.common.iteration.IterationWrapper.handleClose(IterationWrapper.java:127)
	at org.eclipse.rdf4j.sail.helpers.SailBaseIteration.handleClose(SailBaseIteration.java:55)
	at org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration.close(AbstractCloseableIteration.java:52)
	at org.eclipse.rdf4j.common.iteration.Iterations.closeCloseable(Iterations.java:189)
	at org.eclipse.rdf4j.common.iteration.IterationWrapper.handleClose(IterationWrapper.java:127)
	at org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration.close(AbstractCloseableIteration.java:52)
	at org.eclipse.rdf4j.federated.FedXBaseTest.execute(FedXBaseTest.java:99)
	at org.eclipse.rdf4j.federated.MediumConcurrencyTest.lambda$submit$2(MediumConcurrencyTest.java:86)
	... 4 more

patrickwyler avatar Sep 20 '22 09:09 patrickwyler

I think it's ready for a review.

patrickwyler avatar Sep 30 '22 12:09 patrickwyler

thanks, @patrickwyler, for providing this function!

jetztgradnet avatar Oct 26 '22 11:10 jetztgradnet