<commit_before>package uk.ac.ebi.biosamples.service;

import org.springframework.stereotype.Service;
import uk.ac.ebi.biosamples.model.filter.Filter;
import uk.ac.ebi.biosamples.service.FilterBuilder;

import java.util.*;

/**
 * GA4GHFilterCreator is a class for creating specific GA4GH filters for samples querying, where Organism is equals to homo sapiens
 * and any interpretation of that, has exterenal reference to ENA.
 *
 * @author <NAME>
 */
@Service
public class GA4GHFilterBuilder {

    private FilterBuilder builder;
    private Collection<Filter> filters;
    private final String externalReference = "ENA";
    private final String attributeLabel = "organism";
    private final List<String> values = Arrays.asList("Homo sapiens", "homo sapiens", "9606", "human", "Human");

    public GA4GHFilterBuilder() {
        builder = FilterBuilder.create();
        filters = new LinkedList<>();
        createFilters();
    }

    public Collection<Filter> getFilters() {
        return filters;
    }

    private void createFilters() {
        for (String value : values) {
            Filter attrbuteFilter = builder
                    .onAttribute(attributeLabel)
                    .withValue(value)
                    .build();
            filters.add(attrbuteFilter);
        }
        Filter externalReferenceFilter = builder
                .onDataFromExternalReference(externalReference)
                .build();
        filters.add(externalReferenceFilter);
    }

}
<commit_msg>Fixed issue with empty response<commit_after>package uk.ac.ebi.biosamples.service;

import org.springframework.stereotype.Service;
import uk.ac.ebi.biosamples.model.filter.Filter;
import uk.ac.ebi.biosamples.service.FilterBuilder;

import java.util.*;

/**
 * GA4GHFilterCreator is a class for creating specific GA4GH filters for samples querying, where Organism is equals to homo sapiens
 * and any interpretation of that, has exterenal reference to ENA.
 *
 * @author <NAME>
 */
@Service
public class GA4GHFilterBuilder {

    private FilterBuilder builder;
    private Collection<Filter> filters;
    private final String externalReference = "ENA";
    private final String attributeLabel = "Organism";
    private final List<String> values = Arrays.asList("Homo sapiens", "homo sapiens", "9606", "human", "Human");

    public GA4GHFilterBuilder() {
        builder = FilterBuilder.create();
        filters = new LinkedList<>();
        createFilters();
    }

    public Collection<Filter> getFilters() {
        return filters;
    }

    private void createFilters() {
        for (String value : values) {
            Filter attrbuteFilter = builder
                    .onAttribute(attributeLabel)
                    .withValue(value)
                    .build();
            filters.add(attrbuteFilter);
        }
        Filter externalReferenceFilter = builder
                .onDataFromExternalReference(externalReference)
                .build();
        filters.add(externalReferenceFilter);
    }

}

{'fraction_non_alphanumeric': 0.09325396825396826, 'fraction_numerical': 0.005291005291005291, 'mean_word_length': 2.7765293383270913, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5046999', 'n_tokens_mistral': 827, 'n_tokens_neox': 798, 'n_words': 214}