def extract_unique_entities_and_relations(triples):
    """
    Identifies unique entities and relation types in collection of triples.

    Args:
        triples: List of string triples.

    Returns:
        unique_entities: List of strings
        unique_relations: List of strings
    """
    s_entities = set([triple[0] for triple in triples])
    o_entities = set([triple[2] for triple in triples])
    r_types = set([triple[1] for triple in triples])

    unique_relations = sorted(list(r_types))
    unique_entities = sorted(list(s_entities | o_entities))  # union of sets

    return unique_entities, unique_relations