monarch-initiative / biolink-api

API for linked biological knowledge
https://api.monarchinitiative.org/api/
BSD 3-Clause "New" or "Revised" License
63 stars 25 forks source link

Slimmer function: new field #238

Open lpalbou opened 5 years ago

lpalbou commented 5 years ago

When executing a slimmer / function query: @cmungall @deepakunni3 is it ok to change the response to add a field "aspect" in assocs/object ?

Current response:

[
    {
        "subject": "MGI:88276",
        "slim": "GO:0008150",
        "assocs": [
            {
                "id": "4d4749094d47493a38383237360943746e6e62310909474f3a30303030313232094d47493a4d47493a333631333238327c504d49443a31363034303632390949444109095009636174656e696e2028636164686572696e206173736f6369617465642070726f7465696e292c20626574612031096265746120636174656e696e7c626574612d636174656e696e7c4361746e620970726f7465696e097461786f6e3a3130303930093230303630333037094d4749096861735f726567756c6174696f6e5f746172676574284d47493a4d47493a31333437343736290909",
                "subject": {
                    "id": "MGI:88276",
                    "label": "Ctnnb1",
                    "taxon": {
                        "id": "NCBITaxon:10090",
                        "label": "Mus musculus"
                    }
                },
                "object": {
                    "id": "GO:0000122",
                    "label": "negative regulation of transcription by RNA polymerase II"
                },
...

Desired:

[
    {
        "subject": "MGI:88276",
        "slim": "GO:0008150",
        "assocs": [
            {
                "id": "4d4749094d47493a38383237360943746e6e62310909474f3a30303030313232094d47493a4d47493a333631333238327c504d49443a31363034303632390949444109095009636174656e696e2028636164686572696e206173736f6369617465642070726f7465696e292c20626574612031096265746120636174656e696e7c626574612d636174656e696e7c4361746e620970726f7465696e097461786f6e3a3130303930093230303630333037094d4749096861735f726567756c6174696f6e5f746172676574284d47493a4d47493a31333437343736290909",
                "subject": {
                    "id": "MGI:88276",
                    "label": "Ctnnb1",
                    "taxon": {
                        "id": "NCBITaxon:10090",
                        "label": "Mus musculus"
                    }
                },
                "object": {
                    "id": "GO:0000122",
                    "label": "negative regulation of transcription by RNA polymerase II",
                    "aspect": "GO:0008150"
                },
...

For instance in the Ribbon, through part_of or regulates relationship, we retrieve MF annotations under BP aspect and inverse is true too. This could be used as a way to filter those results.

deepakunni3 commented 5 years ago

If we can have a generic field that can apply to all objects then that would be more aligned with the spirit of the BioLink Model. This field can refer to aspect when the object is an ontology term.

Perhaps this information can also be provided in 'meta' property of an object?

Ex:

{
    "object": {
        "id": "GO:0000122",
        "label": "negative regulation of transcription by RNA polymerase II",
        "meta": {
            "aspect":  "GO:0008150"
        }
    }
}

Note: Not sure if I am overloading the meaning of 'meta' here.

lpalbou commented 5 years ago

Well... if you want to put meta, then put also the label as the label of an object is IMO a meta, not the object itself nor a reference.

More generally, this triggers the question that we really have to simplify the complexity of the payload response. Right now, the slimmer function for 4 genes is 8mb of data to retrieve, that's a lot, and the more we add this kind of possibly useful abstraction, the larger those data transfer will be. In the same train of thoughts, I have a difficulty understanding why we repeat the whole "subject" structure for every "object" associated. We could still have a upper parent "assocs", then an intermediary parent being the "subject", and then the list of associated "object"

However, to have something more general and not specific to GO, we could name the field "parent_id" or "root_id". Anyhow, as long as this is not done, I have to rely on a temporary fix / API for that, which is not great.

lpalbou commented 5 years ago

@deepakunni3 any update on that ? Thanks !