hubmapconsortium / py-hubmapbags

Python package used to build the submission for the CFDE Search Portal
1 stars 2 forks source link

Use entities-api to get info directly from database #17

Closed icaoberg closed 1 year ago

icaoberg commented 2 years ago

I perform queries directly on Neo4J to extract the metadata neccesary to build the TSV files used by hubmapbags.

The query is

match (ds:Dataset {status:'Published'})<-[:ACTIVITY_OUTPUT]-(a)<-[:ACTIVITY_INPUT]-(first_samp:Sample)<-[*]-(org {specimen_type:'organ'})<-[:ACTIVITY_OUTPUT]-(act)<-[:ACTIVITY_INPUT]-(dn:Donor) where ds.data_types contains 'CODEX' return ds.uuid, ds.status, ds.data_types, ds.group_uuid, ds.hubmap_id, collect(distinct first_samp.uuid), collect(distinct first_samp.specimen_type), collect(distinct org.organ), collect(distinct org.uuid), collect(distinct dn.hubmap_id), collect(distinct ds.group_name)

However we should be able to use the entity-api to perform a similar query.

Use the API docs to see if we can get the same metadata using the API.

icaoberg commented 2 years ago

@zzzz-vincent main developer suggested we use the search-api instead of the entities-api

icaoberg commented 1 year ago

It has been implemented.