def edge2geoff(from_node, to_node, properties, edge_relationship_name, encoder):
    """converts a NetworkX edge into a Geoff string.

    Parameters
    ----------
    from_node : str or int
        the ID of a NetworkX source node
    to_node : str or int
        the ID of a NetworkX target node
    properties : dict
        a dictionary of edge attributes
    edge_relationship_name : str
        string that describes the relationship between the two nodes
    encoder : json.JSONEncoder
        an instance of a JSON encoder (e.g. `json.JSONEncoder`)

    Returns
    -------
    geoff : str
        a Geoff string
    """
    edge_string = None
    if properties:
        args = [from_node, edge_relationship_name,
                encoder.encode(properties), to_node]
        edge_string = '({0})-[:{1} {2}]->({3})'.format(*args)
    else:
        args = [from_node, edge_relationship_name, to_node]
        edge_string = '({0})-[:{1}]->({2})'.format(*args)

    return edge_string
converts a NetworkX edge into a Geoff string.

    Parameters
    ----------
    from_node : str or int
        the ID of a NetworkX source node
    to_node : str or int
        the ID of a NetworkX target node
    properties : dict
        a dictionary of edge attributes
    edge_relationship_name : str
        string that describes the relationship between the two nodes
    encoder : json.JSONEncoder
        an instance of a JSON encoder (e.g. `json.JSONEncoder`)

    Returns
    -------
    geoff : str
        a Geoff string