Azure / azure-cosmos-dotnet-v2

Contains samples and utilities relating to the Azure Cosmos DB .NET SDK
MIT License
579 stars 837 forks source link

cosmosdb - graph - double quotes inside property values must be escaped, this in contrast with Tinkerpop #315

Open ghost opened 7 years ago

ghost commented 7 years ago

Hi,

To load below in CosmosDB, I had to escape the double quotes, this in contrast with Tinkerpop. As CosmosDB aims to provide compatibility with Tinkerpop, would this be addressed?

the example below involves the "@context" peroperty

below statement that runs in Tinkerpop:

g.addV('Organization').property('id', 'dd8d47d4-d661-4e02-9d4e-743b5f922609').property('@id', 'http://www.patentsview.org/api/assignee/3451pslaa6b9').property('@type', 'Organization').property(list, 'assignee_organization', 'Naamloze Vennootschap').property(list, 'assignee_id', '3451pslaa6b9').property(list, 'assignee_type', '3').property('@context', '{"xsd":"http://www.w3.org/2001/XMLSchema#","Organization":"http://schema.org/Organization","assignee_type":{"@id":"http://www.patentsview.org/api/assignee/assignee_type","@type":"xsd:integer"},"assignee_organization":"http://schema.org/name","assignee_id":{"@id":"http://www.patentsview.org/api/assignee/assignee_id"}}')

below statement that runs in CosmosDB:

g.addV('Organization').property('id', 'dd8d47d4-d661-4e02-9d4e-743b5f922609').property('@id', 'http://www.patentsview.org/api/assignee/3451pslaa6b9').property('@type', 'Organization').property(list, 'assignee_organization', 'Naamloze Vennootschap').property(list, 'assignee_id', '3451pslaa6b9').property(list, 'assignee_type', '3').property('@context', '{\"xsd\":\"http://www.w3.org/2001/XMLSchema#\",\"Organization\":\"http://schema.org/Organization\",\"assignee_type\":{\"@id\":\"http://www.patentsview.org/api/assignee/assignee_type\",\"@type\":\"xsd:integer\"},\"assignee_organization\":\"http://schema.org/name\",\"assignee_id\":{\"@id\":\"http://www.patentsview.org/api/assignee/assignee_id\"}}')

Thanks in advance, Bart,

ashwini-ms commented 7 years ago

Thanks for reporting the issue. We are working this. We will update the thread once we have an ETA.

dimoibiehg commented 7 years ago

I have the same problem. I want to store a JSON as a property of a vertex, but, as it contains double quotation I can't do that!

ashwini-ms commented 7 years ago

@dimoibiehg, You can always insert json as vertex property. The 2nd query mentioned by @bartdotnet works with cosmos DB.

Not sure if I understood the issue here. Can you explain a bit more, and we will be happy to help.

dimoibiehg commented 7 years ago

@ashwini-ms I know, but I must skip the double quotations! It is not straightforward at all! You know!

ashwini-ms commented 7 years ago

Thanks @dimoibiehg for clarification. We are working on escaping quote issue. We will update the thread once we have an ETA.

ashwini-ms commented 6 years ago

@bartdotnet and @dimoibiehg , expected ETA for the fix is the end of next week.

dotsad commented 6 years ago

Can you update if this was fixed or not? Still having issues even with escaping quotes.

ashwini-ms commented 6 years ago

@dotsad/ @bartdotnet .. Apologies for a delayed response. The issue is fixed in the latest SDK and service release. Can you please verify once?