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 airPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,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(UI.utils.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 @@ -321,7 +321,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 @@ -342,7 +342,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 @@ -462,7 +462,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 = UI.store.statementsMatching(stsJust[j].object, ap_ruleName, undefined, subject);
ruleNameFound = ruleNameSts[0].object; // This would be the initial rule name from the
Expand All @@ -472,7 +472,7 @@ airPane.render = function(subject, myDocument) {
for (var k=0; k<t1.length; k++){
var t2 = UI.store.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 @@ -619,7 +619,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 @@ -714,13 +714,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 @@ -741,14 +741,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(UI.utils.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 @@ -1003,7 +1003,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 @@ -1013,7 +1013,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
10 changes: 5 additions & 5 deletions dataContentPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ module.exports = {
function objectTree(obj) {
var res;
switch(obj.termType) {
case 'symbol':
case 'NamedNode':
var anchor = myDocument.createElement('a')
anchor.setAttribute('href', obj.uri)
anchor.addEventListener('click', UI.widgets.openHrefInOutlineMode, true);
anchor.appendChild(myDocument.createTextNode(UI.utils.label(obj)));
return anchor;

case 'literal':
case 'Literal':

if (!obj.datatype || !obj.datatype.uri) {
res = myDocument.createElement('div');
Expand All @@ -107,7 +107,7 @@ module.exports = {
};
return myDocument.createTextNode(obj.value); // placeholder - could be smarter,

case 'bnode':
case 'BlankNode':
if (obj.toNT() in doneBnodes) { // Break infinite recursion
referencedBnodes[(obj.toNT())] = true;
var anchor = myDocument.createElement('a')
Expand Down Expand Up @@ -139,7 +139,7 @@ module.exports = {
var res = UI.panes.dataContents.statementsAsTables(obj.statements, myDocument);
res.setAttribute('class', 'nestedFormula')
return res;
case 'variable':
case 'Variable':
var res = myDocument.createTextNode('?' + obj.uri);
return res;

Expand All @@ -165,7 +165,7 @@ module.exports = {
var td_tree = myDocument.createElement('td')
tr.appendChild(td_tree);
var root = roots[i];
if (root.termType == 'bnode') {
if (root.termType == 'BlankNode') {
td_s.appendChild(myDocument.createTextNode(UI.utils.label(root))); // Don't recurse!
}
else {
Expand Down
6 changes: 3 additions & 3 deletions defaultPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ module.exports = {
outliner.appendPropertyTRs(div, plist, false, filter)
plist = kb.statementsMatching(undefined, undefined, subject)
outliner.appendPropertyTRs(div, plist, true, filter)
if ((subject.termType == 'literal') && (subject.value.slice(0,7) == 'http://'))
if ((subject.termType == 'Literal') && (subject.value.slice(0,7) == 'http://'))
outliner.appendPropertyTRs(div,
[$rdf.st(kb.sym(subject.value), UI.ns.link('uri'), subject)],
true, filter)
if ((subject.termType == 'symbol' &&
if ((subject.termType == 'NamedNode' &&
kb.updater.editable(UI.rdf.Util.uri.docpart(subject.uri), kb))
|| (subject.termType == 'bnode'
|| (subject.termType == 'BlankNode'
&& kb.anyStatementMatching(subject)
&& kb.anyStatementMatching(subject).why
&& kb.anyStatementMatching(subject).why.uri
Expand Down
6 changes: 3 additions & 3 deletions lawPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ LawPane.display = function(myDocument,obj){
var div = myDocument.createElement("div");
for (var i=0; i<obj.elements.length; i++) {
switch(obj.elements[i].termType) {
case 'symbol':
case 'NamedNode':
var anchor = myDocument.createElement('a')
anchor.setAttribute('href', obj.elements[i].uri)
anchor.appendChild(myDocument.createTextNode(UI.utils.label(obj.elements[i])));
div.appendChild(anchor);

case 'literal':
case 'Literal':
if (obj.elements[i].value != undefined)
div.appendChild(myDocument.createTextNode(obj.elements[i].value));
}
Expand Down Expand Up @@ -143,7 +143,7 @@ LawPane.render = function(subject, myDocument) {
stsFound.push(sts[k]);
}
}
if (stsJust[j].object.termType == 'bnode'){
if (stsJust[j].object.termType == 'BlankNode'){
var ruleNameSts = kb.statementsMatching(stsJust[j].object, ap_ruleName, undefined, subject);
var ruleNameFound = ruleNameSts[0].object; // This would be the initial rule name

Expand Down
6 changes: 3 additions & 3 deletions outline/dragDrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,13 @@ var TabulatorOutlinerObserver = {
var transferDataSet = {data: null}
var term = tabulator.Util.getTerm(td)
switch (term.termType) {
case 'symbol':
case 'NamedNode':
transferDataSet.data = this.URItoTransferDataSet(term.uri)
break
case 'bnode':
case 'BlankNode':
transferDataSet.data = this.URItoTransferDataSet(term.toNT())
break
case 'literal':
case 'Literal':
transferDataSet.data = this.URItoTransferDataSet(term.value)
break
}
Expand Down
30 changes: 15 additions & 15 deletions outline/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ module.exports = function(doc) {
}

this.appendAccessIcons = function(kb, node, obj) {
if (obj.termType != 'symbol') return;
if (obj.termType != 'NamedNode') return;
var uris = kb.uris(obj);
uris.sort();
var last = null;
Expand Down Expand Up @@ -324,8 +324,8 @@ if (statement){
}

//set about and put 'expand' icon
if ((obj.termType == 'symbol') || (obj.termType == 'bnode') ||
(obj.termType == 'literal' && obj.value.slice && (
if ((obj.termType == 'NamedNode') || (obj.termType == 'BlankNode') ||
(obj.termType == 'Literal' && obj.value.slice && (
obj.value.slice(0,6) == 'ftp://' ||
obj.value.slice(0,8) == 'https://' ||
obj.value.slice(0,7) == 'http://'))) {
Expand Down Expand Up @@ -383,9 +383,9 @@ if (statement){
td_p.setAttribute('class', internal ? 'pred internal' : 'pred')

switch (predicate.termType){
case 'bnode': //TBD
case 'BlankNode': //TBD
td_p.className='undetermined';
case 'symbol':
case 'NamedNode':
var lab = UI.utils.predicateLabelForXML(predicate, inverse);
break;
case 'collection': // some choices of predicate
Expand Down Expand Up @@ -1031,11 +1031,11 @@ if (statement){
this.showURI = function showURI(about){
if(about && myDocument.getElementById('UserURI')) {
myDocument.getElementById('UserURI').value =
(about.termType == 'symbol') ? about.uri : ''; // blank if no URI
(about.termType == 'NamedNode') ? about.uri : ''; // blank if no URI
} else if(about && tabulator.isExtension) {
var tabStatusBar = gBrowser.ownerDocument.getElementById("tabulator-display");
tabStatusBar.setAttribute('style','display:block');
tabStatusBar.label = (about.termType == 'symbol') ? about.uri : ''; // blank if no URI
tabStatusBar.label = (about.termType == 'NamedNode') ? about.uri : ''; // blank if no URI
if(tabStatusBar.label=="") {
tabStatusBar.setAttribute('style','display:none');
} else {
Expand All @@ -1061,7 +1061,7 @@ if (statement){
var source = st.why;
if (source && source.uri)
sourceWidget.highlight(source, true);
else if (tabulator.isExtension && source.termType == 'bnode')
else if (tabulator.isExtension && source.termType == 'BlankNode')
sourceWidget.highlight(kb.sym(tabulator.sourceURI), true);
}
};
Expand All @@ -1086,7 +1086,7 @@ if (statement){

var about=UI.utils.getTerm(node); //show uri for a newly selectedTd
thisOutline.showURI(about);
//if(tabulator.isExtension && about && about.termType=='symbol') gURLBar.value = about.uri;
//if(tabulator.isExtension && about && about.termType=='NamedNode') gURLBar.value = about.uri;
//about==null when node is a TBD

var st = node.AJAR_statement; //show blue cross when the why of that triple is editable
Expand Down Expand Up @@ -1234,7 +1234,7 @@ if (statement){
function showURI(about){
if(about && myDocument.getElementById('UserURI')) {
myDocument.getElementById('UserURI').value =
(about.termType == 'symbol') ? about.uri : ''; // blank if no URI
(about.termType == 'NamedNode') ? about.uri : ''; // blank if no URI
}
}

Expand Down Expand Up @@ -1779,7 +1779,7 @@ if (statement){
if (subj_uri && !immediate) {
var doc = UI.rdf.uri.docpart(subj_uri);
//dump('@@@@ Fetching before expanding ' + subj_uri + ' type ' + typeof subj_uri + '\n');
if (subject.termType == 'bnode') alert('@@@@@ bnode ' + subj_uri)
if (subject.termType == 'BlankNode') alert('@@@@@ bnode ' + subj_uri)
// Wait till at least the main URI is loaded before expanding:
sf.nowOrWhenFetched(doc, undefined, function(ok, body) {
if (ok) {
Expand Down Expand Up @@ -2006,7 +2006,7 @@ if (statement){
//UI.log.debug("entered VIEWAS_boring_default...");
var rep; //representation in html

if (obj.termType == 'literal')
if (obj.termType == 'Literal')
{
var styles = { 'integer': 'text-align: right;',
'decimal': 'text-align: ".";',
Expand All @@ -2023,12 +2023,12 @@ if (statement){
}
rep.setAttribute('style', style ? style : 'white-space: pre-wrap;');

} else if (obj.termType == 'symbol' || obj.termType == 'bnode') {
} else if (obj.termType == 'NamedNode' || obj.termType == 'BlankNode') {
rep = myDocument.createElement('span');
rep.setAttribute('about', obj.toNT());
thisOutline.appendAccessIcons(kb, rep, obj);

if (obj.termType == 'symbol') {
if (obj.termType == 'NamedNode') {
if (obj.uri.slice(0,4) == 'tel:') {
var num = obj.uri.slice(4);
var anchor = myDocument.createElement('a');
Expand Down Expand Up @@ -2088,7 +2088,7 @@ if (statement){

// FOAF mboxs must NOT be literals -- must be mailto: URIs.

var address = (obj.termType=='symbol') ? obj.uri : obj.value; // this way for now
var address = (obj.termType=='NamedNode') ? obj.uri : obj.value; // this way for now
if (!address) return VIEWAS_boring_default(obj)
var index = address.indexOf('mailto:');
address = (index >= 0) ? address.slice(index + 7) : address;
Expand Down
Loading