Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions js/panes/airPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,14 @@ airPane.render = function(subject, myDocument) {
dump(obj.elements[i]);
dump("\n");

if (obj.elements[i].termType == 'symbol') {
if (obj.elements[i].termType == 'NamedNode') {
var anchor = myDocument.createElement('a');
anchor.setAttribute('href', obj.elements[i].uri);
anchor.appendChild(myDocument.createTextNode(tabulator.Util.label(obj.elements[i])));
//anchor.appendChild(myDocument.createTextNode(obj.elements[i]));
divDescription.appendChild(anchor);
}
else if (obj.elements[i].termType == 'literal') {
else if (obj.elements[i].termType == 'Literal') {
if (obj.elements[i].value != undefined)
divDescription.appendChild(myDocument.createTextNode(obj.elements[i].value));
}
Expand Down Expand Up @@ -319,7 +319,7 @@ airPane.render = function(subject, myDocument) {
//This is a hack to fix the rule appearing instead of the bnode containing the description
correctCurrentRule = "";
for (var i=0; i< currentRule.length; i++){
if (currentRule[i].subject.termType == 'bnode'){
if (currentRule[i].subject.termType == 'BlankNode'){
correctCurrentRule = currentRule[i].subject;
break;
}
Expand All @@ -340,7 +340,7 @@ airPane.render = function(subject, myDocument) {
divPremises.appendChild(statementsAsTables(currentRuleSubExpr[i].object.statements, myDocument));
formulaFound = true;
}
else if (currentRuleSubExpr[i].object.termType == 'bnode'){
else if (currentRuleSubExpr[i].object.termType == 'BlankNode'){
bnodeFound = true;

}
Expand Down Expand Up @@ -460,7 +460,7 @@ airPane.render = function(subject, myDocument) {
}

for (var j=0; j<stsJust.length; j++){
if (stsJust[j].subject.termType == 'formula' && stsJust[j].object.termType == 'bnode'){
if (stsJust[j].subject.termType == 'formula' && stsJust[j].object.termType == 'BlankNode'){

var ruleNameSts = tabulator.kb.statementsMatching(stsJust[j].object, ap_ruleName, undefined, subject);
ruleNameFound = ruleNameSts[0].object; // This would be the initial rule name from the
Expand All @@ -470,7 +470,7 @@ airPane.render = function(subject, myDocument) {
for (var k=0; k<t1.length; k++){
var t2 = tabulator.kb.statementsMatching(t1[k].object, undefined, undefined, subject);
for (var l=0; l<t2.length; l++){
if (t2[l].subject.termType == 'bnode' && t2[l].object.termType == 'formula'){
if (t2[l].subject.termType == 'BlankNode' && t2[l].object.termType == 'formula'){
justificationSts = t2;
divPremises.appendChild(myDocument.createElement('br'));
//divPremises.appendChild(myDocument.createElement('br'));
Expand Down Expand Up @@ -617,7 +617,7 @@ airPane.renderExplanationForStatement = function renderExplanationForStatement(s

var td_o = myDocument.createElement("td");
var a_o = null;
if (stsFound.object.termType == 'literal'){
if (stsFound.object.termType == 'Literal'){
a_o = myDocument.createTextNode(stsFound.object.value);
} else {
var a_o = myDocument.createElement('a');
Expand Down Expand Up @@ -712,13 +712,13 @@ airPane.renderExplanationForStatement = function renderExplanationForStatement(s
if (firstLevel){
p = myDocument.createElement('p');
//Look up the outermost subject and object for information
if (st.subject.termType == 'symbol'){
if (st.subject.termType == 'NamedNode'){
var doc_uri = Util.uri.docpart(st.subject.uri);
if (divDescription.waitingFor.indexOf(doc_uri) < 0 &&
typeof sf.requested[doc_uri]=="undefined")
divDescription.waitingFor.push(doc_uri);
}
if (st.object.termType == 'symbol'){
if (st.object.termType == 'NamedNode'){
var doc_uri = Util.uri.docpart(st.object.uri);
if (divDescription.waitingFor.indexOf(doc_uri) < 0 &&
typeof sf.requested[doc_uri]=="undefined")
Expand All @@ -739,14 +739,14 @@ airPane.renderExplanationForStatement = function renderExplanationForStatement(s
dumpFormula(element, false);
p.appendChild(myDocument.createTextNode(" }"));
break;
case 'symbol':
case 'NamedNode':
var anchor = myDocument.createElement('a');
anchor.setAttribute('href', element.uri);
anchor.appendChild(myDocument.createTextNode(tabulator.Util.label(element)));
p.appendChild(anchor);
p.appendChild(myDocument.createTextNode(" "));
break;
case 'literal':
case 'Literal':
//if (obj.elements[i].value != undefined)
p.appendChild(myDocument.createTextNode(element.value));

Expand Down Expand Up @@ -1001,7 +1001,7 @@ airPane.renderExplanationForStatement = function renderExplanationForStatement(s
}

for (var j=0; j<stsJust.length; j++){
if (stsJust[j].subject.termType == 'formula' && stsJust[j].object.termType == 'bnode'){
if (stsJust[j].subject.termType == 'formula' && stsJust[j].object.termType == 'BlankNode'){

var ruleNameSts = kb.statementsMatching(stsJust[j].object, ap_ruleName, undefined, subject);
ruleNameFound = ruleNameSts[0].object; // This would be the initial rule name from the
Expand All @@ -1011,7 +1011,7 @@ airPane.renderExplanationForStatement = function renderExplanationForStatement(s
for (var k=0; k<t1.length; k++){
var t2 = kb.statementsMatching(t1[k].object, undefined, undefined, subject);
for (var l=0; l<t2.length; l++){
if (t2[l].subject.termType == 'bnode' && t2[l].object.termType == 'formula'){
if (t2[l].subject.termType == 'BlankNode' && t2[l].object.termType == 'formula'){
justificationSts = t2;
divPremises.appendChild(myDocument.createElement('br'));
divPremises.appendChild(myDocument.createElement('br'));
Expand Down
26 changes: 13 additions & 13 deletions js/panes/common/matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,28 @@ tabulator.panes.utils.matrixForQuery = function (dom, query, vx, vy, vvalue, op
var headerColumns = 1;
var columns = []; // Vector
var rows = []; // Associative array

var setCell = function(cell, x, y, value) {
while(cell.firstChild) { // Empty any previous
cell.removeChild(cell.firstChild);
}
cell.setAttribute('style', '');
cell.style.textAlign = "center";

if (options.cellFunction) {
options.cellFunction(cell, x, y, value);
} else {
cell.textContent = tabulator.Util.label(value);
cell.textContent = tabulator.Util.label(value);
}
delete cell.old;
};

var rowFor = function(y1) {
var rowFor = function(y1) {
var y = y1.toNT();
if (rows[y]) return rows[y];
var tr = dom.createElement('tr');
var header = tr.appendChild(dom.createElement('td'));
if (y1.termType = 'symbol') {
if (y1.termType = 'NamedNode') {
kb.fetcher.nowOrWhenFetched(y1.uri.split('#')[0], undefined, function(uri, ok, body){
header.textContent = tabulator.Util.label(y1);
});
Expand All @@ -73,7 +73,7 @@ tabulator.panes.utils.matrixForQuery = function (dom, query, vx, vy, vvalue, op
}
return matrix.appendChild(tr); // return the tr
}

var columnNumberFor = function(x1) {
var xNT = x1.toNT(); // xNT is a NT string
var col = null;
Expand All @@ -82,7 +82,7 @@ tabulator.panes.utils.matrixForQuery = function (dom, query, vx, vy, vvalue, op
if (columns[i] === xNT) {
return i
}

if (((xNT > columns[i]) && options.xDecreasing) ||
((xNT < columns[i]) && !options.xDecreasing)) {
columns = columns.slice(0, i).concat([xNT]).concat(columns.slice(i));
Expand All @@ -94,17 +94,17 @@ tabulator.panes.utils.matrixForQuery = function (dom, query, vx, vy, vvalue, op
if (col === null) {
col = columns.length;
columns.push(xNT);
}
}

// col is the number of the new column, starting from 0
for (var row = matrix.firstChild; row; row = row.nextSibling) { //For every row header or not
var y = row.dataValueNT;
var td = dom.createElement('td'); // Add a new cell
var td = dom.createElement('td'); // Add a new cell
td.style.textAlign = "center";
if (row === matrix.firstChild) {
td.textContent = tabulator.Util.label(x1);
td.textContent = tabulator.Util.label(x1);
} else {
setCell(td, x1, $rdf.fromNT(y), null)
setCell(td, x1, $rdf.fromNT(y), null)
}
if (col === columns.length -1 ) {
row.appendChild(td);
Expand All @@ -113,7 +113,7 @@ tabulator.panes.utils.matrixForQuery = function (dom, query, vx, vy, vvalue, op
for (var j =0; j < col + 1; j++) { // Skip header col too
t = t.nextSibling;
}
row.insertBefore(td, t);
row.insertBefore(td, t);
}
}
return col;
Expand Down Expand Up @@ -206,7 +206,7 @@ tabulator.panes.utils.matrixForQuery = function (dom, query, vx, vy, vvalue, op
columnNumberFor(options.set_x[k]);
}
}

kb.query(query, addCellFromBindings, undefined, whenDone); // Populate the matrix
return matrix;

Expand Down
Loading