Your SlideShare is downloading. ×
0
Py2neo 1.6
Py2neo 1.6
Py2neo 1.6
Py2neo 1.6
Py2neo 1.6
Py2neo 1.6
Py2neo 1.6
Py2neo 1.6
Py2neo 1.6
Py2neo 1.6
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Py2neo 1.6

1,275

Published on

My lightning talk on a few of the new bits of py2neo 1.6 from the London Graph Café (27 Nov 2013)

My lightning talk on a few of the new bits of py2neo 1.6 from the London Graph Café (27 Nov 2013)

Published in: Business, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,275
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. py2neo 1.6 py2neo 1.6 @technige
  • 2. (py2neo 1.6)-[:IS_BUILT_FOR]->(Neo4j 2.0) py2neo 1.6 @technige
  • 3. What's new? ● Cypher transactions ● Label support ● Schema index support (but not constraints) ● Better Unicode support ● Improved streaming for Cypher and batches ● Implicit authentication py2neo 1.6 @technige
  • 4. What else? ● Neotool shell ● Gremlin removed (see py2neo-gremlin) ● Load2neo integration py2neo 1.6 @technige
  • 5. Cypher Transactions Server Client Session Transaction Transaction Statement Statement Statement Statement Statement Statement py2neo 1.6 execute commit rollback @technige
  • 6. Cypher Transactions >>> from py2neo import cypher >>> session = cypher.Session("http://arthur:excalibur@camelot:7474") >>> tx = session.create_transaction() >>> tx.append("MERGE (a:Person {name:'Alice'}) RETURN a") >>> tx.append("MERGE (b:Person {name:'Bob'}) RETURN b") >>> tx.append("MATCH (a), (b) WHERE a.name = 'Alice' AND b.name = 'Bob' " "CREATE UNIQUE (a)-[ab:KNOWS]->(b) RETURN ab") >>> tx.commit() [[Record(columns=(u'a',), values=(Node('.../node/1'),))], [Record(columns=(u'b',), values=(Node('.../node/2'),))], [Record(columns=(u'ab',), values=(Relationship('.../relationship/1'),))]] py2neo 1.6 @technige
  • 7. Node Labels Node.add_labels(*labels) Add one or more labels to this node. >>> from py2neo import neo4j, node >>> graph_db = neo4j.GraphDatabaseService() >>> alice, = graph_db.create(node(name="Alice")) >>> alice.add_labels("female", "human") py2neo 1.6 @technige
  • 8. Node Labels Node.remove_labels(*labels) Remove one or more labels from this node. Node.get_labels() Fetch all labels associated with this node. GraphDatabaseService.find(label, property_key=None, property_value=None) Iterate through a set of labelled nodes, optionally filtering by property key and value. py2neo 1.6 @technige
  • 9. Neotool Shell $ neotool shell -U arthur -W excalibur -H camelot Neotool Shell (py2neo/1.6.1 Python/2.7.3-final-0) Copyright 2013, Nigel Small camelot:7474/cypher> MATCH (a) RETURN a LIMIT 3 a ---------------------(1 {"name":"Alice"}) (2 {"name":"Bob"}) (3 {"name":"Carol"}) (3 rows) py2neo 1.6 @technige
  • 10. https://pypi.python.org/pypi/py2neo ~ https://github.com/nigelsmall/py2neo py2neo 1.6 @technige

×