Unable to write to FDP - time parsing problem
markwilkinson opened this issue · 5 comments
FDP version 1.15 docker image
Describe the bug
when writing to a record using HTTP PUT, new information is rejected due to time parsing error.
fdp logs (from docker):
fdp_1 | 2022-11-09 13:38:40,210 191569 [http-nio-80-exec-4] ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.time.format.DateTimeParseException: Text '2022-05-09T06:03:00.445' could not be parsed at index 23] with root cause
fdp_1 | java.time.format.DateTimeParseException: Text '2022-05-09T06:03:00.445' could not be parsed at index 23
fdp_1 | at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2052) ~[?:?]
To Reproduce
Create a compliant DCAT Dataset record. HTTP PUT that record to an existing Dataset URI.
Hi @markwilkinson, thanks for the report. I'll pass this bug along, in the mean time could you check if an offset would fix this? Either something like +1
or +01:00
.
Unfortunately, not easily. This is all happening in code - I do a GET on the record, change the update date using sparql, then push it back. If I edit the update date to include +01:00 it still throws the same error, so I guess its a timestamp elsewhere in the record that is causing the problem.
Hello @markwilkinson, I tried to reproduce your issue. I did a GET request to a record and changed the modified date to your value:
dcterms:modified "2022-05-09T06:03:00.445"^^xsd:dateTime;
Then, I PUT it back, and there was no error. I also tried to remove the xsd:dateTime
(just in case it was missing in your data for some reason). However, that only leads to a validation error being returned:
@prefix rsx: <http://rdf4j.org/shacl-extensions#> .
@prefix rdf4j: <http://rdf4j.org/schema/rdf4j#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
[] a sh:ValidationReport;
sh:conforms false;
rdf4j:truncated false;
sh:result [ a sh:ValidationResult;
sh:focusNode <http://localhost:8080/catalog/catalog-1>;
rsx:shapesGraph rdf4j:SHACLShapeGraph;
sh:value "2022-05-09T06:03:00.445";
sh:resultPath dcterms:modified;
sh:sourceConstraintComponent sh:DatatypeConstraintComponent;
sh:resultSeverity sh:Violation;
sh:sourceShape [ a sh:PropertyShape;
sh:path dcterms:modified;
sh:datatype xsd:dateTime
]
] .
Could you please share the whole request body of your request that causes the exception?
Hi Jan,
Thanks for looking into this. The document that I am working with is this one: https://fairdata.services:7070/distribution/7c8949a6-ddc4-44b4-a754-3cb593afd1a1?format=ttl
I change the modified date, and then try to HTTP PUT it, but that fails.
By the way, I also have not been able to modify this FDP metadata, even from the Web front-end, for quite a long time (multiple versions of the FDP!). Please also note that another group I am working with also reported to me today that they are not able to modify the FDP using the front-end. May or may not be the same problem...??
Any advice appreciated!
Mark
Hi! Any luck in reproducing this problem?