파이썬
라이브러리
neo4jrestclient
#
Find similar titles
-
최초 작성자
sypark-intern@insilicogen.com
Structured data
- Category
- Programming
- Database
Table of Contents
How to install #
Neo4jrestclient is object-oriented Python library to interact with Neo4j standalone REST server. It is very convinient to work with graph db models especially when retrieving data.
For installing neo4jrestclient
make shure you have installed Neo4jDB server on your local machine or you have an access to remote Neo4jDB server.
Then, you can install with pip:
$ pip install -U neo4jrestclient
Example usage #
from neo4jrestclient.client import GraphDatabase
from neo4jrestclient.query import Q
from neo4jrestclient.constants import DESC, ASC
gdb = GraphDatabase("http://neo4j:hackme@localhost:7474/db/data/")
people = gdb.labels.create("Person")
def delete_all_relationships():
for r in gdb.relationships.all():
r.delete()
def delete_all_nodes():
for n in gdb.nodes.all():
n.delete()
def main():
delete_all_relationships()
delete_all_nodes()
alice = gdb.nodes.create(name="Alice", age=30)
bob = gdb.nodes.create(name="Bob", age=30)
carl = gdb.nodes.create(name="Carl", age=25)
alice.relationships.create("Knows", bob, since=1980)
people.add(alice, bob, carl)
under_30 = people.filter(Q("age", "gte", 30)).order_by("name", DESC)
print 'people under 30: %s' % ', '.join([p['name'] for p in under_30])
if __name__ == '__main__':
main()
References #
https://neo4j-rest-client.readthedocs.org/en/latest/index.html
Incoming Links #
Related Articles (Article 0) #
Suggested Pages #
- 0.462 Substitution matrix
- 0.059 pcr
- 0.058 bacteriophage
- 0.051 Seongsu
- 0.047 phage display technology
- 0.032 바이오잉크
- 0.024 프리온
- 0.023 Policy
- 0.022 프로그래밍 언어
- 0.019 그래프DB
- More suggestions...