def get_validate_rules(sort=None, domain=None):
	query = "SELECT corpus, doc, domain, name, operator, argument, id FROM validate"
	args = []
	if domain:
		query += " WHERE domain=? "
		args.append(domain)
	if sort:
		query += " ORDER BY " + sort
	return generic_query(query, args)