Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock up an API endpoint that, given a Study.id and DataObject.data_object_type, returns the relevant DataObjects #401

Closed
eecavanna opened this issue Nov 22, 2023 · 24 comments · Fixed by #608 · May be fixed by #488
Closed
Assignees
Labels
decision needed tag issues that need to be unblocked by decisions enhancement New feature or request

Comments

@eecavanna
Copy link
Collaborator

eecavanna commented Nov 22, 2023

This Issue (task) came out of today's metadata squad meeting (Wednesday, November 22, 2023).


Based on the first bullet point in #355...

...I'm envisioning an API endpoint that accepts a Study.id value and a DataObject.data_object_type value, and returns (i.e. responds with) a JSON array of all the DataObjects that are associated with that study and have that specific data_object_type value.

DataObject documentation:

Here's an example of a "long" query team members have run; not necessarily related to this Issue other than to serve as an example of a long query, which is something endpoints like this one could save people from having to write themselves:

@eecavanna eecavanna added enhancement New feature or request decision needed tag issues that need to be unblocked by decisions labels Nov 22, 2023
@eecavanna eecavanna self-assigned this Nov 22, 2023
@eecavanna eecavanna changed the title Mock up an API endpoint that, given a "thing" (TBD), returns all the "other things" (TBD) Mock up an API endpoint that, given a Study.id, returns all the associated DataObjects having a given DataObject.type Nov 23, 2023
@eecavanna eecavanna changed the title Mock up an API endpoint that, given a Study.id, returns all the associated DataObjects having a given DataObject.type Mock up an API endpoint that, given a Study.id and DataObject.data_object_type, returns the relevant DataObjects Nov 23, 2023
@eecavanna
Copy link
Collaborator Author

eecavanna commented Nov 27, 2023

Alternatively, mock up an API endpoint with the following inputs and outputs:

  • Inputs:
    • Study.id (string)
    • WorkflowExecutionActivity.type (string)
  • Outputs:
    • Array of DataObjects that are referenced by WorkflowExecutionActivity.has_output

The API endpoint would find all the WorkflowExecutionActivitys that have the specified type and are associated with the specified Study; then find the DataObjects referenced by those WorkflowExecutionActivitys.

Reference:

@dwinston dwinston moved this to Bench in Polyneme mixset Dec 4, 2023
@dwinston dwinston moved this from Bench to Lineup in Polyneme mixset Dec 4, 2023
@dwinston dwinston moved this from Lineup to At bat in Polyneme mixset Dec 14, 2023
@dwinston dwinston moved this from At bat to On base in Polyneme mixset Dec 14, 2023
@dwinston dwinston moved this from On base to At bat in Polyneme mixset Dec 14, 2023
@dwinston dwinston self-assigned this Dec 14, 2023
@dwinston dwinston moved this from At bat to Bench in Polyneme mixset Dec 14, 2023
@PeopleMakeCulture
Copy link
Collaborator

PeopleMakeCulture commented Jan 3, 2024

Spun from #355

@eecavanna
Copy link
Collaborator Author

eecavanna commented Jan 3, 2024

📓 FYI - I created this issue as a reminder to myself to mock up an endpoint that does what is described, so I could demo it to a teammate as a representative "endpoint that can abstract away a tedious query(ies)". It is not the case that I, personally, find myself doing this particular query often.

@aclum
Copy link
Contributor

aclum commented Jan 18, 2024

Is this going to be worked on this month?

@dwinston
Copy link
Collaborator

dwinston commented Jan 18, 2024

certainly can be. what would help immensely is knowing all of the paths from study to data object. I suppose this could be done via a graph algorithm on a graph representation of the schema.

@turbomam any ideas on how we could best do this?

@aclum
Copy link
Contributor

aclum commented Jan 18, 2024

I support using a graph representation of the schema, the berkeley refactor will add a number of new paths so this seems more robust than documenting the existing paths and having to add new ones in just a few weeks time.

@ssarrafan
Copy link

@dwinston @aclum let me know if this should be added to an NMDC or Infra sync meeting for discussion.

@aclum
Copy link
Contributor

aclum commented Feb 5, 2024

@ssarrafan please add to the infra sync meeting this week.

@shreddd
Copy link
Collaborator

shreddd commented Feb 8, 2024

Let's try and find a time when @dwinston can join us - 12-1p Pacific on Friday 2/9 could work.

@PeopleMakeCulture PeopleMakeCulture moved this from Bench to At bat in Polyneme mixset Feb 9, 2024
@PeopleMakeCulture PeopleMakeCulture moved this from At bat to On base in Polyneme mixset Feb 13, 2024
@PeopleMakeCulture PeopleMakeCulture moved this from On base to At bat in Polyneme mixset Feb 15, 2024
@PeopleMakeCulture PeopleMakeCulture moved this from At bat to On base in Polyneme mixset Mar 11, 2024
@PeopleMakeCulture PeopleMakeCulture moved this from On base to At bat in Polyneme mixset Mar 11, 2024
@eecavanna
Copy link
Collaborator Author

eecavanna commented Jun 28, 2024

This ticket was originally about mocking up a specific endpoint to demonstrate how people could delegate the graph traversal to the Runtime instead of having to write complex Mongo queries. I originally assigned it to myself.

The scope of the task seems to me to have grown into: implementing a real (not mock-up) endpoint that can traverse the graph and will be able to accommodate changes to the schema/graph over time.

If this ticket represents the task of implementing a "roll up" endpoint (where "roll up" is a word the referential integrity/roll up squad members have been using lately), I'd propose updating its title and maybe reassigning it to @sujaypatil96 and putting it on the squad board for the referential integrity/roll up squad (I don't think the squad has a squad board yet).

@sujaypatil96
Copy link
Collaborator

Agreed @eecavanna. I'll reassign this ticket to myself since I'm working on "rollup".

@ssarrafan
Copy link

@sujaypatil96 assuming you're still actively working on this issue? I'll move to the new sprint. Let me know if you're not planning to work on it.

@sujaypatil96
Copy link
Collaborator

@ssarrafan yup, i'm pushing up a draft PR for this issue just now.

@ssarrafan
Copy link

@sujaypatil96 it looks like you still need to review #608 so I'll move this to the new sprint. Let me know if you won't be working on it.

@aclum
Copy link
Contributor

aclum commented Aug 26, 2024

@sujaypatil96 @eecavanna @shreddd This endpoint on dev doesn't allow for any new arguments which were in the original request. If find_data_objects_for_study_data_objects_study__study_id__get was updated on the backend to use alldocs but no other arguments are allowed this needs to be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decision needed tag issues that need to be unblocked by decisions enhancement New feature or request
Projects
Archived in project
8 participants