Closed stevencox closed 5 years ago
The new query is
SELECT population_of_individual_organisms->chemical_substance->gene->biological_process_or_activity<-phenotypic_feature FROM "/schema" WHERE icees.table = 'patient' AND icees.year = 2010 AND icees.cohort_features.AgeStudyStart = '0-2' AND icees.feature.EstResidentialDensity < 1 AND icees.maximum_p_value = 1 AND drug_exposure !=~ '^(SCTID.*|rxcui.*|CAS.*|SMILES.*|umlscui.*)$'
but for some reason the response that we receive from the tranql/query
endpoint contains invalid json, which results in an error when we try to parse it.
Update: The culprit of the invalidity is the many NaN
literals it contains. paste.txt is the entire response (400k lines)
Ah. Thanks. I'll contact the ICEES folks about this. Perhaps, in the mean time, can we delete these in the response object before parsing? e.g., replace NaN in response.text then json.loads().
For now, I'm adding JSON5 as a dependency, which supports an extended syntax. The query above now runs successfully. We can also use JSON5 with the find tool which is convenient.
From Hao:
ok, it's fixed now it'll return null instead of NaN which is valid jsons
Verify workflow 5 works with biological_process_or_activity reverse associated with phenotypic_feature.
/beta2