sennetconsortium / entity-api

A set of web service calls to return information about SenNet entities
MIT License
0 stars 0 forks source link

return Source information with Dataset GET #388

Closed shirey closed 1 month ago

shirey commented 2 months ago

Add a new derived (transient/generated/immutable created by an on_read trigger) attribute, sources which contains an array/list of all Sources associated with Datasets returned from the standard GET /entities/<id> endpoint. The array/list of Sources will contain one element/object for each associated Source with each element containing all of the standard attributes returned with a GET of a Source. The new sources field should only be added to returned Datasets

shirey commented 2 months ago

Updated the original story to remove returning Sources of Samples too because Samples won't be associated with multiple (array/list) of Sources like a Dataset.

jpuerto-psc commented 2 months ago

@maxsibilla - can I get an example of the updated return value when you get a chance?

maxsibilla commented 2 months ago

@maxsibilla - can I get an example of the updated return value when you get a chance?

@jpuerto-psc we will get this onto dev today so you can see it in action but the property is called sources and will return the base properties of that entity:

"sources": [
        {
            "created_by_user_displayname": "Test User",
            "created_by_user_email": "testuser@pitt.edu",
            "created_by_user_sub": "cd17bfa7-24fd-49ca-82ec-2d456ba53730",
            "created_timestamp": 1681831457448,
            "data_access_level": "consortium",
            "description": "Cypress automated description source",
            "entity_type": "Source",
            "group_name": "University of Pittsburgh TMC",
            "group_uuid": "28db7a2b-ed8a-11ec-8b0a-9fe9b51132b1",
            "lab_source_id": "Aorta",
            "last_modified_timestamp": 1718896345351,
            "last_modified_user_displayname": "Test User",
            "last_modified_user_email": "testuser@pitt.edu",
            "last_modified_user_sub": "cd17bfa7-24fd-49ca-82ec-2d456ba53730",
            "metadata": "{}",
            "sennet_id": "SNT456.NJFC.364",
            "source_type": "Human",
            "uuid": "34fb81da75a5386d406a7b1835d92bdd"
        }
    ],
jpuerto-psc commented 2 months ago

@maxsibilla CC: @shirey - what is the expectation if there are multiple sources? Is it safe to assume that all objects in the sources array will share the same source_type?

libpitt commented 2 months ago

From @maxsibilla

We will need to return source on Samples from the Entity API as well

Not sources just to be clear