def constraint_query(node_var, node_label, node_property):
    """Generate query for creating a constraint on a property."""
    query = "CONSTRAINT ON ({}:{}) ASSERT {}.{} IS UNIQUE".format(
        node_var,
        node_label,
        node_var,
        node_property
    )
    return query