@classmethod
def connect_nodes(cls, source=None, target=None, **kwargs):
    """ Connect source and target by creating an edge.
        `kwargs` are passed to the `cls` constructor.
        Only need to pass source, target or source_id, target_id """
    edge = cls(**kwargs)
    if source:
        edge.source = source
    if target:
        edge.target = target
    return edge
