Icon

XII - REST API

Solution of the XII problem of the Just Knime IT.

Points to remember:The entire solution has been inspired from the KNIME solutionand it is not my own work, Problem Statement:You have been working for a Life Sciences company for a month as a a data wrangler. Several coworkers from the Biology department would like to obtain alist of human genes related to specific hormones, but they do not know how to use REST services, GET requests, etc. Your task is to use the REST serviceprovided by MyGene.info to obtain a list of human genes related to a list of hormones provided to you by your coworkers. Next, you should parse the JSONresponse into a table that is easy to read.For example, if you use "http://mygene.info/v3/query?q=summary:" and append "insulin", then your request would return a JSON structure with 10 hits -- eachone of them with the following fields: "_id", "_score", "entrezgene", "name", "symbol", and "taxid".You should then parse this JSON into a table with columns "_id", "_score", "entrezgene", "name", "symbol", and "taxid". If the list provided by your coworkerscontains more than one hormone, all the parsed information should be aggregated into a single table. Also, sometimes your request may return a response inXML instead of JSON. How could you include a way to also parse XML responses? My Learning:Basic working of extracting information from JSON and about the websiteMyGene.info.Nodes: Get Request, JSON PATH, Case Switch, XPath, JSON to XML Node 2Node 3 parse: - _ids - _scores - entrezgenes - names - symbols - taxidsUngroup to getrow-wise recordsConvert JSON to XMLto simulate XML responseDirectly obtain row-wise recordsNode 16String Manipulation GET Request JSON Path Ungroup JSON To XML XPath JSON or XML?? Read Input data Points to remember:The entire solution has been inspired from the KNIME solutionand it is not my own work, Problem Statement:You have been working for a Life Sciences company for a month as a a data wrangler. Several coworkers from the Biology department would like to obtain alist of human genes related to specific hormones, but they do not know how to use REST services, GET requests, etc. Your task is to use the REST serviceprovided by MyGene.info to obtain a list of human genes related to a list of hormones provided to you by your coworkers. Next, you should parse the JSONresponse into a table that is easy to read.For example, if you use "http://mygene.info/v3/query?q=summary:" and append "insulin", then your request would return a JSON structure with 10 hits -- eachone of them with the following fields: "_id", "_score", "entrezgene", "name", "symbol", and "taxid".You should then parse this JSON into a table with columns "_id", "_score", "entrezgene", "name", "symbol", and "taxid". If the list provided by your coworkerscontains more than one hormone, all the parsed information should be aggregated into a single table. Also, sometimes your request may return a response inXML instead of JSON. How could you include a way to also parse XML responses? My Learning:Basic working of extracting information from JSON and about the websiteMyGene.info.Nodes: Get Request, JSON PATH, Case Switch, XPath, JSON to XML Node 2Node 3 parse: - _ids - _scores - entrezgenes - names - symbols - taxidsUngroup to getrow-wise recordsConvert JSON to XMLto simulate XML responseDirectly obtain row-wise recordsNode 16String Manipulation GET Request JSON Path Ungroup JSON To XML XPath JSON or XML?? Read Input data

Nodes

Extensions

Links