Hi,
I’m playing around with Dgraph and tried to insert some test data into Dgraph using cURL but I’m getting an error on a value containing escape characters.
JSON:
{
"set": {
"dgraph.type":"Update",
"title":"TEST - Data Science vs. Machine Learning vs. Artificial Intelligence - DATAVERSITY",
"url":"https://www.dataversity.net/data-science-vs-machine-learning-vs-artificial-intelligence/",
"key":"https://www.dataversity.net/data-science-vs-machine-learning-vs-artificial-intelligence/",
"type":"web",
"source":"Google Alert - \"data science\"",
"date_published":"2019-10-01T08:50:07+00:00",
"timestamp_imported":"2019-10-14T10:47:08.539237",
"keywords":["artificial intelligence","data science","machine learning","intelligence","science"]
}
}
Returns:
{
"errors": [
{
"message": "invalid character 'd' after object key:value pair",
"extensions": {
"code": "ErrorInvalidRequest"
}
}
]
}
Removing the “source” key and value results in a successful mutation, so my guess is that something is going wrong with the escape characters in the value.
A quick test using Ratel UI does successfully process:
{
set {
_:up <source> "Google Alert - \"data science\"" .
}
}
(The JSON keys+values are generated from a POJO using Gson, if that matters)
Perhaps I’m doing something wrong?