As @Rahul-Sagore plans to use the Go client for Gru, I think it would be worth the effort to make it easier to use.
Right now, the Go client just sends a string similar to the HTTP client.
The ideal thing to do would be that the Client can send a slice of NQuads for both Set and Delete operations. The validation for NQuads can be done at client side. Though this would require some duplication of code on the server and the client regarding moving the
langto the predicate and the logic that validates RDF. https://github.com/dgraph-io/dgraph/blob/master/rdf/parse.go#L190.
Another thing that we could do is that we can provide helper functions to easily add RDF’s but what is sent to the server are still strings for Set and Delete. This would avoid code duplication and reuse between HTTP Client and the language clients.
- Here too the options are whether to provide helper functions to make it easier to construct the string or have all the logic for creating a GraphQuery(which is a bit too much) and send that to the server.
I think for now if we can just make it easier to construct the query and mutation(set and delete) string that would be good, though the server still needs to do the string parsing which is a bit inefficient. Advice @minions?