villadora / cayley.js Goto Github PK
View Code? Open in Web Editor NEWNodejs Client for Cayley
License: Other
Nodejs Client for Cayley
License: Other
I'm not sure why
dascher-29223:cayley.js dascher1$ mocha
cayley
✓ test All (44ms)
✓ test GetLimit
1) test Vertex
2) test V.In
3) test V.Has
4) test Morphism
✓ test Emit
✓ test type shape
5) test write
cayley
✓ test All
✓ test GetLimit
6) test Vertex
7) test V.In
8) test V.Has
9) test Morphism
✓ test Emit
7 passing (15s)
9 failing
1) cayley test Vertex:
Uncaught TypeError: Cannot read property 'length' of null
at test/cayley.js:30:26
at lib/v1/gremlin.js:133:9
at Request._callback (lib/v1/gremlin.js:23:9)
at Request.self.callback (node_modules/request/request.js:200:22)
at Request.<anonymous> (node_modules/request/request.js:1041:10)
at IncomingMessage.<anonymous> (node_modules/request/request.js:968:12)
at endReadableNT (_stream_readable.js:913:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
2) cayley test V.In:
Uncaught TypeError: Cannot read property 'length' of null
at test/cayley.js:38:26
at lib/v1/gremlin.js:133:9
at Request._callback (lib/v1/gremlin.js:23:9)
at Request.self.callback (node_modules/request/request.js:200:22)
at Request.<anonymous> (node_modules/request/request.js:1041:10)
at IncomingMessage.<anonymous> (node_modules/request/request.js:968:12)
at endReadableNT (_stream_readable.js:913:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
3) cayley test V.Has:
Uncaught TypeError: Cannot read property 'length' of null
at test/cayley.js:46:26
at lib/v1/gremlin.js:133:9
at Request._callback (lib/v1/gremlin.js:23:9)
at Request.self.callback (node_modules/request/request.js:200:22)
at Request.<anonymous> (node_modules/request/request.js:1041:10)
at IncomingMessage.<anonymous> (node_modules/request/request.js:968:12)
at endReadableNT (_stream_readable.js:913:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
4) cayley test Morphism:
Uncaught TypeError: Cannot read property 'length' of null
at test/cayley.js:55:20
at lib/v1/gremlin.js:133:9
at Request._callback (lib/v1/gremlin.js:23:9)
at Request.self.callback (node_modules/request/request.js:200:22)
at Request.<anonymous> (node_modules/request/request.js:1041:10)
at IncomingMessage.<anonymous> (node_modules/request/request.js:968:12)
at endReadableNT (_stream_readable.js:913:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
5) cayley test write:
Uncaught AssertionError: expected 'New Movie' to equal ''
at test/cayley.js:97:20
at lib/v1/gremlin.js:133:9
at Request._callback (lib/v1/gremlin.js:23:9)
at Request.self.callback (node_modules/request/request.js:200:22)
at Request.<anonymous> (node_modules/request/request.js:1041:10)
at IncomingMessage.<anonymous> (node_modules/request/request.js:968:12)
at endReadableNT (_stream_readable.js:913:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
6) cayley test Vertex:
TypeError: Cannot read property 'length' of null
at test/thenable.js:29:26
at _fulfilled (node_modules/q/q.js:834:54)
at self.promiseDispatch.done (node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (node_modules/q/q.js:796:13)
at node_modules/q/q.js:604:44
at runSingle (node_modules/q/q.js:137:13)
at flush (node_modules/q/q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
7) cayley test V.In:
Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.
8) cayley test V.Has:
Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.
9) cayley test Morphism:
Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.
How to have a cayley instance password protected?
Like in most db having a db account with a username and a password.
Is that done in a different layer, I mean in the perssitence layer that cayley depends on?
If so, how to connect it with this nodejs driver since this does not offer such options?
Promise
is available in global?Using this test:
var log = require('winston');
var cayley = require('cayley');
var client = cayley("http://localhost:64210/", "v1");
var g = graph = client.graph;
client.write([{
subject: 'subject',
predicate: 'predicate',
object: 'object'}
], function(err, body, res) {
if (err) {
log.info("error writing", err);
} else {
log.log('debug', 'Wrote');
}
});
g.V('subject').Out('predicate').Tag('obj').All(function(err, result) {
console.log("err", err);
console.log("result", result);
})
I get null results in the last function, but the triple gets written to the database as visible using the HTTP user interface.
Maybe something in the latest cayley db broke this library?
I have configured cayley.js to use mongodb as backend. How do I go about writing/deleting a triplet through the client?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.