Files changed (1)
+This is the only import you need to do any other object, is created by the graph object you will create.
+Every operation must happen in a transaction. For that matter there is context manager ``Graph.transaction()`` that handle does what must be done in most cases. If you want to do weird things, you can use ``Graph.txn()`` to create a transaction and manage it yourself.
+The transaction object works as a shadow copy of the graph. You perform operation against it, until the transaction is commited, then changes if any are persisted.
+A vertex works kind of a ``dict`` but has not all its methods (yet). You can use subscript aka. ```` to change or retrieve properties of the vertex. The handy ``Vertex.get(key, default)`` is also available. Once you are finished you have to call ``Vertex.save()``. You can also delete a vertex with ``Vertex.delete()``. You can use ``Vertex.id()`` to retrieve the unique identifier of the vertex. Those methods are the base methods of any graph element (vertex or edge). Remember that everything must happen in a transaction.
+Creating and mutating the vertex in two transaction is possible, only if you retrieve again the vertex for the current transaction::
+In the above we introduced another method of ``Transaction``, ``Transaction.vertex(id)`` method. There is also a similar method for edge ``Transaction.edge(id)`` which allows to retrieve an element with its identifier.
+Vertex other methods ``Vertex.outgoings(label=None)`` and ``Vertex.incomings(label=None)``. They allow to retrieve edges. The label argument allows to filter based on the ``label`` of the edge. They returns a generator. They will be explained further below.
+The edge is persisted, connected to both ``start`` and ``end``. For ``start`` it's an *outgoing* edge, because it starts there. For ``end`` it's an *incoming* edge, because it ends there. This is translated in terms of code as follow::
+``Edge`` as also a ``Edge.start()`` and ``Edge.end()`` methods which allows to retrieve the start and end vertex of the edge::
+The graph works also as a key/value store via ``Transaction.get(key)`` and ``Transaction.set(key, value)``. A common pratice is to store a vertex identifier in an index to retrieve it later::
+ There is not much information on the web on how to architecture programs using graphdbs. Patterns exists but they are very simple and you can guess them on your own. The API is not as complex as RDBMS and in this case *worse* is *better* holds True ;)