- Timestamp:
- Nov 17, 2010, 2:31:15 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web-app/js/ontology-chooser.js
r1077 r1156 121 121 $.getJSON(url, function(data) { 122 122 // parse result data 123 var result = that.parseData(data.data );123 var result = that.parseData(data.data, ontology_id); 124 124 125 125 // cache results … … 135 135 136 136 // response callback 137 response( that.parseData(data.data));137 response(result); 138 138 }); 139 139 } … … 213 213 * @return array 214 214 */ 215 parseData: function(data ) {215 parseData: function(data, ontology_ids) { 216 216 var parsed = []; 217 217 var rows = data.split('~!~'); … … 221 221 if (row) { 222 222 var cols = row.split('|'); 223 224 // If we search in a single ontology, the json doesn't return the 225 // NCBO id in the 8th column (probably because we already know the NCBO id) 226 var ncbo_id; 227 if( cols.length > 8 ) { 228 ncbo_id = cols[8]; 229 } else { 230 ncbo_id = ontology_ids; 231 } 223 232 224 233 parsed[ parsed.length ] = { … … 229 238 ontology_id : cols[3], // e.g. 29684 230 239 full_id : cols[4], // e.g. http://bioontology.org/projects/ontologies/birnlex#birnlex_161 231 ncbo_id : cols[8]// e.g. 1494240 ncbo_id : ncbo_id // e.g. 1494 232 241 } 233 242 }
Note: See TracChangeset
for help on using the changeset viewer.