If you want to use simple cypher, the documentation contains many usage examples.
When you create nodes, you can return them (or just their identifiers by returning id(a) ), for example:
CREATE (a {name:'john doe'}) RETURN a
This way you can save id to add relationships.
If you want to link relationships later, you should not use the internal identifier of nodes to refer to them from an external system. For example, they can be reused if you delete and create nodes.
You can search for a node by scanning all parameters and filtering with WHERE or add index to your database, for example if you add auto_index for the name:
START n = node:node_auto_index(name='john doe')
and continue from there. Neo4j 2.0 will support index browsing transparently, so MATCH and WHERE should be just as efficient.
If you are using python, you can also take a look at py2neo , which provides you with a more pythonic interface when using cypher and a REST interface to communicate with the server.
source share