Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cayley

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cayley

nodejs client for cayley graph database

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

cayley.js

NPM version

Cayley client for nodejs.

Install

$ npm install cayley --save

Usage

You just need to copy the code of Gremlin!

var cayley = require('cayley');

var client = cayley("http://localhost:64210/");

var g = graph = client.graph;
// or 
g = graph = client.g;

g.V().All(function(err, result) {
   // get result
});

g.V().GetLimit(5, function(err, result) {});

g.V("Humphrey Bogart").In("name").All(function(err, result) {});


// And you can create Morphism in you javascript code
var filmToActor = g.Morphism().Out("/film/film/starring").Out("/film/performance/actor");

g.V().Has("name", "Casablanca").Follow(filmToActor).Out("name").All(function(err, result) {});

When you want to query shape, g.type('shape') will return a new graph which return shape for query:

// to query shape
g = g.type('shape');
g.V().GetLimit(5, function(err, result) {
   // shape will return
});

Also simple write/delete APIs are implemented:

var client = cayley("http://localhost:64210/");
client.write([{
  subject: "Subject Node",
  predicate: "Predicate Node",
  object: "Object Node"
}], function(err, body, res) {

});

client.delete([{
  subject: "Subject Node",
  predicate: "Predicate Node",
  object: "Object Node"
}], function(err, body, res) {

});

cayley(host, [options])

options will be passed to request, so you can add settings like proxy, headers.

TODOs

  • mql api

Licence

MIT

Keywords

FAQs

Package last updated on 10 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc