# Broken SPARQL Turtle/TriG for xsd:double

**URL:** <https://community.stardog.com/t/broken-sparql-turtle-trig-for-xsd-double/373>\
**Category:** Bug\
**Created:** [June 2, 2017, 1:43pm UTC](https://community.stardog.com/t/broken-sparql-turtle-trig-for-xsd-double/373 "2017-06-02T13:43:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![depressiveRobot](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/depressiverobot/32/74_2.png) [@depressiveRobot](https://community.stardog.com/u/depressiveRobot)\
**Post date:** [June 2, 2017, 1:43pm UTC](https://community.stardog.com/t/broken-sparql-turtle-trig-for-xsd-double/373/1 "2017-06-02T13:43:10Z")

</div>

When querying a negative `xsd:double` literal value via SPARQL an error occurs.

- initial data (`data.nt`):

- querying via CLI produces an error:

- querying via Query Panel (`http://localhost:5820/db#!/query` + `CONSTRUCT {?s ?p ?o} WHERE {?s ?p ?o}`) and export as **Turtle** results in corrupt data:

- querying via Query Panel (`http://localhost:5820/db#!/query` + `CONSTRUCT {?s ?p ?o} WHERE {?s ?p ?o}`) and export as **TriG** results in corrupt data:

## Steps to reproduce

1. start Stardog

2. create database

## Other export methods

Other export methods work as expected:

- export using SPARQL Graph Store Protocol:

- export using CLI (Turtle):

- export using CLI (TriG):

## Additional information

Stardog version: `5.0-RC1`

---

<div class="post-metadata">

**Author:** ![depressiveRobot](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/depressiverobot/32/74_2.png) [@depressiveRobot](https://community.stardog.com/u/depressiveRobot)\
**Post date:** [June 2, 2017, 2:18pm UTC](https://community.stardog.com/t/broken-sparql-turtle-trig-for-xsd-double/373/2 "2017-06-02T14:18:11Z")

</div>

I have checked the used OpenRDF/Sesame/RDF4J version for Stardog 4.2.3: `org.openrdf.sesame:sesame-rio-turtle:4.0.0`.

With version `4.0.2` the problem does not exist.

---

<div class="post-metadata">

**Author:** ![rnavarropiris](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/rnavarropiris/32/44_2.png) [@rnavarropiris](https://community.stardog.com/u/rnavarropiris)\
**Post date:** [July 10, 2017, 1:13pm UTC](https://community.stardog.com/t/broken-sparql-turtle-trig-for-xsd-double/373/3 "2017-07-10T13:13:32Z")

</div>

The [release notes of Stardog 5.0](http://www.stardog.com/docs/release-notes/#_5_0_release) state:

> Wrong formatting of doubles between -1 and 0 in CONSTRUCT queries (#3891)

Is this the same error?

---

<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:** [July 10, 2017, 1:39pm UTC](https://community.stardog.com/t/broken-sparql-turtle-trig-for-xsd-double/373/4 "2017-07-10T13:39:51Z")

</div>

Yes, that line in the release notes refers to this issue. Are you still seeing this behavior?

---

<div class="post-metadata">

**Author:** ![rnavarropiris](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/rnavarropiris/32/44_2.png) [@rnavarropiris](https://community.stardog.com/u/rnavarropiris)\
**Post date:** [July 11, 2017, 9:22am UTC](https://community.stardog.com/t/broken-sparql-turtle-trig-for-xsd-double/373/5 "2017-07-11T09:22:54Z")

</div>

I just tried to reproduce the problem following the steps provided by @depressiveRobot using Stardog version `5.0.1` and the error didn’t occur, so it’s fixed 😃

---

<div class="post-metadata">

**Author:** ![Fethi](https://avatars.discourse-cdn.com/v4/letter/f/bcef8e/32.png) [@Fethi](https://community.stardog.com/u/Fethi)\
**Post date:** [August 5, 2018, 5:00pm UTC](https://community.stardog.com/t/broken-sparql-turtle-trig-for-xsd-double/373/6 "2018-08-05T17:00:50Z")

</div>

I have the same problem when I export the SPARQL query result from an rdf file to csv format, for example the -0.50986 value will be …50986E-1 in my CSV file. How to reselve this problem in Stardog 5.1.

---

<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:** [August 21, 2018, 3:05pm UTC](https://community.stardog.com/t/broken-sparql-turtle-trig-for-xsd-double/373/7 "2018-08-21T15:05:45Z")

</div>

Apologies for the (very) delayed response here… the problem with these results appearing in CSV SPARQL results has been fixed as of Stardog 5.3.0. I would suggest you update to address this.
