<commit_before>/*
 * the Record model
 */

Record= $.Model.extend('smart_ui_server.Models.Record',
/* @Static */
{ 
	search: function(sparql, callback) {
		var base_url = '/records/search/xml';
		$.getXML(base_url, sparql,  function(record_list) {

			var lst = record_list.Records.Record;
			
			if (lst === undefined) callback([]);
			
		    if (!(lst instanceof Array)) lst = [lst];
		    
		    var mapped_list = $.map(lst, function(el) 
		    		{return new smart_ui_server.Models.Record(
		    				{record_id: el['@id'], 
		    					label: el['@label'], 
		    					demographics: el.demographics, 
		    					base_url: base_url});});		    
		    callback(mapped_list);
		});
		
	},
	
	get: function(record_id, callback) {
	    var base_url = '/records/' + encodeURIComponent(record_id);<commit_msg>Record_id is a string not a number<commit_after>/*
 * the Record model
 */

Record= $.Model.extend('smart_ui_server.Models.Record',
/* @Static */
{ 
    attributes : { 
	record_id : 'string'
    },
	search: function(sparql, callback) {
		var base_url = '/records/search/xml';
		$.getXML(base_url, sparql,  function(record_list) {

			var lst = record_list.Records.Record;
			
			if (lst === undefined) callback([]);
			
		    if (!(lst instanceof Array)) lst = [lst];
		    
		    var mapped_list = $.map(lst, function(el) 
		    		{return new smart_ui_server.Models.Record(
		    				{record_id: el['@id'], 
		    					label: el['@label'], 
		    					demographics: el.demographics, 
		    					base_url: base_url});});		    
		    callback(mapped_list);
		});
		
	},
	
	get: function(record_id, callback) {
	    var base_url = '/records/' + encodeURIComponent(record_id);
{'fraction_non_alphanumeric': 0.15334128878281622, 'fraction_numerical': 0.0, 'mean_word_length': 2.7266666666666666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2262148', 'n_tokens_mistral': 673, 'n_tokens_neox': 571, 'n_words': 112}