Using still 3.5, I noticed that if I use importRDFSnippet and post a graph that includes a typed triple, e.g., xsd:dateTime, and then export the same using the /rdf/cypheronrdf endpoint, the returned triple lacks the datatype annotation.
Is that to be expected? Is this behavior changed in 4.0?
So looking at this more closely, it appears the problem is with dateTime values with timezone info.
Importing Turtle with a timezone aware time value, such as the following, causes the dateTime value to be construed as a string.
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ex: <http://example.com/> .
<urn:guid:246f5a94b4d111eabb02d4258b8e4db9> a ex:Example ;
rdfs:label "This is a string" ;
dcterms:modified "2020-06-22T21:41:34.066344+00:00"^^xsd:dateTime ;
.
Looking at the neo4j 3.5 file RDFImport.java, method getDataType, I see that it looks to see if the literal is an instance of LocalDateTime, which is a non timezone aware type. Didn't study the code carefully enough to see if that is in fact the root cause, but might be the problem.
Yes, we only try to parse the date with the default format and if it does not parse then we treat it as a string
I guess we could use a more generic format (or maybe try a couple of them) in order to accommodate both millisecs and timezones. Could you please add it as an issue in GitHub?