## Not run:
# graph = startGraph("http://localhost:7474/db/data/")
# clear(graph)
#
# createNode(graph, "Person", name = "Alice", age = 24)
# createNode(graph, "Person", name = "Bob", age = 21)
#
# addConstraint(graph, "Person", "name")
#
# # Alice is retrieved from the graph; a new node is not created.
# alice = getOrCreateNode(graph, "Person", name = "Alice")
#
# # Additional properties listed after the unique key = value
# # pair are ignored if the node is retrieved instead of
# # created.
# bob = getOrCreateNode(graph, "Person", name = "Bob", age = 22)
#
# # Node doesn't exist, so it is created.
# charles = getOrCreateNode(graph, "Person", name = "Charles")
#
# # There are now three nodes in the graph.
# length(getLabeledNodes(graph, "Person"))
# ## End(Not run)
Run the code above in your browser using DataLab