diff --git a/lib/matrix.js b/lib/matrix.js index d5e3c3a71..07a80ba18 100644 --- a/lib/matrix.js +++ b/lib/matrix.js @@ -58,7 +58,7 @@ module.exports.matrixForQuery = function (dom, query, vx, vy, vvalue, options, w var header = tr.appendChild(dom.createElement('td')) header.setAttribute('style', 'padding: 0.3em;') header.textContent = utilsModule.label(y1) // first approximation - if (y1.termType = 'symbol') { + if (y1.termType = 'NamedNode') { kb.fetcher.nowOrWhenFetched(y1.uri.split('#')[0], undefined, function (uri, ok, body) { header.textContent = utilsModule.label(y1) }) diff --git a/lib/table.js b/lib/table.js index cccba5a72..b290bb3dd 100644 --- a/lib/table.js +++ b/lib/table.js @@ -423,11 +423,11 @@ module.exports = function renderTableViewPane (doc, options) { this.checkValue = function (term) { var termType = term.termType - if (this.possiblyLiteral && termType != 'literal' && termType != 'symbol') { + if (this.possiblyLiteral && termType != 'Literal' && termType != 'NamedNode') { this.possiblyNumber = false this.possiblyLiteral = false } else if (this.possiblyNumber) { - if (termType != 'literal') { + if (termType != 'Literal') { this.possiblyNumber = false } else { var literalValue = term.value @@ -475,7 +475,7 @@ module.exports = function renderTableViewPane (doc, options) { this.inverse = predicate this.constraints = this.constraints.concat( kb.each(predicate, UI.ns.rdfs('domain'))) - if (predicate.sameTerm(ns.rdfs('subClassOf')) && (other.termType == 'symbol')) { + if (predicate.sameTerm(ns.rdfs('subClassOf')) && (other.termType == 'NamedNode')) { this.superClass = other this.alternatives = kb.each(undefined, ns.rdfs('subClassOf'), other) } @@ -679,7 +679,7 @@ module.exports = function renderTableViewPane (doc, options) { for (var i = 0; i < subjectList.length; ++i) { var type = subjectList[i].object - if (type.termType != 'symbol') { // @@ no bnodes? + if (type.termType != 'NamedNode') { // @@ no bnodes? continue } @@ -937,9 +937,9 @@ module.exports = function renderTableViewPane (doc, options) { function literalSort (rows, column, reverse) { function literalToString (colValue) { if (colValue != null) { - if (colValue.termType == 'literal') { + if (colValue.termType == 'Literal') { return colValue.value.toLowerCase() - } else if (colValue.termType == 'symbol') { + } else if (colValue.termType == 'NamedNode') { return UI.utils.label(colValue).toLowerCase() } return colValue.value.toLowerCase() @@ -1002,9 +1002,9 @@ module.exports = function renderTableViewPane (doc, options) { } else { var literalValue - if (colValue.termType == 'literal') { + if (colValue.termType == 'Literal') { literalValue = colValue.value - } else if (colValue.termType == 'symbol') { + } else if (colValue.termType == 'NamedNode') { literalValue = UI.utils.label(colValue) } else { literalValue = '' @@ -1323,7 +1323,7 @@ module.exports = function renderTableViewPane (doc, options) { } } else { - if (obj.termType == 'literal') { + if (obj.termType == 'Literal') { if (obj.datatype) { if (XSD_DATE_TYPES[obj.datatype.uri]) { return doc.createTextNode(UI.widgets.shortDate(obj.value)) @@ -1335,9 +1335,9 @@ module.exports = function renderTableViewPane (doc, options) { } } return doc.createTextNode(obj.value) - } else if (obj.termType == 'symbol' && column.isImageColumn()) { + } else if (obj.termType == 'NamedNode' && column.isImageColumn()) { return renderImage(obj) - } else if (obj.termType == 'symbol' || obj.termType == 'bnode') { + } else if (obj.termType == 'NamedNode' || obj.termType == 'BlankNode') { return linkToObject(obj, hints) } else if (obj.termType == 'collection') { var span = doc.createElement('span') @@ -1424,9 +1424,9 @@ module.exports = function renderTableViewPane (doc, options) { function valueInList (value, list) { var key = null - if (value.termType == 'literal') { + if (value.termType == 'Literal') { key = 'value' - } else if (value.termType == 'symbol') { + } else if (value.termType == 'NamedNode') { key = 'uri' } else { return list.indexOf(value) >= 0 @@ -1620,16 +1620,16 @@ module.exports = function renderTableViewPane (doc, options) { // If so, we can use the predicate as the predicate for the // column used for the specified variable. - if (statement.predicate.termType == 'symbol' - && statement.object.termType == 'variable') { + if (statement.predicate.termType == 'NamedNode' + && statement.object.termType == 'Variable') { var variable = statement.object.toString() if (variable in columns) { var column = columns[variable] column.setPredicate(statement.predicate, false, statement.subject) } } - if (statement.predicate.termType == 'symbol' - && statement.subject.termType == 'variable') { + if (statement.predicate.termType == 'NamedNode' + && statement.subject.termType == 'Variable') { var variable = statement.subject.toString() if (variable in columns) { var column = columns[variable] diff --git a/lib/utils.js b/lib/utils.js index 5b55a46a4..63f5d1a27 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -430,7 +430,7 @@ UI.utils.label = function (x, initialCap) { // x is an object // Default to label just generated from the URI - if (x.termType == 'bnode') { + if (x.termType == 'BlankNode') { return '...' } if (x.termType == 'collection') { diff --git a/lib/widgets.js b/lib/widgets.js index 30f7baa27..a6bcb3be5 100644 --- a/lib/widgets.js +++ b/lib/widgets.js @@ -897,7 +897,7 @@ widgetModule.propertyTriage = function () { var pi = kb.predicateIndex // One entry for each pred for (var p in pi) { var object = pi[p][0].object - if (object.termType === 'literal') { + if (object.termType === 'Literal') { dp[p] = true nd++ } else {