Monthly Archives: August 2015

About Cayley a scalable graph database

 

This is fast tutorial of using the Caylay graph database (with MongoDB as backend): Cayley is “not a Google project, but created and maintained by a Googler, with permission from and assignment to Google, under the Apache License, version 2.0”

{
"database": "mongo",
"db_path": "cayley.redaelli.org:27017",
"read_only": false,
"host": "0.0.0.0"
}
  • ./cayley init -config=cayley.cfg
  • ./cayley http -config=cayley.cfg -host=”0.0.0.0″ &
  • create a file demo.n3
"/user/matteo" "is_manager_of" "/user/ele" .
"/user/matteo" "has" "/workstation/wk0002" .
"/user/matteo" "lives_in" "/country/italy" .
  • upload data with: curl http://cayley.redaelli.org:64210/api/v1/write/file/nquad -F NQuadFile=@demo.n3
  • or: ./cayley load –config=cayley.cfg  -quads=demo.n3
  • query data with: curl –data ‘g.V(“/user/matteo”).Out(null,”predicate”).All()’ http://cayley.redaelli.org:64210/api/v1/query/gremlin
{
 "result": [
  {
   "id": "/workstation/wk0002",
   "predicate": "has"
  },
  {
   "id": "/country/italy",
   "predicate": "lives_in"
  },
  {
   "id": "/user/ele",
   "predicate": "is_manager_of"
  }
 ]