Skip to content

Commit 9e970aa

Browse files
Update termType to RDFJS spec
1 parent 9325f13 commit 9e970aa

8 files changed

Lines changed: 51 additions & 51 deletions

File tree

airPane.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,14 @@ airPane.render = function(subject, myDocument) {
257257
dump(obj.elements[i]);
258258
dump("\n");
259259

260-
if (obj.elements[i].termType == 'symbol') {
260+
if (obj.elements[i].termType == 'NamedNode') {
261261
var anchor = myDocument.createElement('a');
262262
anchor.setAttribute('href', obj.elements[i].uri);
263263
anchor.appendChild(myDocument.createTextNode(UI.utils.label(obj.elements[i])));
264264
//anchor.appendChild(myDocument.createTextNode(obj.elements[i]));
265265
divDescription.appendChild(anchor);
266266
}
267-
else if (obj.elements[i].termType == 'literal') {
267+
else if (obj.elements[i].termType == 'Literal') {
268268
if (obj.elements[i].value != undefined)
269269
divDescription.appendChild(myDocument.createTextNode(obj.elements[i].value));
270270
}
@@ -321,7 +321,7 @@ airPane.render = function(subject, myDocument) {
321321
//This is a hack to fix the rule appearing instead of the bnode containing the description
322322
correctCurrentRule = "";
323323
for (var i=0; i< currentRule.length; i++){
324-
if (currentRule[i].subject.termType == 'bnode'){
324+
if (currentRule[i].subject.termType == 'BlankNode'){
325325
correctCurrentRule = currentRule[i].subject;
326326
break;
327327
}
@@ -342,7 +342,7 @@ airPane.render = function(subject, myDocument) {
342342
divPremises.appendChild(statementsAsTables(currentRuleSubExpr[i].object.statements, myDocument));
343343
formulaFound = true;
344344
}
345-
else if (currentRuleSubExpr[i].object.termType == 'bnode'){
345+
else if (currentRuleSubExpr[i].object.termType == 'BlankNode'){
346346
bnodeFound = true;
347347

348348
}
@@ -462,7 +462,7 @@ airPane.render = function(subject, myDocument) {
462462
}
463463

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

467467
var ruleNameSts = UI.store.statementsMatching(stsJust[j].object, ap_ruleName, undefined, subject);
468468
ruleNameFound = ruleNameSts[0].object; // This would be the initial rule name from the
@@ -472,7 +472,7 @@ airPane.render = function(subject, myDocument) {
472472
for (var k=0; k<t1.length; k++){
473473
var t2 = UI.store.statementsMatching(t1[k].object, undefined, undefined, subject);
474474
for (var l=0; l<t2.length; l++){
475-
if (t2[l].subject.termType == 'bnode' && t2[l].object.termType == 'formula'){
475+
if (t2[l].subject.termType == 'BlankNode' && t2[l].object.termType == 'formula'){
476476
justificationSts = t2;
477477
divPremises.appendChild(myDocument.createElement('br'));
478478
//divPremises.appendChild(myDocument.createElement('br'));
@@ -619,7 +619,7 @@ airPane.renderExplanationForStatement = function renderExplanationForStatement(s
619619

620620
var td_o = myDocument.createElement("td");
621621
var a_o = null;
622-
if (stsFound.object.termType == 'literal'){
622+
if (stsFound.object.termType == 'Literal'){
623623
a_o = myDocument.createTextNode(stsFound.object.value);
624624
} else {
625625
var a_o = myDocument.createElement('a');
@@ -714,13 +714,13 @@ airPane.renderExplanationForStatement = function renderExplanationForStatement(s
714714
if (firstLevel){
715715
p = myDocument.createElement('p');
716716
//Look up the outermost subject and object for information
717-
if (st.subject.termType == 'symbol'){
717+
if (st.subject.termType == 'NamedNode'){
718718
var doc_uri = Util.uri.docpart(st.subject.uri);
719719
if (divDescription.waitingFor.indexOf(doc_uri) < 0 &&
720720
typeof sf.requested[doc_uri]=="undefined")
721721
divDescription.waitingFor.push(doc_uri);
722722
}
723-
if (st.object.termType == 'symbol'){
723+
if (st.object.termType == 'NamedNode'){
724724
var doc_uri = Util.uri.docpart(st.object.uri);
725725
if (divDescription.waitingFor.indexOf(doc_uri) < 0 &&
726726
typeof sf.requested[doc_uri]=="undefined")
@@ -741,14 +741,14 @@ airPane.renderExplanationForStatement = function renderExplanationForStatement(s
741741
dumpFormula(element, false);
742742
p.appendChild(myDocument.createTextNode(" }"));
743743
break;
744-
case 'symbol':
744+
case 'NamedNode':
745745
var anchor = myDocument.createElement('a');
746746
anchor.setAttribute('href', element.uri);
747747
anchor.appendChild(myDocument.createTextNode(UI.utils.label(element)));
748748
p.appendChild(anchor);
749749
p.appendChild(myDocument.createTextNode(" "));
750750
break;
751-
case 'literal':
751+
case 'Literal':
752752
//if (obj.elements[i].value != undefined)
753753
p.appendChild(myDocument.createTextNode(element.value));
754754

@@ -1003,7 +1003,7 @@ airPane.renderExplanationForStatement = function renderExplanationForStatement(s
10031003
}
10041004
10051005
for (var j=0; j<stsJust.length; j++){
1006-
if (stsJust[j].subject.termType == 'formula' && stsJust[j].object.termType == 'bnode'){
1006+
if (stsJust[j].subject.termType == 'formula' && stsJust[j].object.termType == 'BlankNode'){
10071007
10081008
var ruleNameSts = kb.statementsMatching(stsJust[j].object, ap_ruleName, undefined, subject);
10091009
ruleNameFound = ruleNameSts[0].object; // This would be the initial rule name from the
@@ -1013,7 +1013,7 @@ airPane.renderExplanationForStatement = function renderExplanationForStatement(s
10131013
for (var k=0; k<t1.length; k++){
10141014
var t2 = kb.statementsMatching(t1[k].object, undefined, undefined, subject);
10151015
for (var l=0; l<t2.length; l++){
1016-
if (t2[l].subject.termType == 'bnode' && t2[l].object.termType == 'formula'){
1016+
if (t2[l].subject.termType == 'BlankNode' && t2[l].object.termType == 'formula'){
10171017
justificationSts = t2;
10181018
divPremises.appendChild(myDocument.createElement('br'));
10191019
divPremises.appendChild(myDocument.createElement('br'));

dataContentPane.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ module.exports = {
8585
function objectTree(obj) {
8686
var res;
8787
switch(obj.termType) {
88-
case 'symbol':
88+
case 'NamedNode':
8989
var anchor = myDocument.createElement('a')
9090
anchor.setAttribute('href', obj.uri)
9191
anchor.addEventListener('click', UI.widgets.openHrefInOutlineMode, true);
9292
anchor.appendChild(myDocument.createTextNode(UI.utils.label(obj)));
9393
return anchor;
9494

95-
case 'literal':
95+
case 'Literal':
9696

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

110-
case 'bnode':
110+
case 'BlankNode':
111111
if (obj.toNT() in doneBnodes) { // Break infinite recursion
112112
referencedBnodes[(obj.toNT())] = true;
113113
var anchor = myDocument.createElement('a')
@@ -139,7 +139,7 @@ module.exports = {
139139
var res = UI.panes.dataContents.statementsAsTables(obj.statements, myDocument);
140140
res.setAttribute('class', 'nestedFormula')
141141
return res;
142-
case 'variable':
142+
case 'Variable':
143143
var res = myDocument.createTextNode('?' + obj.uri);
144144
return res;
145145

@@ -165,7 +165,7 @@ module.exports = {
165165
var td_tree = myDocument.createElement('td')
166166
tr.appendChild(td_tree);
167167
var root = roots[i];
168-
if (root.termType == 'bnode') {
168+
if (root.termType == 'BlankNode') {
169169
td_s.appendChild(myDocument.createTextNode(UI.utils.label(root))); // Don't recurse!
170170
}
171171
else {

defaultPane.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ module.exports = {
4343
outliner.appendPropertyTRs(div, plist, false, filter)
4444
plist = kb.statementsMatching(undefined, undefined, subject)
4545
outliner.appendPropertyTRs(div, plist, true, filter)
46-
if ((subject.termType == 'literal') && (subject.value.slice(0,7) == 'http://'))
46+
if ((subject.termType == 'Literal') && (subject.value.slice(0,7) == 'http://'))
4747
outliner.appendPropertyTRs(div,
4848
[$rdf.st(kb.sym(subject.value), UI.ns.link('uri'), subject)],
4949
true, filter)
50-
if ((subject.termType == 'symbol' &&
50+
if ((subject.termType == 'NamedNode' &&
5151
kb.updater.editable(UI.rdf.Util.uri.docpart(subject.uri), kb))
52-
|| (subject.termType == 'bnode'
52+
|| (subject.termType == 'BlankNode'
5353
&& kb.anyStatementMatching(subject)
5454
&& kb.anyStatementMatching(subject).why
5555
&& kb.anyStatementMatching(subject).why.uri

lawPane.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ LawPane.display = function(myDocument,obj){
5252
var div = myDocument.createElement("div");
5353
for (var i=0; i<obj.elements.length; i++) {
5454
switch(obj.elements[i].termType) {
55-
case 'symbol':
55+
case 'NamedNode':
5656
var anchor = myDocument.createElement('a')
5757
anchor.setAttribute('href', obj.elements[i].uri)
5858
anchor.appendChild(myDocument.createTextNode(UI.utils.label(obj.elements[i])));
5959
div.appendChild(anchor);
6060

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

outline/dragDrop.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,13 @@ var TabulatorOutlinerObserver = {
310310
var transferDataSet = {data: null}
311311
var term = tabulator.Util.getTerm(td)
312312
switch (term.termType) {
313-
case 'symbol':
313+
case 'NamedNode':
314314
transferDataSet.data = this.URItoTransferDataSet(term.uri)
315315
break
316-
case 'bnode':
316+
case 'BlankNode':
317317
transferDataSet.data = this.URItoTransferDataSet(term.toNT())
318318
break
319-
case 'literal':
319+
case 'Literal':
320320
transferDataSet.data = this.URItoTransferDataSet(term.value)
321321
break
322322
}

outline/manager.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ module.exports = function(doc) {
150150
}
151151

152152
this.appendAccessIcons = function(kb, node, obj) {
153-
if (obj.termType != 'symbol') return;
153+
if (obj.termType != 'NamedNode') return;
154154
var uris = kb.uris(obj);
155155
uris.sort();
156156
var last = null;
@@ -324,8 +324,8 @@ if (statement){
324324
}
325325

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

385385
switch (predicate.termType){
386-
case 'bnode': //TBD
386+
case 'BlankNode': //TBD
387387
td_p.className='undetermined';
388-
case 'symbol':
388+
case 'NamedNode':
389389
var lab = UI.utils.predicateLabelForXML(predicate, inverse);
390390
break;
391391
case 'collection': // some choices of predicate
@@ -1031,11 +1031,11 @@ if (statement){
10311031
this.showURI = function showURI(about){
10321032
if(about && myDocument.getElementById('UserURI')) {
10331033
myDocument.getElementById('UserURI').value =
1034-
(about.termType == 'symbol') ? about.uri : ''; // blank if no URI
1034+
(about.termType == 'NamedNode') ? about.uri : ''; // blank if no URI
10351035
} else if(about && tabulator.isExtension) {
10361036
var tabStatusBar = gBrowser.ownerDocument.getElementById("tabulator-display");
10371037
tabStatusBar.setAttribute('style','display:block');
1038-
tabStatusBar.label = (about.termType == 'symbol') ? about.uri : ''; // blank if no URI
1038+
tabStatusBar.label = (about.termType == 'NamedNode') ? about.uri : ''; // blank if no URI
10391039
if(tabStatusBar.label=="") {
10401040
tabStatusBar.setAttribute('style','display:none');
10411041
} else {
@@ -1061,7 +1061,7 @@ if (statement){
10611061
var source = st.why;
10621062
if (source && source.uri)
10631063
sourceWidget.highlight(source, true);
1064-
else if (tabulator.isExtension && source.termType == 'bnode')
1064+
else if (tabulator.isExtension && source.termType == 'BlankNode')
10651065
sourceWidget.highlight(kb.sym(tabulator.sourceURI), true);
10661066
}
10671067
};
@@ -1086,7 +1086,7 @@ if (statement){
10861086

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

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

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

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

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

2031-
if (obj.termType == 'symbol') {
2031+
if (obj.termType == 'NamedNode') {
20322032
if (obj.uri.slice(0,4) == 'tel:') {
20332033
var num = obj.uri.slice(4);
20342034
var anchor = myDocument.createElement('a');
@@ -2088,7 +2088,7 @@ if (statement){
20882088

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

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

0 commit comments

Comments
 (0)