All Projects → zweifisch → ob-cypher

zweifisch / ob-cypher

Licence: other
query neo4j using cypher in org-mode blocks

Programming Languages

emacs lisp
2029 projects

ob-cypher

http://melpa.org/packages/ob-cypher-badge.svg

query neo4j using cypher in org-mode blocks

install

(use-package ob-cypher
  :ensure t
  :config
  (add-to-list 'org-babel-load-languages '(cypher . t))
  (org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages)
  (add-to-list 'org-babel-tangle-lang-exts '("cypher" . "cypher")))

options

optionexample
:host127.0.0.1
:port1337
:http-port7474
:username=”neo4j”=
:password=”neo4j”=
:filerequires curl and graphviz :file graph.png

examples

#+BEGIN_SRC cypher
CREATE (matrix1:Movie { title : 'The Matrix', year : '1999-03-31' })
CREATE (matrix2:Movie { title : 'The Matrix Reloaded', year : '2003-05-07' })
CREATE (matrix3:Movie { title : 'The Matrix Revolutions', year : '2003-10-27' })
CREATE (keanu:Actor { name:'Keanu Reeves' })
CREATE (laurence:Actor { name:'Laurence Fishburne' })
CREATE (carrieanne:Actor { name:'Carrie-Anne Moss' })
CREATE (keanu)-[:ACTS_IN { role : 'Neo' }]->(matrix1)
CREATE (keanu)-[:ACTS_IN { role : 'Neo' }]->(matrix2)
CREATE (keanu)-[:ACTS_IN { role : 'Neo' }]->(matrix3)
CREATE (laurence)-[:ACTS_IN { role : 'Morpheus' }]->(matrix1)
CREATE (laurence)-[:ACTS_IN { role : 'Morpheus' }]->(matrix2)
CREATE (laurence)-[:ACTS_IN { role : 'Morpheus' }]->(matrix3)
CREATE (carrieanne)-[:ACTS_IN { role : 'Trinity' }]->(matrix1)
CREATE (carrieanne)-[:ACTS_IN { role : 'Trinity' }]->(matrix2)
CREATE (carrieanne)-[:ACTS_IN { role : 'Trinity' }]->(matrix3)
#+END_SRC
#+RESULTS:
: +-------------------+
: | No data returned. |
: +-------------------+
: Nodes created: 6
: Relationships created: 9
: Properties set: 18
: Labels added: 6
: 1353 ms
#+BEGIN_SRC cypher :file movie.png
match (actor)-[r:ACTS_IN]->(movie)
return *
#+END_SRC
#+RESULTS:

http://i.imgur.com/dpCyOo5.png

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].