From d0d08d513e403f7836da450a1d05eaeb89a5ba30 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Wed, 23 Nov 2022 12:19:02 +0300 Subject: Create a new REST endpoint for fetching a phenotype's metadata * gn3/api/general.py: (dataset_metadata) Delete. * gn3/api/metadata.py: Import Blueprint, jsonify, current_app, SPARQLWrapper and get_dataset_metadata. (metadata): New Blueprint (jsonify_dataset_metadata): New function/end-point. * gn3/app.py: Import metadata (create_app): Register metadata blueprint. --- gn3/api/general.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'gn3/api/general.py') diff --git a/gn3/api/general.py b/gn3/api/general.py index 68b128b..f904ffe 100644 --- a/gn3/api/general.py +++ b/gn3/api/general.py @@ -69,7 +69,4 @@ def run_r_qtl(geno_filestr, pheno_filestr): f"{geno_filestr} {pheno_filestr}") return jsonify(run_cmd(cmd)), 201 -@general.route("/dataset/") -def dataset_metadata(accession_id): - """Return info as JSON for dataset with ACCESSION_ID.""" - return jsonify(rdf.get_dataset_metadata(accession_id).data) + -- cgit v1.2.3