EBI-Metagenomics / emgapi

MGnify RESTful API
https://www.ebi.ac.uk/metagenomics/api
Apache License 2.0
10 stars 0 forks source link

Inconsistency in biomes as relationship #235

Open gustavo-salazar opened 2 years ago

gustavo-salazar commented 2 years ago

I just noticed that when getting the biomes data as the relationship from a sample, it is different from the one from studies.

For instance in studies (https://wwwdev.ebi.ac.uk/metagenomics/api/v1/studies/MGYS00005782) sample.relationships.biomes.data it is an array of length 1:

            "biomes": {
                "links": {
                    "related": "https://wwwdev.ebi.ac.uk/metagenomics/api/v1/studies/MGYS00005782/biomes"
                },
                "data": [
                    {
                        "type": "biomes",
                        "id": "root:Environmental:Aquatic:Freshwater",
                        "links": {
                            "self": "https://wwwdev.ebi.ac.uk/metagenomics/api/v1/biomes/root:Environmental:Aquatic:Freshwater"
                        }
                    }
                ]
            },

While in samples (https://wwwdev.ebi.ac.uk/metagenomics/api/v1/samples/SRS7452828) is directly the object:

            "biome": {
                "data": {
                    "type": "biomes",
                    "id": "root:Environmental:Aquatic:Freshwater"
                },
                "links": {
                    "related": "https://wwwdev.ebi.ac.uk/metagenomics/api/v1/biomes/root:Environmental:Aquatic:Freshwater"
                }
            },
gustavo-salazar commented 2 years ago

Mhh, just noticed that in studies, the relationship is called biomes while in samples is biome which sort of justifies Array v.s. Object content