rdflib 2.2.21 → 2.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/rdflib.min.js +1 -1
  2. package/dist/rdflib.min.js.LICENSE.txt +9 -1
  3. package/dist/rdflib.min.js.map +1 -1
  4. package/esm/blank-node.js +61 -114
  5. package/esm/class-order.js +1 -1
  6. package/esm/collection.js +70 -128
  7. package/esm/convert.js +1 -2
  8. package/esm/default-graph.js +14 -48
  9. package/esm/empty.js +8 -39
  10. package/esm/factories/canonical-data-factory.js +33 -65
  11. package/esm/factories/extended-term-factory.js +18 -25
  12. package/esm/factories/factory-types.js +3 -2
  13. package/esm/factories/rdflib-data-factory.js +9 -19
  14. package/esm/fetcher.js +1341 -1854
  15. package/esm/formula.js +639 -846
  16. package/esm/index.js +40 -76
  17. package/esm/jsonldparser.js +24 -49
  18. package/esm/jsonparser.js +1 -8
  19. package/esm/lists.js +47 -110
  20. package/esm/literal.js +120 -189
  21. package/esm/log.js +7 -7
  22. package/esm/n3parser.js +1015 -1412
  23. package/esm/named-node.js +70 -119
  24. package/esm/namespace.js +2 -5
  25. package/esm/node-internal.js +73 -110
  26. package/esm/node.js +2 -7
  27. package/esm/parse.js +12 -19
  28. package/esm/patch-parser.js +10 -30
  29. package/esm/query-to-sparql.js +0 -18
  30. package/esm/query.js +63 -147
  31. package/esm/rdfaparser.js +794 -997
  32. package/esm/rdfxmlparser.js +347 -461
  33. package/esm/serialize.js +9 -27
  34. package/esm/serializer.js +820 -1049
  35. package/esm/sparql-to-query.js +44 -134
  36. package/esm/statement.js +54 -85
  37. package/esm/store.js +830 -1103
  38. package/esm/types.js +22 -21
  39. package/esm/update-manager.js +869 -1106
  40. package/esm/updates-via.js +104 -161
  41. package/esm/uri.js +9 -53
  42. package/esm/utils/default-graph-uri.js +3 -2
  43. package/esm/utils/termValue.js +0 -1
  44. package/esm/utils/terms.js +19 -21
  45. package/esm/utils-js.js +20 -61
  46. package/esm/utils.js +10 -21
  47. package/esm/variable.js +32 -78
  48. package/esm/xsd.js +2 -2
  49. package/lib/blank-node.js +60 -113
  50. package/lib/class-order.js +1 -2
  51. package/lib/collection.js +69 -131
  52. package/lib/convert.js +3 -9
  53. package/lib/default-graph.js +13 -52
  54. package/lib/empty.js +8 -43
  55. package/lib/factories/canonical-data-factory.js +35 -79
  56. package/lib/factories/extended-term-factory.js +18 -32
  57. package/lib/factories/factory-types.d.ts +6 -6
  58. package/lib/factories/factory-types.js +1 -4
  59. package/lib/factories/rdflib-data-factory.js +9 -23
  60. package/lib/fetcher.d.ts +6 -6
  61. package/lib/fetcher.js +1370 -1843
  62. package/lib/formula.js +640 -855
  63. package/lib/index.js +66 -152
  64. package/lib/jsonldparser.js +23 -53
  65. package/lib/jsonparser.js +1 -10
  66. package/lib/lists.js +55 -112
  67. package/lib/literal.js +120 -195
  68. package/lib/log.d.ts +0 -6
  69. package/lib/log.js +7 -8
  70. package/lib/n3parser.js +1030 -1436
  71. package/lib/named-node.js +69 -126
  72. package/lib/namespace.js +2 -7
  73. package/lib/node-internal.js +74 -107
  74. package/lib/node.js +2 -12
  75. package/lib/parse.d.ts +1 -1
  76. package/lib/parse.js +12 -32
  77. package/lib/patch-parser.js +11 -34
  78. package/lib/query-to-sparql.js +0 -23
  79. package/lib/query.js +62 -167
  80. package/lib/rdfaparser.js +796 -1009
  81. package/lib/rdfxmlparser.js +349 -466
  82. package/lib/serialize.js +11 -37
  83. package/lib/serializer.js +823 -1064
  84. package/lib/sparql-to-query.js +42 -167
  85. package/lib/statement.js +55 -91
  86. package/lib/store.d.ts +1 -1
  87. package/lib/store.js +850 -1112
  88. package/lib/tf-types.d.ts +4 -4
  89. package/lib/types.d.ts +8 -8
  90. package/lib/types.js +23 -23
  91. package/lib/update-manager.d.ts +1 -1
  92. package/lib/update-manager.js +865 -1103
  93. package/lib/updates-via.js +105 -164
  94. package/lib/uri.js +8 -61
  95. package/lib/utils/default-graph-uri.js +3 -5
  96. package/lib/utils/termValue.js +0 -2
  97. package/lib/utils/terms.js +19 -40
  98. package/lib/utils-js.js +23 -88
  99. package/lib/utils.js +10 -27
  100. package/lib/variable.js +34 -85
  101. package/lib/xsd-internal.js +0 -3
  102. package/lib/xsd.js +2 -6
  103. package/package.json +36 -36
  104. package/src/fetcher.ts +2 -2
  105. package/src/update-manager.ts +12 -7
  106. package/changes.txt +0 -59
package/esm/rdfaparser.js CHANGED
@@ -1,21 +1,23 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
1
  // RDFa Parser for rdflib.js
2
+
4
3
  // Originally by: Alex Milowski
5
4
  // From https://github.com/alexmilowski/green-turtle
6
5
  // Converted: timbl 2015-08-25 not yet working
7
6
  // Added wrapper: csarven 2016-05-09 working
7
+
8
8
  // RDFaProcessor.prototype = new Object() // Was URIResolver
9
+
9
10
  // RDFaProcessor.prototype.constructor=RDFaProcessor
11
+
10
12
  // options.base = base URI not really an option, shopuld always be set.
11
13
  //
14
+
12
15
  import BlankNode from './blank-node';
13
16
  import Literal from './literal';
14
17
  import NamedNode from './named-node';
15
18
  import * as Uri from './uri';
16
19
  import * as Util from './utils-js';
17
20
  import rdf from './factories/canonical-data-factory';
18
-
19
21
  if (typeof Node === 'undefined') {
20
22
  // @@@@@@ Global. Interface to xmldom.
21
23
  var Node = {
@@ -33,11 +35,8 @@ if (typeof Node === 'undefined') {
33
35
  NOTATION_NODE: 12
34
36
  };
35
37
  }
36
-
37
- var RDFaProcessor = /*#__PURE__*/function () {
38
- function RDFaProcessor(kb, options) {
39
- _classCallCheck(this, RDFaProcessor);
40
-
38
+ export default class RDFaProcessor {
39
+ constructor(kb, options) {
41
40
  this.options = options || {};
42
41
  this.kb = kb;
43
42
  this.target = options.target || {
@@ -46,10 +45,10 @@ var RDFaProcessor = /*#__PURE__*/function () {
46
45
  prefixes: {},
47
46
  terms: {}
48
47
  }
49
- }; // XXX: Added to track bnodes
50
-
51
- this.blankNodes = []; // XXX: Added for normalisation
52
-
48
+ };
49
+ // XXX: Added to track bnodes
50
+ this.blankNodes = [];
51
+ // XXX: Added for normalisation
53
52
  this.htmlOptions = {
54
53
  'selfClosing': 'br img input area base basefont col colgroup source wbr isindex link meta param hr'
55
54
  };
@@ -66,1105 +65,903 @@ var RDFaProcessor = /*#__PURE__*/function () {
66
65
  this.finishedHandlers = [];
67
66
  this.init();
68
67
  }
69
-
70
- _createClass(RDFaProcessor, [{
71
- key: "addTriple",
72
- value: function addTriple(origin, subject, predicate, object) {
73
- var su, ob, pr, or;
74
-
75
- if (typeof subject === 'undefined') {
76
- su = rdf.namedNode(this.options.base);
77
- } else {
78
- su = this.toRDFNodeObject(subject);
79
- }
80
-
81
- pr = this.toRDFNodeObject(predicate);
82
- ob = this.toRDFNodeObject(object);
83
- or = rdf.namedNode(this.options.base); // console.log('Adding { ' + su + ' ' + pr + ' ' + ob + ' ' + or + ' }')
84
-
85
- this.kb.add(su, pr, ob, or);
68
+ addTriple(origin, subject, predicate, object) {
69
+ var su, ob, pr, or;
70
+ if (typeof subject === 'undefined') {
71
+ su = rdf.namedNode(this.options.base);
72
+ } else {
73
+ su = this.toRDFNodeObject(subject);
86
74
  }
87
- }, {
88
- key: "ancestorPath",
89
- value: function ancestorPath(node) {
90
- var path = '';
91
-
92
- while (node && node.nodeType !== Node.DOCUMENT_NODE) {
93
- path = '/' + node.localName + path;
94
- node = node.parentNode;
95
- }
96
-
97
- return path;
75
+ pr = this.toRDFNodeObject(predicate);
76
+ ob = this.toRDFNodeObject(object);
77
+ or = rdf.namedNode(this.options.base);
78
+ // console.log('Adding { ' + su + ' ' + pr + ' ' + ob + ' ' + or + ' }')
79
+ this.kb.add(su, pr, ob, or);
80
+ }
81
+ ancestorPath(node) {
82
+ var path = '';
83
+ while (node && node.nodeType !== Node.DOCUMENT_NODE) {
84
+ path = '/' + node.localName + path;
85
+ node = node.parentNode;
98
86
  }
99
- }, {
100
- key: "copyMappings",
101
- value: function copyMappings(mappings) {
102
- var newMappings = {};
103
-
104
- for (var k in mappings) {
105
- newMappings[k] = mappings[k];
87
+ return path;
88
+ }
89
+ copyMappings(mappings) {
90
+ var newMappings = {};
91
+ for (var k in mappings) {
92
+ newMappings[k] = mappings[k];
93
+ }
94
+ return newMappings;
95
+ }
96
+ copyProperties() {}
97
+ deriveDateTimeType(value) {
98
+ for (var i = 0; i < RDFaProcessor.dateTimeTypes.length; i++) {
99
+ // console.log("Checking "+value+" against "+RDFaProcessor.dateTimeTypes[i].type)
100
+ var matched = RDFaProcessor.dateTimeTypes[i].pattern.exec(value);
101
+ if (matched && matched[0].length === value.length) {
102
+ // console.log("Matched!")
103
+ return RDFaProcessor.dateTimeTypes[i].type;
106
104
  }
107
-
108
- return newMappings;
109
105
  }
110
- }, {
111
- key: "copyProperties",
112
- value: function copyProperties() {}
113
- }, {
114
- key: "deriveDateTimeType",
115
- value: function deriveDateTimeType(value) {
116
- for (var i = 0; i < RDFaProcessor.dateTimeTypes.length; i++) {
117
- // console.log("Checking "+value+" against "+RDFaProcessor.dateTimeTypes[i].type)
118
- var matched = RDFaProcessor.dateTimeTypes[i].pattern.exec(value);
119
-
120
- if (matched && matched[0].length === value.length) {
121
- // console.log("Matched!")
122
- return RDFaProcessor.dateTimeTypes[i].type;
106
+ return null;
107
+ }
108
+ init() {}
109
+ newBlankNode() {
110
+ this.blankCounter++;
111
+ return '_:' + this.blankCounter;
112
+ }
113
+ newSubjectOrigin(origin, subject) {}
114
+ parseCURIE(value, prefixes, base) {
115
+ var colon = value.indexOf(':');
116
+ var uri;
117
+ if (colon >= 0) {
118
+ var prefix = value.substring(0, colon);
119
+ if (prefix === '') {
120
+ // default prefix
121
+ uri = prefixes[''];
122
+ return uri ? uri + value.substring(colon + 1) : null;
123
+ } else if (prefix === '_') {
124
+ // blank node
125
+ return '_:' + value.substring(colon + 1);
126
+ } else if (RDFaProcessor.NCNAME.test(prefix)) {
127
+ uri = prefixes[prefix];
128
+ if (uri) {
129
+ return uri + value.substring(colon + 1);
123
130
  }
124
131
  }
125
-
126
- return null;
127
132
  }
128
- }, {
129
- key: "init",
130
- value: function init() {}
131
- }, {
132
- key: "newBlankNode",
133
- value: function newBlankNode() {
134
- this.blankCounter++;
135
- return '_:' + this.blankCounter;
133
+ return null;
134
+ }
135
+ parseCURIEOrURI(value, prefixes, base) {
136
+ var curie = this.parseCURIE(value, prefixes, base);
137
+ if (curie) {
138
+ return curie;
136
139
  }
137
- }, {
138
- key: "newSubjectOrigin",
139
- value: function newSubjectOrigin(origin, subject) {}
140
- }, {
141
- key: "parseCURIE",
142
- value: function parseCURIE(value, prefixes, base) {
143
- var colon = value.indexOf(':');
144
- var uri;
145
-
146
- if (colon >= 0) {
147
- var prefix = value.substring(0, colon);
148
-
149
- if (prefix === '') {
150
- // default prefix
151
- uri = prefixes[''];
152
- return uri ? uri + value.substring(colon + 1) : null;
153
- } else if (prefix === '_') {
154
- // blank node
155
- return '_:' + value.substring(colon + 1);
156
- } else if (RDFaProcessor.NCNAME.test(prefix)) {
157
- uri = prefixes[prefix];
158
-
159
- if (uri) {
160
- return uri + value.substring(colon + 1);
161
- }
162
- }
163
- }
164
-
140
+ return this.resolveAndNormalize(base, value);
141
+ }
142
+ parsePredicate(value, defaultVocabulary, terms, prefixes, base, ignoreTerms) {
143
+ if (value === '') {
165
144
  return null;
166
145
  }
167
- }, {
168
- key: "parseCURIEOrURI",
169
- value: function parseCURIEOrURI(value, prefixes, base) {
170
- var curie = this.parseCURIE(value, prefixes, base);
171
-
172
- if (curie) {
173
- return curie;
174
- }
175
-
176
- return this.resolveAndNormalize(base, value);
146
+ var predicate = this.parseTermOrCURIEOrAbsURI(value, defaultVocabulary, ignoreTerms ? null : terms, prefixes, base);
147
+ if (predicate && predicate.indexOf('_:') === 0) {
148
+ return null;
177
149
  }
178
- }, {
179
- key: "parsePredicate",
180
- value: function parsePredicate(value, defaultVocabulary, terms, prefixes, base, ignoreTerms) {
181
- if (value === '') {
182
- return null;
150
+ return predicate;
151
+ }
152
+ parsePrefixMappings(str, target) {
153
+ var values = this.tokenize(str);
154
+ var prefix = null;
155
+ // var uri = null
156
+ for (var i = 0; i < values.length; i++) {
157
+ if (values[i][values[i].length - 1] === ':') {
158
+ prefix = values[i].substring(0, values[i].length - 1);
159
+ } else if (prefix) {
160
+ target[prefix] = this.options.base ? Uri.join(values[i], this.options.base) : values[i];
161
+ prefix = null;
183
162
  }
163
+ }
164
+ }
165
+ static parseRDFaDOM(dom, kb, base) {
166
+ var p = new RDFaProcessor(kb, {
167
+ 'base': base
168
+ });
169
+ // Cannot assign to read only property 'baseURI' of object '#<XMLDocument>':
170
+ if (!dom.baseURI) {
171
+ // Note this became a read-only attribute some time before 2018
172
+ dom.baseURI = base; // oinly set if not already set
173
+ }
184
174
 
185
- var predicate = this.parseTermOrCURIEOrAbsURI(value, defaultVocabulary, ignoreTerms ? null : terms, prefixes, base);
186
-
187
- if (predicate && predicate.indexOf('_:') === 0) {
175
+ p.process(dom, {
176
+ baseURI: base
177
+ });
178
+ }
179
+ parseSafeCURIEOrCURIEOrURI(value, prefixes, base) {
180
+ value = this.trim(value);
181
+ if (value.charAt(0) === '[' && value.charAt(value.length - 1) === ']') {
182
+ value = value.substring(1, value.length - 1);
183
+ value = value.trim(value);
184
+ if (value.length === 0) {
188
185
  return null;
189
186
  }
190
-
191
- return predicate;
192
- }
193
- }, {
194
- key: "parsePrefixMappings",
195
- value: function parsePrefixMappings(str, target) {
196
- var values = this.tokenize(str);
197
- var prefix = null; // var uri = null
198
-
199
- for (var i = 0; i < values.length; i++) {
200
- if (values[i][values[i].length - 1] === ':') {
201
- prefix = values[i].substring(0, values[i].length - 1);
202
- } else if (prefix) {
203
- target[prefix] = this.options.base ? Uri.join(values[i], this.options.base) : values[i];
204
- prefix = null;
205
- }
187
+ if (value === '_:') {
188
+ // the one node
189
+ return this.theOne;
206
190
  }
191
+ return this.parseCURIE(value, prefixes, base);
192
+ } else {
193
+ return this.parseCURIEOrURI(value, prefixes, base);
207
194
  }
208
- }, {
209
- key: "parseSafeCURIEOrCURIEOrURI",
210
- value: function parseSafeCURIEOrCURIEOrURI(value, prefixes, base) {
211
- value = this.trim(value);
212
-
213
- if (value.charAt(0) === '[' && value.charAt(value.length - 1) === ']') {
214
- value = value.substring(1, value.length - 1);
215
- value = value.trim(value);
216
-
217
- if (value.length === 0) {
218
- return null;
219
- }
220
-
221
- if (value === '_:') {
222
- // the one node
223
- return this.theOne;
224
- }
225
-
226
- return this.parseCURIE(value, prefixes, base);
227
- } else {
228
- return this.parseCURIEOrURI(value, prefixes, base);
195
+ }
196
+ parseTermOrCURIEOrAbsURI(value, defaultVocabulary, terms, prefixes, base) {
197
+ // alert("Parsing "+value+" with default vocab "+defaultVocabulary)
198
+ value = this.trim(value);
199
+ var curie = this.parseCURIE(value, prefixes, base);
200
+ if (curie) {
201
+ return curie;
202
+ } else if (terms) {
203
+ if (defaultVocabulary && !this.absURIRE.exec(value)) {
204
+ return defaultVocabulary + value;
229
205
  }
230
- }
231
- }, {
232
- key: "parseTermOrCURIEOrAbsURI",
233
- value: function parseTermOrCURIEOrAbsURI(value, defaultVocabulary, terms, prefixes, base) {
234
- // alert("Parsing "+value+" with default vocab "+defaultVocabulary)
235
- value = this.trim(value);
236
- var curie = this.parseCURIE(value, prefixes, base);
237
-
238
- if (curie) {
239
- return curie;
240
- } else if (terms) {
241
- if (defaultVocabulary && !this.absURIRE.exec(value)) {
242
- return defaultVocabulary + value;
243
- }
244
-
245
- var term = terms[value];
246
-
247
- if (term) {
248
- return term;
249
- }
250
-
251
- var lcvalue = value.toLowerCase();
252
- term = terms[lcvalue];
253
-
254
- if (term) {
255
- return term;
256
- }
206
+ var term = terms[value];
207
+ if (term) {
208
+ return term;
257
209
  }
258
-
259
- if (this.absURIRE.exec(value)) {
260
- return this.resolveAndNormalize(base, value);
210
+ var lcvalue = value.toLowerCase();
211
+ term = terms[lcvalue];
212
+ if (term) {
213
+ return term;
261
214
  }
262
-
263
- return null;
264
215
  }
265
- }, {
266
- key: "parseTermOrCURIEOrURI",
267
- value: function parseTermOrCURIEOrURI(value, defaultVocabulary, terms, prefixes, base) {
268
- // alert("Parsing "+value+" with default vocab "+defaultVocabulary)
269
- value = this.trim(value);
270
- var curie = this.parseCURIE(value, prefixes, base);
271
-
272
- if (curie) {
273
- return curie;
274
- } else {
275
- var term = terms[value];
276
-
277
- if (term) {
278
- return term;
279
- }
280
-
281
- var lcvalue = value.toLowerCase();
282
- term = terms[lcvalue];
283
-
284
- if (term) {
285
- return term;
286
- }
287
-
288
- if (defaultVocabulary && !this.absURIRE.exec(value)) {
289
- return defaultVocabulary + value;
290
- }
291
- }
292
-
216
+ if (this.absURIRE.exec(value)) {
293
217
  return this.resolveAndNormalize(base, value);
294
218
  }
295
- }, {
296
- key: "parseURI",
297
- value: function parseURI(uri) {
298
- return uri; // We just use strings as URIs, not objects now.
219
+ return null;
220
+ }
221
+ parseTermOrCURIEOrURI(value, defaultVocabulary, terms, prefixes, base) {
222
+ // alert("Parsing "+value+" with default vocab "+defaultVocabulary)
223
+ value = this.trim(value);
224
+ var curie = this.parseCURIE(value, prefixes, base);
225
+ if (curie) {
226
+ return curie;
227
+ } else {
228
+ var term = terms[value];
229
+ if (term) {
230
+ return term;
231
+ }
232
+ var lcvalue = value.toLowerCase();
233
+ term = terms[lcvalue];
234
+ if (term) {
235
+ return term;
236
+ }
237
+ if (defaultVocabulary && !this.absURIRE.exec(value)) {
238
+ return defaultVocabulary + value;
239
+ }
299
240
  }
300
- }, {
301
- key: "process",
302
- value: function process(node, options) {
303
- /*
304
- if (!window.console) {
305
- window.console = { log: function() {} }
306
- } */
307
- options = options || {};
308
- var base;
309
-
310
- if (node.nodeType === Node.DOCUMENT_NODE) {
311
- if (node.baseURI && !options.baseURI) {
312
- options.baseURI = node.baseURI; // be defensive as DOM implementations vary
313
- }
314
-
315
- base = node.baseURI;
316
- node = node.documentElement;
317
-
318
- if (!node.baseURI) {
319
- node.baseURI = base;
320
- }
241
+ return this.resolveAndNormalize(base, value);
242
+ }
243
+ parseURI(uri) {
244
+ return uri; // We just use strings as URIs, not objects now.
245
+ }
321
246
 
322
- this.setContext(node);
323
- } else if (node.parentNode.nodeType === Node.DOCUMENT_NODE) {
324
- this.setContext(node);
247
+ process(node, options) {
248
+ /*
249
+ if (!window.console) {
250
+ window.console = { log: function() {} }
251
+ } */
252
+ options = options || {};
253
+ var base;
254
+ if (node.nodeType === Node.DOCUMENT_NODE) {
255
+ if (node.baseURI && !options.baseURI) {
256
+ options.baseURI = node.baseURI; // be defensive as DOM implementations vary
325
257
  }
326
258
 
327
- var queue = []; // Fix for Firefox that includes the hash in the base URI
328
-
329
- var removeHash = function removeHash(baseURI) {
330
- // Fix for undefined baseURI property
331
- if (!baseURI && options && options.baseURI) {
332
- return options.baseURI;
333
- }
334
-
335
- var hash = baseURI.indexOf('#');
336
-
337
- if (hash >= 0) {
338
- baseURI = baseURI.substring(0, hash);
339
- }
340
-
341
- if (options && options.baseURIMap) {
342
- baseURI = options.baseURIMap(baseURI);
259
+ base = node.baseURI;
260
+ node = node.documentElement;
261
+ if (!node.baseURI) {
262
+ node.baseURI = base;
263
+ }
264
+ this.setContext(node);
265
+ } else if (node.parentNode.nodeType === Node.DOCUMENT_NODE) {
266
+ this.setContext(node);
267
+ }
268
+ var queue = [];
269
+ // Fix for Firefox that includes the hash in the base URI
270
+ var removeHash = function (baseURI) {
271
+ // Fix for undefined baseURI property
272
+ if (!baseURI && options && options.baseURI) {
273
+ return options.baseURI;
274
+ }
275
+ var hash = baseURI.indexOf('#');
276
+ if (hash >= 0) {
277
+ baseURI = baseURI.substring(0, hash);
278
+ }
279
+ if (options && options.baseURIMap) {
280
+ baseURI = options.baseURIMap(baseURI);
281
+ }
282
+ return baseURI;
283
+ };
284
+ queue.push({
285
+ current: node,
286
+ context: this.push(null, removeHash(node.baseURI))
287
+ });
288
+ while (queue.length > 0) {
289
+ var item = queue.shift();
290
+ if (item.parent) {
291
+ // Sequence Step 14: list triple generation
292
+ if (item.context.parent && item.context.parent.listMapping === item.listMapping) {
293
+ // Skip a child context with exactly the same mapping
294
+ continue;
343
295
  }
344
-
345
- return baseURI;
346
- };
347
-
348
- queue.push({
349
- current: node,
350
- context: this.push(null, removeHash(node.baseURI))
351
- });
352
-
353
- while (queue.length > 0) {
354
- var item = queue.shift();
355
-
356
- if (item.parent) {
357
- // Sequence Step 14: list triple generation
358
- if (item.context.parent && item.context.parent.listMapping === item.listMapping) {
359
- // Skip a child context with exactly the same mapping
360
- continue;
361
- } // console.log("Generating lists for "+item.subject+", tag "+item.parent.localName)
362
-
363
-
364
- for (var _predicate in item.listMapping) {
365
- var list = item.listMapping[_predicate];
366
-
367
- if (list.length === 0) {
368
- this.addTriple(item.parent, item.subject, _predicate, {
369
- type: RDFaProcessor.objectURI,
370
- value: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'
371
- });
372
- continue;
373
- }
374
-
375
- var bnodes = [];
376
-
377
- for (var _i = 0; _i < list.length; _i++) {
378
- bnodes.push(this.newBlankNode()); // this.newSubject(item.parent,bnodes[i])
379
- }
380
-
381
- for (var _i2 = 0; _i2 < bnodes.length; _i2++) {
382
- this.addTriple(item.parent, bnodes[_i2], 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first', list[_i2]);
383
- this.addTriple(item.parent, bnodes[_i2], 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest', {
384
- type: RDFaProcessor.objectURI,
385
- value: _i2 + 1 < bnodes.length ? bnodes[_i2 + 1] : 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'
386
- });
387
- }
388
-
389
- this.addTriple(item.parent, item.subject, _predicate, {
296
+ // console.log("Generating lists for "+item.subject+", tag "+item.parent.localName)
297
+ for (let predicate in item.listMapping) {
298
+ var list = item.listMapping[predicate];
299
+ if (list.length === 0) {
300
+ this.addTriple(item.parent, item.subject, predicate, {
390
301
  type: RDFaProcessor.objectURI,
391
- value: bnodes[0]
302
+ value: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'
392
303
  });
304
+ continue;
305
+ }
306
+ var bnodes = [];
307
+ for (let i = 0; i < list.length; i++) {
308
+ bnodes.push(this.newBlankNode());
309
+ // this.newSubject(item.parent,bnodes[i])
393
310
  }
394
311
 
395
- continue;
396
- }
397
-
398
- var current = item.current;
399
- var context = item.context; // console.log("Tag: "+current.localName+", listMapping="+JSON.stringify(context.listMapping))
400
- // Sequence Step 1
401
-
402
- var skip = false;
403
- var newSubject = null;
404
- var currentObjectResource = null;
405
- var typedResource = null;
406
- var prefixes = context.prefixes;
407
- var prefixesCopied = false;
408
- var incomplete = [];
409
- var listMapping = context.listMapping;
410
- var listMappingDifferent = !context.parent;
411
- var language = context.language;
412
- var vocabulary = context.vocabulary; // TODO: the "base" element may be used for HTML+RDFa 1.1
413
-
414
- base = this.parseURI(removeHash(current.baseURI));
415
- current.item = null; // Sequence Step 2: set the default vocabulary
416
-
417
- var vocabAtt = current.getAttributeNode('vocab');
418
-
419
- if (vocabAtt) {
420
- var value = this.trim(vocabAtt.value);
421
-
422
- if (value.length > 0) {
423
- vocabulary = value;
424
- var baseSubject = base.spec; // this.newSubject(current,baseSubject)
425
-
426
- this.addTriple(current, baseSubject, 'http://www.w3.org/ns/rdfa#usesVocabulary', {
312
+ for (let i = 0; i < bnodes.length; i++) {
313
+ this.addTriple(item.parent, bnodes[i], 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first', list[i]);
314
+ this.addTriple(item.parent, bnodes[i], 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest', {
427
315
  type: RDFaProcessor.objectURI,
428
- value: vocabulary
316
+ value: i + 1 < bnodes.length ? bnodes[i + 1] : 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'
429
317
  });
430
- } else {
431
- vocabulary = this.vocabulary;
432
- }
433
- } // Sequence Step 3: IRI mappings
434
- // handle xmlns attributes
435
-
436
-
437
- for (var i = 0; i < current.attributes.length; i++) {
438
- var att = current.attributes[i]; // if (att.namespaceURI=="http://www.w3.org/2000/xmlns/") {
439
-
440
- if (att.nodeName.charAt(0) === 'x' && att.nodeName.indexOf('xmlns:') === 0) {
441
- if (!prefixesCopied) {
442
- prefixes = this.copyMappings(prefixes);
443
- prefixesCopied = true;
444
- }
445
-
446
- var prefix = att.nodeName.substring(6); // TODO: resolve relative?
447
-
448
- var ref = RDFaProcessor.trim(att.value);
449
- prefixes[prefix] = this.options.base ? Uri.join(ref, this.options.base) : ref;
450
318
  }
451
- } // Handle prefix mappings (@prefix)
452
-
453
-
454
- var prefixAtt = current.getAttributeNode('prefix');
455
-
456
- if (prefixAtt) {
319
+ this.addTriple(item.parent, item.subject, predicate, {
320
+ type: RDFaProcessor.objectURI,
321
+ value: bnodes[0]
322
+ });
323
+ }
324
+ continue;
325
+ }
326
+ var current = item.current;
327
+ var context = item.context;
328
+ // console.log("Tag: "+current.localName+", listMapping="+JSON.stringify(context.listMapping))
329
+ // Sequence Step 1
330
+ var skip = false;
331
+ var newSubject = null;
332
+ var currentObjectResource = null;
333
+ var typedResource = null;
334
+ var prefixes = context.prefixes;
335
+ var prefixesCopied = false;
336
+ var incomplete = [];
337
+ var listMapping = context.listMapping;
338
+ var listMappingDifferent = !context.parent;
339
+ var language = context.language;
340
+ var vocabulary = context.vocabulary;
341
+ // TODO: the "base" element may be used for HTML+RDFa 1.1
342
+ base = this.parseURI(removeHash(current.baseURI));
343
+ current.item = null;
344
+ // Sequence Step 2: set the default vocabulary
345
+ var vocabAtt = current.getAttributeNode('vocab');
346
+ if (vocabAtt) {
347
+ let value = this.trim(vocabAtt.value);
348
+ if (value.length > 0) {
349
+ vocabulary = value;
350
+ var baseSubject = base.spec;
351
+ // this.newSubject(current,baseSubject)
352
+ this.addTriple(current, baseSubject, 'http://www.w3.org/ns/rdfa#usesVocabulary', {
353
+ type: RDFaProcessor.objectURI,
354
+ value: vocabulary
355
+ });
356
+ } else {
357
+ vocabulary = this.vocabulary;
358
+ }
359
+ }
360
+ // Sequence Step 3: IRI mappings
361
+ // handle xmlns attributes
362
+ for (var i = 0; i < current.attributes.length; i++) {
363
+ var att = current.attributes[i];
364
+ // if (att.namespaceURI=="http://www.w3.org/2000/xmlns/") {
365
+ if (att.nodeName.charAt(0) === 'x' && att.nodeName.indexOf('xmlns:') === 0) {
457
366
  if (!prefixesCopied) {
458
367
  prefixes = this.copyMappings(prefixes);
459
368
  prefixesCopied = true;
460
369
  }
461
-
462
- this.parsePrefixMappings(prefixAtt.value, prefixes);
463
- } // Sequence Step 4: language
464
-
465
-
466
- var xmlLangAtt = null;
467
-
468
- for (var _i3 = 0; !xmlLangAtt && _i3 < this.langAttributes.length; _i3++) {
469
- xmlLangAtt = current.getAttributeNodeNS(this.langAttributes[_i3].namespaceURI, this.langAttributes[_i3].localName);
370
+ var prefix = att.nodeName.substring(6);
371
+ // TODO: resolve relative?
372
+ var ref = RDFaProcessor.trim(att.value);
373
+ prefixes[prefix] = this.options.base ? Uri.join(ref, this.options.base) : ref;
470
374
  }
471
-
472
- if (xmlLangAtt) {
473
- var _value = RDFaProcessor.trim(xmlLangAtt.value);
474
-
475
- if (_value.length > 0) {
476
- language = _value;
477
- } else {
478
- language = null;
479
- }
375
+ }
376
+ // Handle prefix mappings (@prefix)
377
+ var prefixAtt = current.getAttributeNode('prefix');
378
+ if (prefixAtt) {
379
+ if (!prefixesCopied) {
380
+ prefixes = this.copyMappings(prefixes);
381
+ prefixesCopied = true;
480
382
  }
481
-
482
- var relAtt = current.getAttributeNode('rel');
483
- var revAtt = current.getAttributeNode('rev');
484
- var typeofAtt = current.getAttributeNode('typeof');
485
- var propertyAtt = current.getAttributeNode('property');
486
- var datatypeAtt = current.getAttributeNode('datatype');
487
- var datetimeAtt = this.inHTMLMode ? current.getAttributeNode('datetime') : null;
488
- var contentAtt = current.getAttributeNode('content');
489
- var aboutAtt = current.getAttributeNode('about');
490
- var srcAtt = current.getAttributeNode('src');
491
- var resourceAtt = current.getAttributeNode('resource');
492
- var hrefAtt = current.getAttributeNode('href');
493
- var inlistAtt = current.getAttributeNode('inlist');
494
- var relAttPredicates = [];
495
- var predicate, values;
496
-
497
- if (relAtt) {
498
- values = this.tokenize(relAtt.value);
499
-
500
- for (var _i4 = 0; _i4 < values.length; _i4++) {
501
- predicate = this.parsePredicate(values[_i4], vocabulary, context.terms, prefixes, base, this.inHTMLMode && propertyAtt !== null);
502
-
503
- if (predicate) {
504
- relAttPredicates.push(predicate);
505
- }
506
- }
383
+ this.parsePrefixMappings(prefixAtt.value, prefixes);
384
+ }
385
+ // Sequence Step 4: language
386
+ var xmlLangAtt = null;
387
+ for (let i = 0; !xmlLangAtt && i < this.langAttributes.length; i++) {
388
+ xmlLangAtt = current.getAttributeNodeNS(this.langAttributes[i].namespaceURI, this.langAttributes[i].localName);
389
+ }
390
+ if (xmlLangAtt) {
391
+ let value = RDFaProcessor.trim(xmlLangAtt.value);
392
+ if (value.length > 0) {
393
+ language = value;
394
+ } else {
395
+ language = null;
507
396
  }
508
-
509
- var revAttPredicates = [];
510
-
511
- if (revAtt) {
512
- values = this.tokenize(revAtt.value);
513
-
514
- for (var _i5 = 0; _i5 < values.length; _i5++) {
515
- predicate = this.parsePredicate(values[_i5], vocabulary, context.terms, prefixes, base, this.inHTMLMode && propertyAtt);
516
-
517
- if (predicate) {
518
- revAttPredicates.push(predicate);
519
- }
397
+ }
398
+ var relAtt = current.getAttributeNode('rel');
399
+ var revAtt = current.getAttributeNode('rev');
400
+ var typeofAtt = current.getAttributeNode('typeof');
401
+ var propertyAtt = current.getAttributeNode('property');
402
+ var datatypeAtt = current.getAttributeNode('datatype');
403
+ var datetimeAtt = this.inHTMLMode ? current.getAttributeNode('datetime') : null;
404
+ var contentAtt = current.getAttributeNode('content');
405
+ var aboutAtt = current.getAttributeNode('about');
406
+ var srcAtt = current.getAttributeNode('src');
407
+ var resourceAtt = current.getAttributeNode('resource');
408
+ var hrefAtt = current.getAttributeNode('href');
409
+ var inlistAtt = current.getAttributeNode('inlist');
410
+ var relAttPredicates = [];
411
+ var predicate, values;
412
+ if (relAtt) {
413
+ values = this.tokenize(relAtt.value);
414
+ for (let i = 0; i < values.length; i++) {
415
+ predicate = this.parsePredicate(values[i], vocabulary, context.terms, prefixes, base, this.inHTMLMode && propertyAtt !== null);
416
+ if (predicate) {
417
+ relAttPredicates.push(predicate);
520
418
  }
521
- } // Section 3.1, bullet 7
522
-
523
-
524
- if (this.inHTMLMode && (relAtt || revAtt) && propertyAtt) {
525
- if (relAttPredicates.length === 0) {
526
- relAtt = null;
419
+ }
420
+ }
421
+ var revAttPredicates = [];
422
+ if (revAtt) {
423
+ values = this.tokenize(revAtt.value);
424
+ for (let i = 0; i < values.length; i++) {
425
+ predicate = this.parsePredicate(values[i], vocabulary, context.terms, prefixes, base, this.inHTMLMode && propertyAtt);
426
+ if (predicate) {
427
+ revAttPredicates.push(predicate);
527
428
  }
528
-
529
- if (revAttPredicates.length === 0) {
530
- revAtt = null;
429
+ }
430
+ }
431
+ // Section 3.1, bullet 7
432
+ if (this.inHTMLMode && (relAtt || revAtt) && propertyAtt) {
433
+ if (relAttPredicates.length === 0) {
434
+ relAtt = null;
435
+ }
436
+ if (revAttPredicates.length === 0) {
437
+ revAtt = null;
438
+ }
439
+ }
440
+ if (relAtt || revAtt) {
441
+ // Sequence Step 6: establish new subject and value
442
+ if (aboutAtt) {
443
+ newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value, prefixes, base);
444
+ }
445
+ if (typeofAtt) {
446
+ typedResource = newSubject;
447
+ }
448
+ if (!newSubject) {
449
+ if (current.parentNode.nodeType === Node.DOCUMENT_NODE) {
450
+ newSubject = removeHash(current.baseURI);
451
+ } else if (context.parentObject) {
452
+ // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI
453
+ newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
531
454
  }
532
455
  }
533
-
534
- if (relAtt || revAtt) {
535
- // Sequence Step 6: establish new subject and value
536
- if (aboutAtt) {
537
- newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value, prefixes, base);
456
+ if (resourceAtt) {
457
+ currentObjectResource = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);
458
+ }
459
+ if (!currentObjectResource) {
460
+ if (hrefAtt) {
461
+ currentObjectResource = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));
462
+ } else if (srcAtt) {
463
+ currentObjectResource = this.resolveAndNormalize(base, encodeURI(srcAtt.value));
464
+ } else if (typeofAtt && !aboutAtt && !(this.inXHTMLMode && (current.localName === 'head' || current.localName === 'body'))) {
465
+ currentObjectResource = this.newBlankNode();
538
466
  }
539
-
467
+ }
468
+ if (typeofAtt && !aboutAtt && this.inXHTMLMode && (current.localName === 'head' || current.localName === 'body')) {
469
+ typedResource = newSubject;
470
+ } else if (typeofAtt && !aboutAtt) {
471
+ typedResource = currentObjectResource;
472
+ }
473
+ } else if (propertyAtt && !contentAtt && !datatypeAtt) {
474
+ // Sequence Step 5.1: establish a new subject
475
+ if (aboutAtt) {
476
+ newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value, prefixes, base);
540
477
  if (typeofAtt) {
541
478
  typedResource = newSubject;
542
479
  }
543
-
544
- if (!newSubject) {
545
- if (current.parentNode.nodeType === Node.DOCUMENT_NODE) {
546
- newSubject = removeHash(current.baseURI);
547
- } else if (context.parentObject) {
548
- // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI
549
- newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
550
- }
480
+ }
481
+ if (!newSubject && current.parentNode.nodeType === Node.DOCUMENT_NODE) {
482
+ newSubject = removeHash(current.baseURI);
483
+ if (typeofAtt) {
484
+ typedResource = newSubject;
551
485
  }
552
-
486
+ } else if (!newSubject && context.parentObject) {
487
+ // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI
488
+ newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
489
+ }
490
+ if (typeofAtt && !typedResource) {
553
491
  if (resourceAtt) {
554
- currentObjectResource = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);
492
+ typedResource = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);
555
493
  }
556
-
557
- if (!currentObjectResource) {
558
- if (hrefAtt) {
559
- currentObjectResource = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));
560
- } else if (srcAtt) {
561
- currentObjectResource = this.resolveAndNormalize(base, encodeURI(srcAtt.value));
562
- } else if (typeofAtt && !aboutAtt && !(this.inXHTMLMode && (current.localName === 'head' || current.localName === 'body'))) {
563
- currentObjectResource = this.newBlankNode();
564
- }
494
+ if (!typedResource && hrefAtt) {
495
+ typedResource = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));
565
496
  }
566
-
567
- if (typeofAtt && !aboutAtt && this.inXHTMLMode && (current.localName === 'head' || current.localName === 'body')) {
497
+ if (!typedResource && srcAtt) {
498
+ typedResource = this.resolveAndNormalize(base, encodeURI(srcAtt.value));
499
+ }
500
+ if (!typedResource && (this.inXHTMLMode || this.inHTMLMode) && (current.localName === 'head' || current.localName === 'body')) {
568
501
  typedResource = newSubject;
569
- } else if (typeofAtt && !aboutAtt) {
570
- typedResource = currentObjectResource;
571
502
  }
572
- } else if (propertyAtt && !contentAtt && !datatypeAtt) {
573
- // Sequence Step 5.1: establish a new subject
574
- if (aboutAtt) {
575
- newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value, prefixes, base);
576
-
577
- if (typeofAtt) {
578
- typedResource = newSubject;
579
- }
503
+ if (!typedResource) {
504
+ typedResource = this.newBlankNode();
580
505
  }
581
-
582
- if (!newSubject && current.parentNode.nodeType === Node.DOCUMENT_NODE) {
506
+ currentObjectResource = typedResource;
507
+ }
508
+ // console.log(current.localName+", newSubject="+newSubject+", typedResource="+typedResource+", currentObjectResource="+currentObjectResource)
509
+ } else {
510
+ // Sequence Step 5.2: establish a new subject
511
+ if (aboutAtt) {
512
+ newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value, prefixes, base);
513
+ }
514
+ if (!newSubject && resourceAtt) {
515
+ newSubject = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);
516
+ }
517
+ if (!newSubject && hrefAtt) {
518
+ newSubject = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));
519
+ }
520
+ if (!newSubject && srcAtt) {
521
+ newSubject = this.resolveAndNormalize(base, encodeURI(srcAtt.value));
522
+ }
523
+ if (!newSubject) {
524
+ if (current.parentNode.nodeType === Node.DOCUMENT_NODE) {
583
525
  newSubject = removeHash(current.baseURI);
584
-
585
- if (typeofAtt) {
586
- typedResource = newSubject;
587
- }
588
- } else if (!newSubject && context.parentObject) {
526
+ } else if ((this.inXHTMLMode || this.inHTMLMode) && (current.localName === 'head' || current.localName === 'body')) {
527
+ newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
528
+ } else if (typeofAtt) {
529
+ newSubject = this.newBlankNode();
530
+ } else if (context.parentObject) {
589
531
  // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI
590
532
  newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
591
- }
592
-
593
- if (typeofAtt && !typedResource) {
594
- if (resourceAtt) {
595
- typedResource = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);
596
- }
597
-
598
- if (!typedResource && hrefAtt) {
599
- typedResource = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));
600
- }
601
-
602
- if (!typedResource && srcAtt) {
603
- typedResource = this.resolveAndNormalize(base, encodeURI(srcAtt.value));
604
- }
605
-
606
- if (!typedResource && (this.inXHTMLMode || this.inHTMLMode) && (current.localName === 'head' || current.localName === 'body')) {
607
- typedResource = newSubject;
608
- }
609
-
610
- if (!typedResource) {
611
- typedResource = this.newBlankNode();
533
+ if (!propertyAtt) {
534
+ skip = true;
612
535
  }
613
-
614
- currentObjectResource = typedResource;
615
- } // console.log(current.localName+", newSubject="+newSubject+", typedResource="+typedResource+", currentObjectResource="+currentObjectResource)
616
-
617
- } else {
618
- // Sequence Step 5.2: establish a new subject
619
- if (aboutAtt) {
620
- newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value, prefixes, base);
621
- }
622
-
623
- if (!newSubject && resourceAtt) {
624
- newSubject = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);
625
536
  }
626
-
627
- if (!newSubject && hrefAtt) {
628
- newSubject = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));
537
+ }
538
+ if (typeofAtt) {
539
+ typedResource = newSubject;
540
+ }
541
+ }
542
+ // console.log(current.tagName+": newSubject="+newSubject+", currentObjectResource="+currentObjectResource+", typedResource="+typedResource+", skip="+skip)
543
+ // var rdfaData = null
544
+ if (newSubject) {
545
+ // this.newSubject(current,newSubject)
546
+ if (aboutAtt || resourceAtt || typedResource) {
547
+ var id = newSubject;
548
+ if (typeofAtt && !aboutAtt && !resourceAtt && currentObjectResource) {
549
+ id = currentObjectResource;
550
+ }
551
+ // console.log("Setting data attribute for "+current.localName+" for subject "+id)
552
+ this.newSubjectOrigin(current, id);
553
+ }
554
+ }
555
+ // Sequence Step 7: generate type triple
556
+ if (typedResource) {
557
+ values = this.tokenize(typeofAtt.value);
558
+ for (let i = 0; i < values.length; i++) {
559
+ var object = this.parseTermOrCURIEOrAbsURI(values[i], vocabulary, context.terms, prefixes, base);
560
+ if (object) {
561
+ this.addTriple(current, typedResource, RDFaProcessor.typeURI, {
562
+ type: RDFaProcessor.objectURI,
563
+ value: object
564
+ });
629
565
  }
630
-
631
- if (!newSubject && srcAtt) {
632
- newSubject = this.resolveAndNormalize(base, encodeURI(srcAtt.value));
566
+ }
567
+ }
568
+ // Sequence Step 8: new list mappings if there is a new subject
569
+ // console.log("Step 8: newSubject="+newSubject+", context.parentObject="+context.parentObject)
570
+ if (newSubject && newSubject !== context.parentObject) {
571
+ // console.log("Generating new list mapping for "+newSubject)
572
+ listMapping = {};
573
+ listMappingDifferent = true;
574
+ }
575
+ // Sequence Step 9: generate object triple
576
+ if (currentObjectResource) {
577
+ if (relAtt && inlistAtt) {
578
+ for (let i = 0; i < relAttPredicates.length; i++) {
579
+ let list = listMapping[relAttPredicates[i]];
580
+ if (!list) {
581
+ list = [];
582
+ listMapping[relAttPredicates[i]] = list;
583
+ }
584
+ list.push({
585
+ type: RDFaProcessor.objectURI,
586
+ value: currentObjectResource
587
+ });
633
588
  }
634
-
635
- if (!newSubject) {
636
- if (current.parentNode.nodeType === Node.DOCUMENT_NODE) {
637
- newSubject = removeHash(current.baseURI);
638
- } else if ((this.inXHTMLMode || this.inHTMLMode) && (current.localName === 'head' || current.localName === 'body')) {
639
- newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
640
- } else if (typeofAtt) {
641
- newSubject = this.newBlankNode();
642
- } else if (context.parentObject) {
643
- // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI
644
- newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
645
-
646
- if (!propertyAtt) {
647
- skip = true;
648
- }
649
- }
589
+ } else if (relAtt) {
590
+ for (let i = 0; i < relAttPredicates.length; i++) {
591
+ this.addTriple(current, newSubject, relAttPredicates[i], {
592
+ type: RDFaProcessor.objectURI,
593
+ value: currentObjectResource
594
+ });
650
595
  }
651
-
652
- if (typeofAtt) {
653
- typedResource = newSubject;
596
+ }
597
+ if (revAtt) {
598
+ for (let i = 0; i < revAttPredicates.length; i++) {
599
+ this.addTriple(current, currentObjectResource, revAttPredicates[i], {
600
+ type: RDFaProcessor.objectURI,
601
+ value: newSubject
602
+ });
654
603
  }
655
- } // console.log(current.tagName+": newSubject="+newSubject+", currentObjectResource="+currentObjectResource+", typedResource="+typedResource+", skip="+skip)
656
- // var rdfaData = null
657
-
658
-
659
- if (newSubject) {
660
- // this.newSubject(current,newSubject)
661
- if (aboutAtt || resourceAtt || typedResource) {
662
- var id = newSubject;
663
-
664
- if (typeofAtt && !aboutAtt && !resourceAtt && currentObjectResource) {
665
- id = currentObjectResource;
666
- } // console.log("Setting data attribute for "+current.localName+" for subject "+id)
667
-
604
+ }
605
+ } else {
606
+ // Sequence Step 10: incomplete triples
607
+ if (newSubject && !currentObjectResource && (relAtt || revAtt)) {
608
+ currentObjectResource = this.newBlankNode();
609
+ // alert(current.tagName+": generated blank node, newSubject="+newSubject+" currentObjectResource="+currentObjectResource)
610
+ }
668
611
 
669
- this.newSubjectOrigin(current, id);
612
+ if (relAtt && inlistAtt) {
613
+ for (let i = 0; i < relAttPredicates.length; i++) {
614
+ let list = listMapping[relAttPredicates[i]];
615
+ if (!list) {
616
+ list = [];
617
+ listMapping[predicate] = list;
618
+ }
619
+ // console.log("Adding incomplete list for "+predicate)
620
+ incomplete.push({
621
+ predicate: relAttPredicates[i],
622
+ list: list
623
+ });
670
624
  }
671
- } // Sequence Step 7: generate type triple
672
-
673
-
674
- if (typedResource) {
675
- values = this.tokenize(typeofAtt.value);
676
-
677
- for (var _i6 = 0; _i6 < values.length; _i6++) {
678
- var object = this.parseTermOrCURIEOrAbsURI(values[_i6], vocabulary, context.terms, prefixes, base);
679
-
680
- if (object) {
681
- this.addTriple(current, typedResource, RDFaProcessor.typeURI, {
682
- type: RDFaProcessor.objectURI,
683
- value: object
684
- });
685
- }
625
+ } else if (relAtt) {
626
+ for (let i = 0; i < relAttPredicates.length; i++) {
627
+ incomplete.push({
628
+ predicate: relAttPredicates[i],
629
+ forward: true
630
+ });
686
631
  }
687
- } // Sequence Step 8: new list mappings if there is a new subject
688
- // console.log("Step 8: newSubject="+newSubject+", context.parentObject="+context.parentObject)
689
-
690
-
691
- if (newSubject && newSubject !== context.parentObject) {
692
- // console.log("Generating new list mapping for "+newSubject)
693
- listMapping = {};
694
- listMappingDifferent = true;
695
- } // Sequence Step 9: generate object triple
696
-
697
-
698
- if (currentObjectResource) {
699
- if (relAtt && inlistAtt) {
700
- for (var _i7 = 0; _i7 < relAttPredicates.length; _i7++) {
701
- var _list = listMapping[relAttPredicates[_i7]];
702
-
703
- if (!_list) {
704
- _list = [];
705
- listMapping[relAttPredicates[_i7]] = _list;
706
- }
707
-
708
- _list.push({
709
- type: RDFaProcessor.objectURI,
710
- value: currentObjectResource
711
- });
712
- }
713
- } else if (relAtt) {
714
- for (var _i8 = 0; _i8 < relAttPredicates.length; _i8++) {
715
- this.addTriple(current, newSubject, relAttPredicates[_i8], {
716
- type: RDFaProcessor.objectURI,
717
- value: currentObjectResource
718
- });
719
- }
632
+ }
633
+ if (revAtt) {
634
+ for (let i = 0; i < revAttPredicates.length; i++) {
635
+ incomplete.push({
636
+ predicate: revAttPredicates[i],
637
+ forward: false
638
+ });
720
639
  }
721
-
722
- if (revAtt) {
723
- for (var _i9 = 0; _i9 < revAttPredicates.length; _i9++) {
724
- this.addTriple(current, currentObjectResource, revAttPredicates[_i9], {
725
- type: RDFaProcessor.objectURI,
726
- value: newSubject
727
- });
728
- }
640
+ }
641
+ }
642
+ // Step 11: Current property values
643
+ if (propertyAtt) {
644
+ var datatype = null;
645
+ var content = null;
646
+ if (datatypeAtt) {
647
+ datatype = datatypeAtt.value === '' ? RDFaProcessor.PlainLiteralURI : this.parseTermOrCURIEOrAbsURI(datatypeAtt.value, vocabulary, context.terms, prefixes, base);
648
+ if (datetimeAtt && !contentAtt) {
649
+ content = datetimeAtt.value;
650
+ } else {
651
+ content = datatype === RDFaProcessor.XMLLiteralURI || datatype === RDFaProcessor.HTMLLiteralURI ? null : contentAtt ? contentAtt.value : current.textContent;
652
+ }
653
+ } else if (contentAtt) {
654
+ datatype = RDFaProcessor.PlainLiteralURI;
655
+ content = contentAtt.value;
656
+ } else if (datetimeAtt) {
657
+ content = datetimeAtt.value;
658
+ datatype = RDFaProcessor.deriveDateTimeType(content);
659
+ if (!datatype) {
660
+ datatype = RDFaProcessor.PlainLiteralURI;
729
661
  }
730
- } else {
731
- // Sequence Step 10: incomplete triples
732
- if (newSubject && !currentObjectResource && (relAtt || revAtt)) {
733
- currentObjectResource = this.newBlankNode(); // alert(current.tagName+": generated blank node, newSubject="+newSubject+" currentObjectResource="+currentObjectResource)
662
+ } else if (!relAtt && !revAtt) {
663
+ if (resourceAtt) {
664
+ content = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);
734
665
  }
735
-
736
- if (relAtt && inlistAtt) {
737
- for (var _i10 = 0; _i10 < relAttPredicates.length; _i10++) {
738
- var _list2 = listMapping[relAttPredicates[_i10]];
739
-
740
- if (!_list2) {
741
- _list2 = [];
742
- listMapping[predicate] = _list2;
743
- } // console.log("Adding incomplete list for "+predicate)
744
-
745
-
746
- incomplete.push({
747
- predicate: relAttPredicates[_i10],
748
- list: _list2
749
- });
750
- }
751
- } else if (relAtt) {
752
- for (var _i11 = 0; _i11 < relAttPredicates.length; _i11++) {
753
- incomplete.push({
754
- predicate: relAttPredicates[_i11],
755
- forward: true
756
- });
757
- }
666
+ if (!content && hrefAtt) {
667
+ content = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));
668
+ } else if (!content && srcAtt) {
669
+ content = this.resolveAndNormalize(base, encodeURI(srcAtt.value));
758
670
  }
759
-
760
- if (revAtt) {
761
- for (var _i12 = 0; _i12 < revAttPredicates.length; _i12++) {
762
- incomplete.push({
763
- predicate: revAttPredicates[_i12],
764
- forward: false
765
- });
766
- }
671
+ if (content) {
672
+ datatype = RDFaProcessor.objectURI;
767
673
  }
768
- } // Step 11: Current property values
769
-
770
-
771
- if (propertyAtt) {
772
- var datatype = null;
773
- var content = null;
774
-
775
- if (datatypeAtt) {
776
- datatype = datatypeAtt.value === '' ? RDFaProcessor.PlainLiteralURI : this.parseTermOrCURIEOrAbsURI(datatypeAtt.value, vocabulary, context.terms, prefixes, base);
777
-
778
- if (datetimeAtt && !contentAtt) {
779
- content = datetimeAtt.value;
780
- } else {
781
- content = datatype === RDFaProcessor.XMLLiteralURI || datatype === RDFaProcessor.HTMLLiteralURI ? null : contentAtt ? contentAtt.value : current.textContent;
674
+ }
675
+ if (!datatype) {
676
+ if (typeofAtt && !aboutAtt) {
677
+ datatype = RDFaProcessor.objectURI;
678
+ content = typedResource;
679
+ } else {
680
+ content = current.textContent;
681
+ if (this.inHTMLMode && current.localName === 'time') {
682
+ datatype = RDFaProcessor.deriveDateTimeType(content);
782
683
  }
783
- } else if (contentAtt) {
784
- datatype = RDFaProcessor.PlainLiteralURI;
785
- content = contentAtt.value;
786
- } else if (datetimeAtt) {
787
- content = datetimeAtt.value;
788
- datatype = RDFaProcessor.deriveDateTimeType(content);
789
-
790
684
  if (!datatype) {
791
685
  datatype = RDFaProcessor.PlainLiteralURI;
792
686
  }
793
- } else if (!relAtt && !revAtt) {
794
- if (resourceAtt) {
795
- content = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);
796
- }
797
-
798
- if (!content && hrefAtt) {
799
- content = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));
800
- } else if (!content && srcAtt) {
801
- content = this.resolveAndNormalize(base, encodeURI(srcAtt.value));
802
- }
803
-
804
- if (content) {
805
- datatype = RDFaProcessor.objectURI;
806
- }
807
687
  }
808
-
809
- if (!datatype) {
810
- if (typeofAtt && !aboutAtt) {
811
- datatype = RDFaProcessor.objectURI;
812
- content = typedResource;
813
- } else {
814
- content = current.textContent;
815
-
816
- if (this.inHTMLMode && current.localName === 'time') {
817
- datatype = RDFaProcessor.deriveDateTimeType(content);
818
- }
819
-
820
- if (!datatype) {
821
- datatype = RDFaProcessor.PlainLiteralURI;
688
+ }
689
+ values = this.tokenize(propertyAtt.value);
690
+ for (let i = 0; i < values.length; i++) {
691
+ let predicate = this.parsePredicate(values[i], vocabulary, context.terms, prefixes, base);
692
+ if (predicate) {
693
+ if (inlistAtt) {
694
+ let list = listMapping[predicate];
695
+ if (!list) {
696
+ list = [];
697
+ listMapping[predicate] = list;
822
698
  }
823
- }
824
- }
825
-
826
- values = this.tokenize(propertyAtt.value);
827
-
828
- for (var _i13 = 0; _i13 < values.length; _i13++) {
829
- var _predicate2 = this.parsePredicate(values[_i13], vocabulary, context.terms, prefixes, base);
830
-
831
- if (_predicate2) {
832
- if (inlistAtt) {
833
- var _list3 = listMapping[_predicate2];
834
-
835
- if (!_list3) {
836
- _list3 = [];
837
- listMapping[_predicate2] = _list3;
838
- }
839
-
840
- _list3.push(datatype === RDFaProcessor.XMLLiteralURI || datatype === RDFaProcessor.HTMLLiteralURI ? {
699
+ list.push(datatype === RDFaProcessor.XMLLiteralURI || datatype === RDFaProcessor.HTMLLiteralURI ? {
700
+ type: datatype,
701
+ value: current.childNodes
702
+ } : {
703
+ type: datatype || RDFaProcessor.PlainLiteralURI,
704
+ value: content,
705
+ language: language
706
+ });
707
+ } else {
708
+ if (datatype === RDFaProcessor.XMLLiteralURI || datatype === RDFaProcessor.HTMLLiteralURI) {
709
+ this.addTriple(current, newSubject, predicate, {
841
710
  type: datatype,
842
711
  value: current.childNodes
843
- } : {
712
+ });
713
+ } else {
714
+ this.addTriple(current, newSubject, predicate, {
844
715
  type: datatype || RDFaProcessor.PlainLiteralURI,
845
716
  value: content,
846
717
  language: language
847
718
  });
848
- } else {
849
- if (datatype === RDFaProcessor.XMLLiteralURI || datatype === RDFaProcessor.HTMLLiteralURI) {
850
- this.addTriple(current, newSubject, _predicate2, {
851
- type: datatype,
852
- value: current.childNodes
853
- });
854
- } else {
855
- this.addTriple(current, newSubject, _predicate2, {
856
- type: datatype || RDFaProcessor.PlainLiteralURI,
857
- value: content,
858
- language: language
859
- }); // console.log(newSubject+" "+predicate+"="+content)
860
- }
719
+ // console.log(newSubject+" "+predicate+"="+content)
861
720
  }
862
721
  }
863
722
  }
864
- } // Sequence Step 12: complete incomplete triples with new subject
865
-
866
-
867
- if (newSubject && !skip) {
868
- for (var _i14 = 0; _i14 < context.incomplete.length; _i14++) {
869
- if (context.incomplete[_i14].list) {
870
- // console.log("Adding subject "+newSubject+" to list for "+context.incomplete[i].predicate)
871
- // TODO: it is unclear what to do here
872
- context.incomplete[_i14].list.push({
873
- type: RDFaProcessor.objectURI,
874
- value: newSubject
875
- });
876
- } else if (context.incomplete[_i14].forward) {
877
- // console.log(current.tagName+": completing forward triple "+context.incomplete[i].predicate+" with object="+newSubject)
878
- this.addTriple(current, context.subject, context.incomplete[_i14].predicate, {
879
- type: RDFaProcessor.objectURI,
880
- value: newSubject
881
- });
882
- } else {
883
- // console.log(current.tagName+": completing reverse triple with object="+context.subject)
884
- this.addTriple(current, newSubject, context.incomplete[_i14].predicate, {
885
- type: RDFaProcessor.objectURI,
886
- value: context.subject
887
- });
888
- }
889
- }
890
723
  }
891
-
892
- var childContext = null;
893
- var listSubject = newSubject;
894
-
895
- if (skip) {
896
- // TODO: should subject be null?
897
- childContext = this.push(context, context.subject); // TODO: should the entObject be passed along? If not, then intermediary children will keep properties from being associated with incomplete triples.
898
- // TODO: Verify: if the current baseURI has changed and the parentObject is the parent's base URI, then the baseURI should change
899
-
900
- childContext.parentObject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
901
- childContext.incomplete = context.incomplete;
902
- childContext.language = language;
903
- childContext.prefixes = prefixes;
904
- childContext.vocabulary = vocabulary;
905
- } else {
906
- childContext = this.push(context, newSubject);
907
- childContext.parentObject = currentObjectResource || newSubject || context.subject;
908
- childContext.prefixes = prefixes;
909
- childContext.incomplete = incomplete;
910
-
911
- if (currentObjectResource) {
912
- // console.log("Generating new list mapping for "+currentObjectResource)
913
- listSubject = currentObjectResource;
914
- listMapping = {};
915
- listMappingDifferent = true;
916
- }
917
-
918
- childContext.listMapping = listMapping;
919
- childContext.language = language;
920
- childContext.vocabulary = vocabulary;
921
- }
922
-
923
- if (listMappingDifferent) {
924
- // console.log("Pushing list parent "+current.localName)
925
- queue.unshift({
926
- parent: current,
927
- context: context,
928
- subject: listSubject,
929
- listMapping: listMapping
930
- });
931
- }
932
-
933
- for (var child = current.lastChild; child; child = child.previousSibling) {
934
- if (child.nodeType === Node.ELEMENT_NODE) {
935
- // console.log("Pushing child "+child.localName)
936
- // child.baseURI = current.baseURI
937
- queue.unshift({
938
- current: child,
939
- context: childContext
724
+ }
725
+ // Sequence Step 12: complete incomplete triples with new subject
726
+ if (newSubject && !skip) {
727
+ for (let i = 0; i < context.incomplete.length; i++) {
728
+ if (context.incomplete[i].list) {
729
+ // console.log("Adding subject "+newSubject+" to list for "+context.incomplete[i].predicate)
730
+ // TODO: it is unclear what to do here
731
+ context.incomplete[i].list.push({
732
+ type: RDFaProcessor.objectURI,
733
+ value: newSubject
734
+ });
735
+ } else if (context.incomplete[i].forward) {
736
+ // console.log(current.tagName+": completing forward triple "+context.incomplete[i].predicate+" with object="+newSubject)
737
+ this.addTriple(current, context.subject, context.incomplete[i].predicate, {
738
+ type: RDFaProcessor.objectURI,
739
+ value: newSubject
740
+ });
741
+ } else {
742
+ // console.log(current.tagName+": completing reverse triple with object="+context.subject)
743
+ this.addTriple(current, newSubject, context.incomplete[i].predicate, {
744
+ type: RDFaProcessor.objectURI,
745
+ value: context.subject
940
746
  });
941
747
  }
942
748
  }
943
749
  }
944
-
945
- if (this.inHTMLMode) {
946
- this.copyProperties();
750
+ var childContext = null;
751
+ var listSubject = newSubject;
752
+ if (skip) {
753
+ // TODO: should subject be null?
754
+ childContext = this.push(context, context.subject);
755
+ // TODO: should the entObject be passed along? If not, then intermediary children will keep properties from being associated with incomplete triples.
756
+ // TODO: Verify: if the current baseURI has changed and the parentObject is the parent's base URI, then the baseURI should change
757
+ childContext.parentObject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
758
+ childContext.incomplete = context.incomplete;
759
+ childContext.language = language;
760
+ childContext.prefixes = prefixes;
761
+ childContext.vocabulary = vocabulary;
762
+ } else {
763
+ childContext = this.push(context, newSubject);
764
+ childContext.parentObject = currentObjectResource || newSubject || context.subject;
765
+ childContext.prefixes = prefixes;
766
+ childContext.incomplete = incomplete;
767
+ if (currentObjectResource) {
768
+ // console.log("Generating new list mapping for "+currentObjectResource)
769
+ listSubject = currentObjectResource;
770
+ listMapping = {};
771
+ listMappingDifferent = true;
772
+ }
773
+ childContext.listMapping = listMapping;
774
+ childContext.language = language;
775
+ childContext.vocabulary = vocabulary;
947
776
  }
948
-
949
- for (var _i15 = 0; _i15 < this.finishedHandlers.length; _i15++) {
950
- this.finishedHandlers[_i15](node);
777
+ if (listMappingDifferent) {
778
+ // console.log("Pushing list parent "+current.localName)
779
+ queue.unshift({
780
+ parent: current,
781
+ context: context,
782
+ subject: listSubject,
783
+ listMapping: listMapping
784
+ });
785
+ }
786
+ for (var child = current.lastChild; child; child = child.previousSibling) {
787
+ if (child.nodeType === Node.ELEMENT_NODE) {
788
+ // console.log("Pushing child "+child.localName)
789
+ // child.baseURI = current.baseURI
790
+ queue.unshift({
791
+ current: child,
792
+ context: childContext
793
+ });
794
+ }
951
795
  }
952
796
  }
953
- }, {
954
- key: "push",
955
- value: function push(parent, subject) {
956
- return {
957
- parent: parent,
958
- subject: subject || (parent ? parent.subject : null),
959
- parentObject: null,
960
- incomplete: [],
961
- listMapping: parent ? parent.listMapping : {},
962
- language: parent ? parent.language : this.language,
963
- prefixes: parent ? parent.prefixes : this.target.graph.prefixes,
964
- terms: parent ? parent.terms : this.target.graph.terms,
965
- vocabulary: parent ? parent.vocabulary : this.vocabulary
966
- };
797
+ if (this.inHTMLMode) {
798
+ this.copyProperties();
967
799
  }
968
- }, {
969
- key: "resolveAndNormalize",
970
- value: function resolveAndNormalize(base, uri) {
971
- // console.log("Joining " + uri + " to " + base + " making " + Uri.join(uri, base))
972
- return Uri.join(uri, base); // @@ normalize?
800
+ for (let i = 0; i < this.finishedHandlers.length; i++) {
801
+ this.finishedHandlers[i](node);
973
802
  }
974
- }, {
975
- key: "setContext",
976
- value: function setContext(node) {
977
- // We only recognized XHTML+RDFa 1.1 if the version is set propertyly
978
- if (node.localName === 'html' && node.getAttribute('version') === 'XHTML+RDFa 1.1') {
979
- this.setXHTMLContext();
980
- } else if (node.localName === 'html' || node.namespaceURI === 'http://www.w3.org/1999/xhtml') {
981
- if (typeof document !== 'undefined' && document.doctype) {
982
- if (document.doctype.publicId === '-//W3C//DTD XHTML+RDFa 1.0//EN' && document.doctype.systemId === 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd') {
983
- console.log('WARNING: RDF 1.0 is not supported. Defaulting to HTML5 mode.');
984
- this.setHTMLContext();
985
- } else if (document.doctype.publicId === '-//W3C//DTD XHTML+RDFa 1.1//EN' && document.doctype.systemId === 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd') {
986
- this.setXHTMLContext();
987
- } else {
988
- this.setHTMLContext();
989
- }
803
+ }
804
+ push(parent, subject) {
805
+ return {
806
+ parent: parent,
807
+ subject: subject || (parent ? parent.subject : null),
808
+ parentObject: null,
809
+ incomplete: [],
810
+ listMapping: parent ? parent.listMapping : {},
811
+ language: parent ? parent.language : this.language,
812
+ prefixes: parent ? parent.prefixes : this.target.graph.prefixes,
813
+ terms: parent ? parent.terms : this.target.graph.terms,
814
+ vocabulary: parent ? parent.vocabulary : this.vocabulary
815
+ };
816
+ }
817
+ resolveAndNormalize(base, uri) {
818
+ // console.log("Joining " + uri + " to " + base + " making " + Uri.join(uri, base))
819
+ return Uri.join(uri, base); // @@ normalize?
820
+ }
821
+
822
+ setContext(node) {
823
+ // We only recognized XHTML+RDFa 1.1 if the version is set propertyly
824
+ if (node.localName === 'html' && node.getAttribute('version') === 'XHTML+RDFa 1.1') {
825
+ this.setXHTMLContext();
826
+ } else if (node.localName === 'html' || node.namespaceURI === 'http://www.w3.org/1999/xhtml') {
827
+ if (typeof document !== 'undefined' && document.doctype) {
828
+ if (document.doctype.publicId === '-//W3C//DTD XHTML+RDFa 1.0//EN' && document.doctype.systemId === 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd') {
829
+ console.log('WARNING: RDF 1.0 is not supported. Defaulting to HTML5 mode.');
830
+ this.setHTMLContext();
831
+ } else if (document.doctype.publicId === '-//W3C//DTD XHTML+RDFa 1.1//EN' && document.doctype.systemId === 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd') {
832
+ this.setXHTMLContext();
990
833
  } else {
991
834
  this.setHTMLContext();
992
835
  }
993
836
  } else {
994
- this.setXMLContext();
837
+ this.setHTMLContext();
995
838
  }
839
+ } else {
840
+ this.setXMLContext();
996
841
  }
997
- }, {
998
- key: "setHTMLContext",
999
- value: function setHTMLContext() {
1000
- this.setInitialContext();
1001
- this.langAttributes = [{
1002
- namespaceURI: 'http://www.w3.org/XML/1998/namespace',
1003
- localName: 'lang'
1004
- }, {
1005
- namespaceURI: null,
1006
- localName: 'lang'
1007
- }];
1008
- this.inXHTMLMode = false;
1009
- this.inHTMLMode = true;
1010
- }
1011
- }, {
1012
- key: "setInitialContext",
1013
- value: function setInitialContext() {
1014
- this.vocabulary = null; // By default, the prefixes are terms are loaded to the RDFa 1.1. standard within the graph constructor
1015
-
1016
- this.langAttributes = [{
1017
- namespaceURI: 'http://www.w3.org/XML/1998/namespace',
1018
- localName: 'lang'
1019
- }];
1020
- }
1021
- }, {
1022
- key: "setXHTMLContext",
1023
- value: function setXHTMLContext() {
1024
- this.setInitialContext();
1025
- this.inXHTMLMode = true;
1026
- this.inHTMLMode = false;
1027
- this.langAttributes = [{
1028
- namespaceURI: 'http://www.w3.org/XML/1998/namespace',
1029
- localName: 'lang'
1030
- }, {
1031
- namespaceURI: null,
1032
- localName: 'lang'
1033
- }]; // From http://www.w3.org/2011/rdfa-context/xhtml-rdfa-1.1
1034
-
1035
- this.target.graph.terms['alternate'] = 'http://www.w3.org/1999/xhtml/vocab#alternate';
1036
- this.target.graph.terms['appendix'] = 'http://www.w3.org/1999/xhtml/vocab#appendix';
1037
- this.target.graph.terms['bookmark'] = 'http://www.w3.org/1999/xhtml/vocab#bookmark';
1038
- this.target.graph.terms['cite'] = 'http://www.w3.org/1999/xhtml/vocab#cite';
1039
- this.target.graph.terms['chapter'] = 'http://www.w3.org/1999/xhtml/vocab#chapter';
1040
- this.target.graph.terms['contents'] = 'http://www.w3.org/1999/xhtml/vocab#contents';
1041
- this.target.graph.terms['copyright'] = 'http://www.w3.org/1999/xhtml/vocab#copyright';
1042
- this.target.graph.terms['first'] = 'http://www.w3.org/1999/xhtml/vocab#first';
1043
- this.target.graph.terms['glossary'] = 'http://www.w3.org/1999/xhtml/vocab#glossary';
1044
- this.target.graph.terms['help'] = 'http://www.w3.org/1999/xhtml/vocab#help';
1045
- this.target.graph.terms['icon'] = 'http://www.w3.org/1999/xhtml/vocab#icon';
1046
- this.target.graph.terms['index'] = 'http://www.w3.org/1999/xhtml/vocab#index';
1047
- this.target.graph.terms['last'] = 'http://www.w3.org/1999/xhtml/vocab#last';
1048
- this.target.graph.terms['license'] = 'http://www.w3.org/1999/xhtml/vocab#license';
1049
- this.target.graph.terms['meta'] = 'http://www.w3.org/1999/xhtml/vocab#meta';
1050
- this.target.graph.terms['next'] = 'http://www.w3.org/1999/xhtml/vocab#next';
1051
- this.target.graph.terms['prev'] = 'http://www.w3.org/1999/xhtml/vocab#prev';
1052
- this.target.graph.terms['previous'] = 'http://www.w3.org/1999/xhtml/vocab#previous';
1053
- this.target.graph.terms['section'] = 'http://www.w3.org/1999/xhtml/vocab#section';
1054
- this.target.graph.terms['stylesheet'] = 'http://www.w3.org/1999/xhtml/vocab#stylesheet';
1055
- this.target.graph.terms['subsection'] = 'http://www.w3.org/1999/xhtml/vocab#subsection';
1056
- this.target.graph.terms['start'] = 'http://www.w3.org/1999/xhtml/vocab#start';
1057
- this.target.graph.terms['top'] = 'http://www.w3.org/1999/xhtml/vocab#top';
1058
- this.target.graph.terms['up'] = 'http://www.w3.org/1999/xhtml/vocab#up';
1059
- this.target.graph.terms['p3pv1'] = 'http://www.w3.org/1999/xhtml/vocab#p3pv1'; // other
1060
-
1061
- this.target.graph.terms['related'] = 'http://www.w3.org/1999/xhtml/vocab#related';
1062
- this.target.graph.terms['role'] = 'http://www.w3.org/1999/xhtml/vocab#role';
1063
- this.target.graph.terms['transformation'] = 'http://www.w3.org/1999/xhtml/vocab#transformation';
1064
- }
1065
- }, {
1066
- key: "setXMLContext",
1067
- value: function setXMLContext() {
1068
- this.setInitialContext();
1069
- this.inXHTMLMode = false;
1070
- this.inHTMLMode = false;
1071
- }
1072
- }, {
1073
- key: "tokenize",
1074
- value: function tokenize(str) {
1075
- return this.trim(str).split(/\s+/);
1076
- }
1077
- }, {
1078
- key: "toRDFNodeObject",
1079
- value: function toRDFNodeObject(x) {
1080
- var _this = this;
1081
-
1082
- if (typeof x === 'undefined') return undefined;
1083
-
1084
- if (typeof x === 'string') {
1085
- if (x.substring(0, 2) === '_:') {
1086
- if (typeof this.blankNodes[x.substring(2)] === 'undefined') {
1087
- this.blankNodes[x.substring(2)] = new BlankNode(x.substring(2));
1088
- }
1089
-
1090
- return this.blankNodes[x.substring(2)];
842
+ }
843
+ setHTMLContext() {
844
+ this.setInitialContext();
845
+ this.langAttributes = [{
846
+ namespaceURI: 'http://www.w3.org/XML/1998/namespace',
847
+ localName: 'lang'
848
+ }, {
849
+ namespaceURI: null,
850
+ localName: 'lang'
851
+ }];
852
+ this.inXHTMLMode = false;
853
+ this.inHTMLMode = true;
854
+ }
855
+ setInitialContext() {
856
+ this.vocabulary = null;
857
+ // By default, the prefixes are terms are loaded to the RDFa 1.1. standard within the graph constructor
858
+ this.langAttributes = [{
859
+ namespaceURI: 'http://www.w3.org/XML/1998/namespace',
860
+ localName: 'lang'
861
+ }];
862
+ }
863
+ setXHTMLContext() {
864
+ this.setInitialContext();
865
+ this.inXHTMLMode = true;
866
+ this.inHTMLMode = false;
867
+ this.langAttributes = [{
868
+ namespaceURI: 'http://www.w3.org/XML/1998/namespace',
869
+ localName: 'lang'
870
+ }, {
871
+ namespaceURI: null,
872
+ localName: 'lang'
873
+ }];
874
+ // From http://www.w3.org/2011/rdfa-context/xhtml-rdfa-1.1
875
+ this.target.graph.terms['alternate'] = 'http://www.w3.org/1999/xhtml/vocab#alternate';
876
+ this.target.graph.terms['appendix'] = 'http://www.w3.org/1999/xhtml/vocab#appendix';
877
+ this.target.graph.terms['bookmark'] = 'http://www.w3.org/1999/xhtml/vocab#bookmark';
878
+ this.target.graph.terms['cite'] = 'http://www.w3.org/1999/xhtml/vocab#cite';
879
+ this.target.graph.terms['chapter'] = 'http://www.w3.org/1999/xhtml/vocab#chapter';
880
+ this.target.graph.terms['contents'] = 'http://www.w3.org/1999/xhtml/vocab#contents';
881
+ this.target.graph.terms['copyright'] = 'http://www.w3.org/1999/xhtml/vocab#copyright';
882
+ this.target.graph.terms['first'] = 'http://www.w3.org/1999/xhtml/vocab#first';
883
+ this.target.graph.terms['glossary'] = 'http://www.w3.org/1999/xhtml/vocab#glossary';
884
+ this.target.graph.terms['help'] = 'http://www.w3.org/1999/xhtml/vocab#help';
885
+ this.target.graph.terms['icon'] = 'http://www.w3.org/1999/xhtml/vocab#icon';
886
+ this.target.graph.terms['index'] = 'http://www.w3.org/1999/xhtml/vocab#index';
887
+ this.target.graph.terms['last'] = 'http://www.w3.org/1999/xhtml/vocab#last';
888
+ this.target.graph.terms['license'] = 'http://www.w3.org/1999/xhtml/vocab#license';
889
+ this.target.graph.terms['meta'] = 'http://www.w3.org/1999/xhtml/vocab#meta';
890
+ this.target.graph.terms['next'] = 'http://www.w3.org/1999/xhtml/vocab#next';
891
+ this.target.graph.terms['prev'] = 'http://www.w3.org/1999/xhtml/vocab#prev';
892
+ this.target.graph.terms['previous'] = 'http://www.w3.org/1999/xhtml/vocab#previous';
893
+ this.target.graph.terms['section'] = 'http://www.w3.org/1999/xhtml/vocab#section';
894
+ this.target.graph.terms['stylesheet'] = 'http://www.w3.org/1999/xhtml/vocab#stylesheet';
895
+ this.target.graph.terms['subsection'] = 'http://www.w3.org/1999/xhtml/vocab#subsection';
896
+ this.target.graph.terms['start'] = 'http://www.w3.org/1999/xhtml/vocab#start';
897
+ this.target.graph.terms['top'] = 'http://www.w3.org/1999/xhtml/vocab#top';
898
+ this.target.graph.terms['up'] = 'http://www.w3.org/1999/xhtml/vocab#up';
899
+ this.target.graph.terms['p3pv1'] = 'http://www.w3.org/1999/xhtml/vocab#p3pv1';
900
+ // other
901
+ this.target.graph.terms['related'] = 'http://www.w3.org/1999/xhtml/vocab#related';
902
+ this.target.graph.terms['role'] = 'http://www.w3.org/1999/xhtml/vocab#role';
903
+ this.target.graph.terms['transformation'] = 'http://www.w3.org/1999/xhtml/vocab#transformation';
904
+ }
905
+ setXMLContext() {
906
+ this.setInitialContext();
907
+ this.inXHTMLMode = false;
908
+ this.inHTMLMode = false;
909
+ }
910
+ tokenize(str) {
911
+ return this.trim(str).split(/\s+/);
912
+ }
913
+ static tokenize(str) {
914
+ return this.trim(str).split(/\s+/);
915
+ }
916
+ toRDFNodeObject(x) {
917
+ if (typeof x === 'undefined') return undefined;
918
+ if (typeof x === 'string') {
919
+ if (x.substring(0, 2) === '_:') {
920
+ if (typeof this.blankNodes[x.substring(2)] === 'undefined') {
921
+ this.blankNodes[x.substring(2)] = new BlankNode(x.substring(2));
1091
922
  }
1092
-
1093
- return rdf.namedNode(x);
923
+ return this.blankNodes[x.substring(2)];
1094
924
  }
1095
-
1096
- switch (x.type) {
1097
- case RDFaProcessor.objectURI:
1098
- if (x.value.substring(0, 2) === '_:') {
1099
- if (typeof this.blankNodes[x.value.substring(2)] === 'undefined') {
1100
- this.blankNodes[x.value.substring(2)] = new BlankNode(x.value.substring(2));
1101
- }
1102
-
1103
- return this.blankNodes[x.value.substring(2)];
1104
- }
1105
-
1106
- return rdf.namedNode(x.value);
1107
-
1108
- case RDFaProcessor.PlainLiteralURI:
1109
- return new Literal(x.value, x.language || '');
1110
-
1111
- case RDFaProcessor.XMLLiteralURI:
1112
- case RDFaProcessor.HTMLLiteralURI:
1113
- var string = '';
1114
- Object.keys(x.value).forEach(function (i) {
1115
- string += Util.domToString(x.value[i], _this.htmlOptions);
1116
- });
1117
- return new Literal(string, '', new NamedNode(x.type));
1118
-
1119
- default:
1120
- return new Literal(x.value, '', new NamedNode(x.type));
1121
- }
1122
- }
1123
- }, {
1124
- key: "trim",
1125
- value: function trim(str) {
1126
- return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
925
+ return rdf.namedNode(x);
1127
926
  }
1128
- }], [{
1129
- key: "parseRDFaDOM",
1130
- value: function parseRDFaDOM(dom, kb, base) {
1131
- var p = new RDFaProcessor(kb, {
1132
- 'base': base
1133
- }); // Cannot assign to read only property 'baseURI' of object '#<XMLDocument>':
1134
-
1135
- if (!dom.baseURI) {
1136
- // Note this became a read-only attribute some time before 2018
1137
- dom.baseURI = base; // oinly set if not already set
1138
- }
1139
-
1140
- p.process(dom, {
1141
- baseURI: base
1142
- });
1143
- }
1144
- }, {
1145
- key: "tokenize",
1146
- value: function tokenize(str) {
1147
- return this.trim(str).split(/\s+/);
1148
- }
1149
- }, {
1150
- key: "trim",
1151
- value: function trim(str) {
1152
- return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
927
+ switch (x.type) {
928
+ case RDFaProcessor.objectURI:
929
+ if (x.value.substring(0, 2) === '_:') {
930
+ if (typeof this.blankNodes[x.value.substring(2)] === 'undefined') {
931
+ this.blankNodes[x.value.substring(2)] = new BlankNode(x.value.substring(2));
932
+ }
933
+ return this.blankNodes[x.value.substring(2)];
934
+ }
935
+ return rdf.namedNode(x.value);
936
+ case RDFaProcessor.PlainLiteralURI:
937
+ return new Literal(x.value, x.language || '');
938
+ case RDFaProcessor.XMLLiteralURI:
939
+ case RDFaProcessor.HTMLLiteralURI:
940
+ var string = '';
941
+ Object.keys(x.value).forEach(i => {
942
+ string += Util.domToString(x.value[i], this.htmlOptions);
943
+ });
944
+ return new Literal(string, '', new NamedNode(x.type));
945
+ default:
946
+ return new Literal(x.value, '', new NamedNode(x.type));
1153
947
  }
1154
- }]);
1155
-
1156
- return RDFaProcessor;
1157
- }();
1158
-
1159
- export { RDFaProcessor as default };
948
+ }
949
+ trim(str) {
950
+ return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
951
+ }
952
+ static trim(str) {
953
+ return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
954
+ }
955
+ }
1160
956
  RDFaProcessor.XMLLiteralURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral';
1161
957
  RDFaProcessor.HTMLLiteralURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML';
1162
958
  RDFaProcessor.PlainLiteralURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral';
1163
959
  RDFaProcessor.objectURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#object';
1164
960
  RDFaProcessor.typeURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type';
1165
- RDFaProcessor.nameChar = "[-A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u10000-\uEFFFF.0-9\xB7\u0300-\u036F\u203F-\u2040]";
1166
- RDFaProcessor.nameStartChar = "[A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\xFF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3\u4E00-\u9FA5\u3007\u3021-\u3029_]";
961
+ RDFaProcessor.nameChar = '[-A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u10000-\uEFFFF\.0-9\u00B7\u0300-\u036F\u203F-\u2040]';
962
+ RDFaProcessor.nameStartChar = '[\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3\u4E00-\u9FA5\u3007\u3021-\u3029_]';
1167
963
  RDFaProcessor.NCNAME = new RegExp('^' + RDFaProcessor.nameStartChar + RDFaProcessor.nameChar + '*$');
964
+
1168
965
  /*
1169
966
  RDFaProcessor.prototype.resolveAndNormalize = function(base,href) {
1170
967
  var u = base.resolve(href)
@@ -1193,5 +990,5 @@ RDFaProcessor.dateTimeTypes = [{
1193
990
  pattern: /-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,
1194
991
  type: 'http://www.w3.org/2001/XMLSchema#gYear'
1195
992
  }];
1196
- var parseRDFaDOM = RDFaProcessor.parseRDFaDOM;
993
+ const parseRDFaDOM = RDFaProcessor.parseRDFaDOM;
1197
994
  export { parseRDFaDOM };