Skip to content

Commit 90e7e84

Browse files
authored
Merge pull request #3 from linkeddata/dz_update_term_type
Update termType to RDFJS spec
2 parents 4c022c3 + 9e970aa commit 90e7e84

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
@@ -151,7 +151,7 @@ module.exports = function(doc) {
151151
}
152152

153153
this.appendAccessIcons = function(kb, node, obj) {
154-
if (obj.termType != 'symbol') return;
154+
if (obj.termType != 'NamedNode') return;
155155
var uris = kb.uris(obj);
156156
uris.sort();
157157
var last = null;
@@ -325,8 +325,8 @@ if (statement){
325325
}
326326

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

386386
switch (predicate.termType){
387-
case 'bnode': //TBD
387+
case 'BlankNode': //TBD
388388
td_p.className='undetermined';
389-
case 'symbol':
389+
case 'NamedNode':
390390
var lab = UI.utils.predicateLabelForXML(predicate, inverse);
391391
break;
392392
case 'collection': // some choices of predicate
@@ -1032,11 +1032,11 @@ if (statement){
10321032
this.showURI = function showURI(about){
10331033
if(about && myDocument.getElementById('UserURI')) {
10341034
myDocument.getElementById('UserURI').value =
1035-
(about.termType == 'symbol') ? about.uri : ''; // blank if no URI
1035+
(about.termType == 'NamedNode') ? about.uri : ''; // blank if no URI
10361036
} else if(about && tabulator.isExtension) {
10371037
var tabStatusBar = gBrowser.ownerDocument.getElementById("tabulator-display");
10381038
tabStatusBar.setAttribute('style','display:block');
1039-
tabStatusBar.label = (about.termType == 'symbol') ? about.uri : ''; // blank if no URI
1039+
tabStatusBar.label = (about.termType == 'NamedNode') ? about.uri : ''; // blank if no URI
10401040
if(tabStatusBar.label=="") {
10411041
tabStatusBar.setAttribute('style','display:none');
10421042
} else {
@@ -1062,7 +1062,7 @@ if (statement){
10621062
var source = st.why;
10631063
if (source && source.uri)
10641064
sourceWidget.highlight(source, true);
1065-
else if (tabulator.isExtension && source.termType == 'bnode')
1065+
else if (tabulator.isExtension && source.termType == 'BlankNode')
10661066
sourceWidget.highlight(kb.sym(tabulator.sourceURI), true);
10671067
}
10681068
};
@@ -1087,7 +1087,7 @@ if (statement){
10871087

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)