villadora / cayley.js

Nodejs Client for Cayley
Other
57 stars 14 forks source link

Write triplet #2

Closed ghost closed 10 years ago

ghost commented 10 years ago

I have configured cayley.js to use mongodb as backend. How do I go about writing/deleting a triplet through the client?

tofuness commented 10 years ago

I believe the only way to add data, currently, is to import it via the web GUI or through the CLI. Both require that you use a NQ file.

villadora commented 10 years ago

Actually, there are two simple http api to let you write some triples or submit a nq file.

I'll try to take some time to implement the simple write http api by the end of this week, together with thenable object.

But currently, I don't think the write api is abstract and friendly for use, and I'm looking for go api which would be faster and run at higher level in google/cayley#64

ghost commented 10 years ago

It would be great with a more simple api. I managed to use client.request.post('http://localhost:64210/api/v1/write', { json: [...] }, function(err, res, body){ .. }) to write triples. @villadora I saw the new write/delete you implemented, should be a bit more clean, will try it out.

Also, it would be good to see client.query() and client.shape() implemented.

villadora commented 10 years ago

provides api write and delete in 543023c. It's just do some wrapping.

tofuness commented 10 years ago

Good job!