def get_create_constraint_query(label: str, property_name: str, constraint_name: str = ''):
    """
    Build query to create a constraint
    :param label: node label
    :param property_name: node property for the constraint
    :param constraint_name: the constrain name
    :return: cypher query
    """
    query = 'CREATE CONSTRAINT '
    if constraint_name:
        query += constraint_name
    query += f' IF NOT EXISTS ON (n:{label}) ASSERT n.{property_name} IS UNIQUE'
    return query