def create_similar_criteria(criteria, clusters):
    """
    Adds filter to query to be sent to Virtuoso
    Args:
        criteria: Criteria from SynBioHub
        clusters: Cluster of parts

    Returns: String containing a SPARQL filter

    """
    subject = criteria.split(':', 1)[1]

    if subject not in clusters or not clusters[subject]:
        return 'FILTER (?subject != ?subject)'

    return 'FILTER (' + ' || '.join(['?subject = <' + duplicate + '>' for duplicate in clusters[subject]]) + ')'