|
From: <tob...@us...> - 2014-03-11 06:59:51
|
Revision: 7924
http://sourceforge.net/p/bigdata/code/7924
Author: tobycraig
Date: 2014-03-11 06:59:48 +0000 (Tue, 11 Mar 2014)
Log Message:
-----------
#827 - Query results are now linked to the Explore pane. Currently only working for vertices.
Modified Paths:
--------------
branches/RDR/bigdata-war/src/html/js/workbench.js
Modified: branches/RDR/bigdata-war/src/html/js/workbench.js
===================================================================
--- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 05:23:16 UTC (rev 7923)
+++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 06:59:48 UTC (rev 7924)
@@ -78,7 +78,7 @@
if(namespace == NAMESPACE) {
// FIXME: what is the desired behaviour when deleting the current namespace?
}
- var url = '/namespace/' + namespace;
+ var url = '/bigdata/namespace/' + namespace;
var settings = {
type: 'DELETE',
success: getNamespaces,
@@ -104,7 +104,7 @@
success: getNamespaces,
error: function(jqXHR, textStatus, errorThrown) { alert(errorThrown); }
};
- $.ajax('/namespace', settings);
+ $.ajax('/bigdata/namespace', settings);
}
$('#namespace-create').submit(createNamespace);
@@ -538,15 +538,19 @@
for(var j=0; j<vars.length; j++) {
if(vars[j] in data.results.bindings[i]) {
var binding = data.results.bindings[i][vars[j]];
+ var text = binding.value;
if(binding.type == 'typed-literal') {
var tdData = ' class="literal" data-datatype="' + binding.datatype + '"';
} else {
+ if(binding.type == 'uri') {
+ text = '<a href="#">' + text + '</a>';
+ }
var tdData = ' class="' + binding.type + '"';
if(binding['xml:lang']) {
tdData += ' data-lang="' + binding['xml:lang'] + '"';
}
}
- tr.append('<td' + tdData + '>' + binding.value + '</td>');
+ tr.append('<td' + tdData + '>' + text + '</td>');
} else {
// no binding
tr.append('<td class="unbound">');
@@ -554,6 +558,13 @@
}
table.append(tr);
}
+
+ $('#query-response a').click(function(e) {
+ e.preventDefault();
+ var uri = $(this).text();
+ loadURI(uri);
+ showTab('explore');
+ });
}
}
@@ -613,7 +624,7 @@
success: updateExploreStart,
error: updateExploreError
};
- $.ajax('/sparql', settings);
+ $.ajax(NAMESPACE_URL, settings);
}
function updateExploreStart(data) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|