Skip to content

Commit e58fbff

Browse files
authored
Merge pull request #759 from hubmapconsortium/karlburke/FlipOntQueryToDatasetType
Use Ontology API dataset_type support, like ingest-ui.
2 parents 9312cc8 + a10a386 commit e58fbff

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/schema/schema_manager.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,11 +1589,9 @@ def get_hubmap_ids(id):
15891589
"""
15901590
def get_dataset_type_valueset_list():
15911591
# Use the Ontology API to get JSON for allowed terms.
1592-
ubkg_valueset = get_valueset(parent_vocabulary_sab='HUBMAP'
1593-
,parent_vocabulary_valueset_code='C003041'
1594-
,value_preferred_vocabulary_sab='HUBMAP')
1592+
ubkg_valueset = get_valueset(ontology_app_context='HUBMAP')
15951593
# Extract the term elements from the JSON into a list to be returned.
1596-
return [v['term'] for v in ubkg_valueset]
1594+
return [v['dataset_type'] for v in ubkg_valueset]
15971595

15981596
"""
15991597
Use the Ontology API valueset endpoint to retrieve the UBKG valueset for a particular
@@ -1619,13 +1617,11 @@ def get_dataset_type_valueset_list():
16191617
...
16201618
]
16211619
"""
1622-
def get_valueset(parent_vocabulary_sab, parent_vocabulary_valueset_code, value_preferred_vocabulary_sab):
1620+
def get_valueset(ontology_app_context):
16231621
global _ontology_api_url
16241622

1625-
target_url = f"{_ontology_api_url}/valueset" \
1626-
f"?parent_sab={parent_vocabulary_sab}" \
1627-
f"&parent_code={parent_vocabulary_valueset_code}" \
1628-
f"&child_sabs={value_preferred_vocabulary_sab}"
1623+
target_url = f"{_ontology_api_url}/dataset-types" \
1624+
f"?application_context={ontology_app_context}"
16291625

16301626
# Use Memcached to improve performance
16311627
response = make_request_get(target_url, internal_token_used = True)

0 commit comments

Comments
 (0)