# xsd:dateTime datatype cannot be verified

**URL:** https://community.stardog.com/t/xsd-datetime-datatype-cannot-be-verified/1400
**Category:** Support
**Created:** [November 26, 2018, 7:06pm UTC](https://community.stardog.com/t/xsd-datetime-datatype-cannot-be-verified/1400 "2018-11-26T19:06:50Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![nicholsn](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/nicholsn/32/284_2.png) [@nicholsn](https://community.stardog.com/u/nicholsn)
#### Post date: [November 26, 2018, 7:06pm UTC](https://community.stardog.com/t/xsd-datetime-datatype-cannot-be-verified/1400/1 "2018-11-26T19:06:50Z")

</div>

I'm seeing the following error when trying to load a dataset with datetime information:

```auto
ERROR 2018-11-26 10:47:41,971 [stardog-user-175] com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader:accept(232): An exception was handled by the server: '2018-10-21T22:45:39' was not recognised, and could not be verified, with datatype xsd:dateTime [L136]

```

I generally have good luck using the redland rapper library to validate RDF. It doesn't seem to have any issues with the values of `2018-10-21T22:45:39`, but it looks like this isn't valid in stardog.

One thing to note is that I generated the turtle version of this document based on json-ld (using the [playground](https://json-ld.org/playground/))... When I tried to load the jsonld directly, I received a similar issue:

```auto
stardog data add grex ~/Downloads/prov.jsonld
Adding data from file: /Users/ubuntu/Downloads/prov.jsonld
'2018-10-21T22:45:39Z' was not recognised, and could not be verified, with datatype xsd:dateTime [L1]

```

Do you have any suggestions for how to resolve this issue?

---

<div class="post-metadata">

### Author: ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)
#### Post date: [November 26, 2018, 8:37pm UTC](https://community.stardog.com/t/xsd-datetime-datatype-cannot-be-verified/1400/2 "2018-11-26T20:37:35Z")

</div>

Hi,

I am actually unable to reproduce this issue with the latest Stardog.

1. Which version are you seeing this error with?
2. Can you provide a minimal JSON-LD or ttl file that I can use to reproduce?

---

<div class="post-metadata">

### Author: ![nicholsn](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/nicholsn/32/284_2.png) [@nicholsn](https://community.stardog.com/u/nicholsn)
#### Post date: [November 26, 2018, 10:04pm UTC](https://community.stardog.com/t/xsd-datetime-datatype-cannot-be-verified/1400/3 "2018-11-26T22:04:31Z")

</div>

This is with stardog 6.0

```auto
{
  "@context": {
    "prov": "http://www.w3.org/ns/prov",
    "regdatetime": {
      "@id": "prov:generatedAtTime",
      "@type": "xsd:dateTime"
    }},
  "regdatetime": "2018-10-21T22:45:39Z"

}

```

---

<div class="post-metadata">

### Author: ![nicholsn](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/nicholsn/32/284_2.png) [@nicholsn](https://community.stardog.com/u/nicholsn)
#### Post date: [November 28, 2018, 3:58pm UTC](https://community.stardog.com/t/xsd-datetime-datatype-cannot-be-verified/1400/4 "2018-11-28T15:58:54Z")

</div>

Any luck replicating this issue?

---

<div class="post-metadata">

### Author: ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)
#### Post date: [November 28, 2018, 8:11pm UTC](https://community.stardog.com/t/xsd-datetime-datatype-cannot-be-verified/1400/5 "2018-11-28T20:11:36Z")

</div>

Hi Nolan,

Apologies in the delay here. I was able to reproduce this issue on a database where the `strict.parsing` property is set to `true` (the default, I believe).

Setting it to false DOES make this problem go away...by no longer attempting to validate the value as a dateTime. I'm looking further into why it doesn't consider it valid.

---

<div class="post-metadata">

### Author: ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)
#### Post date: [November 28, 2018, 8:15pm UTC](https://community.stardog.com/t/xsd-datetime-datatype-cannot-be-verified/1400/6 "2018-11-28T20:15:51Z")

</div>

Actually I can see exactly why it's not valid. Our JSON-LD parser is not using the XSD namespace and as such thinks that "xsd:dateTime" is the datatype instead of "[XML Schema](http://www.w3.org/2001/XMLSchema#dateTime.)"

I will open up a ticket to address this behavior, but in the meantime you can expand the XSD datatypes to work around this.

---

<div class="post-metadata">

### Author: ![nicholsn](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/nicholsn/32/284_2.png) [@nicholsn](https://community.stardog.com/u/nicholsn)
#### Post date: [November 28, 2018, 10:30pm UTC](https://community.stardog.com/t/xsd-datetime-datatype-cannot-be-verified/1400/7 "2018-11-28T22:30:18Z")

</div>

Thanks @stephen. I can confirm that disabling strict parsing allows me to upload this triple with the timestamp. Although it didn't look like I could do this without first dropping the db.

One thing to note is that I'm also seeing this in other RDF serializations, for example there is the same issue below, so probably not just the json-ld parser.

```auto
$ cat test.ttl
_:b0 <http://www.w3.org/ns/prov#generatedAtTime> "2018-10-21T22:45:39Z"^^<xsd:dateTime> .

$ stardog data add grex test.ttl
Adding data from file: test.ttl
'2018-10-21T22:45:39Z' was not recognised, and could not be verified, with datatype xsd:dateTime [L1]

```

---

<div class="post-metadata">

### Author: ![evren](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/evren/32/1515_2.png) [@evren](https://community.stardog.com/u/evren)
#### Post date: [November 28, 2018, 10:37pm UTC](https://community.stardog.com/t/xsd-datetime-datatype-cannot-be-verified/1400/8 "2018-11-28T22:37:37Z")

</div>

Hi Nolan,

The angle brackets in Turtle is meant for absolute IRIs whereas here you are trying to use a prefixed name so you don't need the brackets. If you change the literal to `"2018-10-21T22:45:39Z"^^xsd:dateTime` it should work.

Best,  
Evren

---

<div class="post-metadata">

### Author: ![nicholsn](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/nicholsn/32/284_2.png) [@nicholsn](https://community.stardog.com/u/nicholsn)
#### Post date: [November 29, 2018, 12:14am UTC](https://community.stardog.com/t/xsd-datetime-datatype-cannot-be-verified/1400/9 "2018-11-29T00:14:21Z")

</div>

Ah, so this is looking like my own mistake using jsonld and not including the xsd namespace. If I include the xsd namespace then this will work:

```auto
{
  "@context": {
    "prov": "http://www.w3.org/ns/prov",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "regdatetime": {
      "@id": "prov:generatedAtTime",
      "@type": "xsd:dateTime"
    }},
  "regdatetime": "2018-10-21T22:45:39Z"
}

```

The brackets around the xsd:dateTime were introduced by the translation from jsonld to turtle when the namespace is missing.

Once corrected, this seems to work - although it may be nice if there were default namespaces that were recognized.

@evren thanks for catching that!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)
#### Post date: [December 13, 2018, 12:14am UTC](https://community.stardog.com/t/xsd-datetime-datatype-cannot-be-verified/1400/10 "2018-12-13T00:14:24Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
