Implement core graph API

This layer provides the baseline functionality for adding, changing,
and removing Origins nodes and edges with integrated provenance.

Since edges are represented as nodes, untyped edges can be created
between two nodes.

Signed-off-by: Byron Ruth <b@devel.io>
Remove used of Neo4j IDs for lookups for Origins UUIDs

This provides a more reliable, portable, and visible means of finding
nodes.

Signed-off-by: Byron Ruth <b@devel.io>
Move core nodes and edges API to separate module

The API is now scoped, i.e. nodes.add vs. add_node

Signed-off-by: Byron Ruth <b@devel.io>
Add metrics logger for Neo4j transaction times

Signed-off-by: Byron Ruth <b@devel.io>
Rename `change` to `set` for nodes and edges

*Change* implies something did change, but a set may result in nothing
changed. The default behavior is to perform a diff between the previous
and current attributes and if something changed to add a new revision.
Otherwise nothing occurs, however `force` can be set to true to
always create a new revision.

Signed-off-by: Byron Ruth <b@devel.io>
Remove used import

Signed-off-by: Byron Ruth <b@devel.io>
Update edge operations to create native edge

The native edge between the start and end nodes is now created when an
edge is added. Likewise the native edge is deleted when the edge is
removed. Therefore the native edges represents current state of
the graph.

This feature is added to support the native structure of the graph.
This combined with the ability to set node labels and the property
packing make it possible to execute raw queries as one would expect.

Signed-off-by: Byron Ruth <b@devel.io>
Add methods on Node and Edge models

This provides a cleaner implementation removing disparate functions.

Signed-off-by: Byron Ruth <b@devel.io>
Add more tests for core API

Signed-off-by: Byron Ruth <b@devel.io>
Remove old tests for APIs being refactored

Signed-off-by: Byron Ruth <b@devel.io>
Require Python 3.3+

Signed-off-by: Byron Ruth <b@devel.io>
Handle single string in cypher labels_string

Signed-off-by: Byron Ruth <b@devel.io>
Always apply the node/edge label on match

This prevents the case of conflicting labels between nodes and edges
or other domains in the graph (provenance).

Signed-off-by: Byron Ruth <b@devel.io>
Rename argument labels => label

It is more common to have a single label so the name is more appropriate.
Both a single string and a list/tuple of strings are supported.

Signed-off-by: Byron Ruth <b@devel.io>
Add DoesNotExist exception

Signed-off-by: Byron Ruth <b@devel.io>
Omit __main__ modules and environment errors in coveragerc

Signed-off-by: Byron Ruth <b@devel.io>
Move validation and defaults to model classes

Signed-off-by: Byron Ruth <b@devel.io>
Rename base module for graph tests

Signed-off-by: Byron Ruth <b@devel.io>
Overhaul of API, add service resources

Signed-off-by: Byron Ruth <b@devel.io>
Fix flake8 errors

Signed-off-by: Byron Ruth <b@devel.io>