def compare(self,
                reference_ids: List,
                query_profiles: List[List],
                method: Optional[SimAlgorithm] = SimAlgorithm.PHENODIGM) -> SimResult:
        """
        Execute one or more comparisons using sim_api
        :param reference_ids: a list of phenotypes or ids that comprise
                              one or more phenotypes
        :param query_profiles: a list of lists of phenotypes or ids
                                   that comprise one or more phenotypes
        :param method: comparison method
        :return: SimResult object
        :raises NotImplementedError: If sim method or filters are not supported
        """
        if method not in self.sim_api.matchers():
            raise NotImplementedError("Sim method not implemented "
                                      "in {}".format(str(self.sim_api)))

        is_first_result = True
        comparisons = None

        reference_phenos = PhenoSimEngine._resolve_nodes_to_phenotypes(reference_ids)
        for query_profile in query_profiles:
            query_phenos = PhenoSimEngine._resolve_nodes_to_phenotypes(query_profile)
            sim_result = self.sim_api.compare(reference_phenos, query_phenos, method)
            if len(query_profile) > 1:
                id = " + ".join(query_profile)
                sim_result.matches[0].id = id
                sim_result.matches[0].label = id
            else:
                node = typed_node_from_id(query_profile[0])
                sim_result.matches[0].id = node.id
                sim_result.matches[0].label = node.label
                sim_result.matches[0].type = node.type
                sim_result.matches[0].taxon = node.taxon

            if is_first_result:
                comparisons = sim_result
                is_first_result = False
            else:
                comparisons.matches.append(sim_result.matches[0])
                comparisons.query.target_ids.append(sim_result.query.target_ids[0])

        if len(reference_ids) == 1:
            comparisons.query.reference = typed_node_from_id(reference_ids[0])
        else:
            reference_id = " + ".join(reference_ids)
            comparisons.query.reference = TypedNode(
                id=reference_id,
                label=reference_id,
                type='unknown'
            )

        return comparisons
Execute one or more comparisons using sim_api
        :param reference_ids: a list of phenotypes or ids that comprise
                              one or more phenotypes
        :param query_profiles: a list of lists of phenotypes or ids
                                   that comprise one or more phenotypes
        :param method: comparison method
        :return: SimResult object
        :raises NotImplementedError: If sim method or filters are not supported