23 lines
605 B
JavaScript
23 lines
605 B
JavaScript
![]() |
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||
|
|
||
|
/*
|
||
|
* Parse the results that we got from the SparqlQueryAjaxController.
|
||
|
*
|
||
|
* The input is a complex structure from the controller. The output is an array
|
||
|
* of maps where each map represents a result row, populated with key-value pairs.
|
||
|
*/
|
||
|
sparqlUtils = {
|
||
|
parseSparqlResults: function(data) {
|
||
|
var parsed = [];
|
||
|
$.each(data.results.bindings, function() {
|
||
|
var row = {};
|
||
|
for (var i in this) {
|
||
|
row[i] = this[i].value;
|
||
|
}
|
||
|
parsed.push(row);
|
||
|
});
|
||
|
return parsed;
|
||
|
}
|
||
|
};
|
||
|
|