ebi-ait / dcp-ingest-central

Central point of access for the Ingestion Service of the HCA DCP
Apache License 2.0
0 stars 0 forks source link

new endpoint: ontology terms needed by HCA #846

Open amnonkhen opened 2 years ago

amnonkhen commented 2 years ago

Ingest should provide a web endpoint to return the list of ontology terms needed by HCA, so that the OntoTools team can alert the HCA whenever a change is expected in a relevant term.

Following a meeting with the OntoTools team: (Zoe, Bradley) and HCA team: @Wkt8, @ESapenaVentura , @idazucchi & @amnonkhen See this board

Options to get the terms:

  1. actual terms used by projects - from DB, or API
  2. all needed terms - "ontology" fields from schema files
ESapenaVentura commented 2 years ago

btw, we have a very easy way of retrieving all the latest ontology schemas

import requests

from hca_ingest.api.ingestapi import IngestApi

api = IngestApi('https://api.ingest.archive.data.humancellatlas.org')
ingest_ontology_schemas = api.get_schemas(latest_only=True, high_level_entity="module", domain_entity="ontology")

ontology_schemas = []
for ingest_schema in ingest_ontology_schemas:
    r = requests.get(ingest_schema['_links']['json-schema']['href'])
    r.raise_for_status()
    ontology_schemas.append(r.json())