rdflib 2.2.22-4e175603 → 2.2.22-53d65d90
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.
- package/dist/rdflib.min.js +1 -1
- package/dist/rdflib.min.js.LICENSE.txt +4 -0
- package/dist/rdflib.min.js.map +1 -1
- package/esm/blank-node.js +90 -61
- package/esm/class-order.js +1 -1
- package/esm/collection.js +106 -70
- package/esm/default-graph.js +33 -13
- package/esm/empty.js +26 -8
- package/esm/factories/canonical-data-factory.js +30 -33
- package/esm/factories/extended-term-factory.js +14 -18
- package/esm/factories/factory-types.js +1 -1
- package/esm/factories/rdflib-data-factory.js +11 -9
- package/esm/fetcher.js +1644 -1355
- package/esm/formula.js +740 -632
- package/esm/index.js +51 -31
- package/esm/jsonldparser.js +26 -19
- package/esm/jsonparser.js +1 -1
- package/esm/lists.js +86 -38
- package/esm/literal.js +157 -120
- package/esm/log.js +7 -7
- package/esm/n3parser.js +1085 -1008
- package/esm/named-node.js +99 -69
- package/esm/namespace.js +4 -2
- package/esm/node-internal.js +98 -74
- package/esm/node.js +1 -1
- package/esm/parse.js +3 -3
- package/esm/patch-parser.js +1 -1
- package/esm/query.js +16 -15
- package/esm/rdfaparser.js +846 -781
- package/esm/rdfxmlparser.js +365 -348
- package/esm/serialize.js +4 -20
- package/esm/serializer.js +886 -821
- package/esm/statement.js +72 -52
- package/esm/store.js +924 -822
- package/esm/types.js +21 -21
- package/esm/update-manager.js +983 -882
- package/esm/updates-via.js +134 -104
- package/esm/uri.js +3 -3
- package/esm/utils/default-graph-uri.js +2 -2
- package/esm/utils/terms.js +5 -4
- package/esm/utils-js.js +5 -5
- package/esm/utils.js +6 -6
- package/esm/variable.js +58 -32
- package/esm/xsd.js +2 -2
- package/lib/blank-node.js +88 -60
- package/lib/class-order.js +1 -1
- package/lib/collection.js +104 -69
- package/lib/default-graph.js +32 -13
- package/lib/empty.js +25 -8
- package/lib/factories/canonical-data-factory.js +32 -35
- package/lib/factories/extended-term-factory.js +14 -18
- package/lib/factories/factory-types.js +1 -1
- package/lib/factories/rdflib-data-factory.js +11 -9
- package/lib/fetcher.js +1646 -1385
- package/lib/formula.d.ts +1 -1
- package/lib/formula.js +739 -632
- package/lib/index.js +87 -66
- package/lib/jsonldparser.js +26 -19
- package/lib/jsonparser.js +1 -1
- package/lib/lists.js +86 -54
- package/lib/literal.js +156 -120
- package/lib/log.js +7 -7
- package/lib/n3parser.js +1089 -1010
- package/lib/named-node.js +98 -69
- package/lib/namespace.js +4 -2
- package/lib/node-internal.js +96 -73
- package/lib/node.js +1 -1
- package/lib/parse.js +6 -5
- package/lib/patch-parser.js +1 -1
- package/lib/query.js +18 -19
- package/lib/rdfaparser.js +848 -783
- package/lib/rdfxmlparser.js +366 -350
- package/lib/serialize.d.ts +1 -1
- package/lib/serialize.js +4 -21
- package/lib/serializer.d.ts +1 -0
- package/lib/serializer.js +890 -825
- package/lib/statement.js +74 -54
- package/lib/store.d.ts +1 -1
- package/lib/store.js +926 -844
- package/lib/types.js +21 -21
- package/lib/update-manager.d.ts +1 -1
- package/lib/update-manager.js +959 -865
- package/lib/updates-via.js +134 -105
- package/lib/uri.js +3 -3
- package/lib/utils/default-graph-uri.js +2 -2
- package/lib/utils/terms.js +6 -4
- package/lib/utils-js.js +9 -8
- package/lib/utils.js +6 -6
- package/lib/variable.js +60 -34
- package/lib/xsd.js +2 -2
- package/package.json +6 -6
- package/src/jsonldparser.js +1 -1
- package/src/serialize.ts +4 -14
- package/src/serializer.js +24 -0
- package/src/update-manager.ts +8 -2
package/esm/rdfaparser.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
1
3
|
// RDFa Parser for rdflib.js
|
|
2
4
|
|
|
3
5
|
// Originally by: Alex Milowski
|
|
@@ -35,8 +37,9 @@ if (typeof Node === 'undefined') {
|
|
|
35
37
|
NOTATION_NODE: 12
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
var RDFaProcessor = /*#__PURE__*/function () {
|
|
41
|
+
function RDFaProcessor(kb, options) {
|
|
42
|
+
_classCallCheck(this, RDFaProcessor);
|
|
40
43
|
this.options = options || {};
|
|
41
44
|
this.kb = kb;
|
|
42
45
|
this.target = options.target || {
|
|
@@ -65,901 +68,963 @@ export default class RDFaProcessor {
|
|
|
65
68
|
this.finishedHandlers = [];
|
|
66
69
|
this.init();
|
|
67
70
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
su
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
var path = '';
|
|
83
|
-
while (node && node.nodeType !== Node.DOCUMENT_NODE) {
|
|
84
|
-
path = '/' + node.localName + path;
|
|
85
|
-
node = node.parentNode;
|
|
71
|
+
_createClass(RDFaProcessor, [{
|
|
72
|
+
key: "addTriple",
|
|
73
|
+
value: function addTriple(origin, subject, predicate, object) {
|
|
74
|
+
var su, ob, pr, or;
|
|
75
|
+
if (typeof subject === 'undefined') {
|
|
76
|
+
su = rdf.namedNode(this.options.base);
|
|
77
|
+
} else {
|
|
78
|
+
su = this.toRDFNodeObject(subject);
|
|
79
|
+
}
|
|
80
|
+
pr = this.toRDFNodeObject(predicate);
|
|
81
|
+
ob = this.toRDFNodeObject(object);
|
|
82
|
+
or = rdf.namedNode(this.options.base);
|
|
83
|
+
// console.log('Adding { ' + su + ' ' + pr + ' ' + ob + ' ' + or + ' }')
|
|
84
|
+
this.kb.add(su, pr, ob, or);
|
|
86
85
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
}, {
|
|
87
|
+
key: "ancestorPath",
|
|
88
|
+
value: function ancestorPath(node) {
|
|
89
|
+
var path = '';
|
|
90
|
+
while (node && node.nodeType !== Node.DOCUMENT_NODE) {
|
|
91
|
+
path = '/' + node.localName + path;
|
|
92
|
+
node = node.parentNode;
|
|
93
|
+
}
|
|
94
|
+
return path;
|
|
93
95
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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;
|
|
96
|
+
}, {
|
|
97
|
+
key: "copyMappings",
|
|
98
|
+
value: function copyMappings(mappings) {
|
|
99
|
+
var newMappings = {};
|
|
100
|
+
for (var k in mappings) {
|
|
101
|
+
newMappings[k] = mappings[k];
|
|
104
102
|
}
|
|
103
|
+
return newMappings;
|
|
105
104
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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);
|
|
105
|
+
}, {
|
|
106
|
+
key: "copyProperties",
|
|
107
|
+
value: function copyProperties() {}
|
|
108
|
+
}, {
|
|
109
|
+
key: "deriveDateTimeType",
|
|
110
|
+
value: function deriveDateTimeType(value) {
|
|
111
|
+
for (var i = 0; i < RDFaProcessor.dateTimeTypes.length; i++) {
|
|
112
|
+
// console.log("Checking "+value+" against "+RDFaProcessor.dateTimeTypes[i].type)
|
|
113
|
+
var matched = RDFaProcessor.dateTimeTypes[i].pattern.exec(value);
|
|
114
|
+
if (matched && matched[0].length === value.length) {
|
|
115
|
+
// console.log("Matched!")
|
|
116
|
+
return RDFaProcessor.dateTimeTypes[i].type;
|
|
130
117
|
}
|
|
131
118
|
}
|
|
132
|
-
}
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
parseCURIEOrURI(value, prefixes, base) {
|
|
136
|
-
var curie = this.parseCURIE(value, prefixes, base);
|
|
137
|
-
if (curie) {
|
|
138
|
-
return curie;
|
|
139
|
-
}
|
|
140
|
-
return this.resolveAndNormalize(base, value);
|
|
141
|
-
}
|
|
142
|
-
parsePredicate(value, defaultVocabulary, terms, prefixes, base, ignoreTerms) {
|
|
143
|
-
if (value === '') {
|
|
144
119
|
return null;
|
|
145
120
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
121
|
+
}, {
|
|
122
|
+
key: "init",
|
|
123
|
+
value: function init() {}
|
|
124
|
+
}, {
|
|
125
|
+
key: "newBlankNode",
|
|
126
|
+
value: function newBlankNode() {
|
|
127
|
+
this.blankCounter++;
|
|
128
|
+
return '_:' + this.blankCounter;
|
|
149
129
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
130
|
+
}, {
|
|
131
|
+
key: "newSubjectOrigin",
|
|
132
|
+
value: function newSubjectOrigin(origin, subject) {}
|
|
133
|
+
}, {
|
|
134
|
+
key: "parseCURIE",
|
|
135
|
+
value: function parseCURIE(value, prefixes, base) {
|
|
136
|
+
var colon = value.indexOf(':');
|
|
137
|
+
var uri;
|
|
138
|
+
if (colon >= 0) {
|
|
139
|
+
var prefix = value.substring(0, colon);
|
|
140
|
+
if (prefix === '') {
|
|
141
|
+
// default prefix
|
|
142
|
+
uri = prefixes[''];
|
|
143
|
+
return uri ? uri + value.substring(colon + 1) : null;
|
|
144
|
+
} else if (prefix === '_') {
|
|
145
|
+
// blank node
|
|
146
|
+
return '_:' + value.substring(colon + 1);
|
|
147
|
+
} else if (RDFaProcessor.NCNAME.test(prefix)) {
|
|
148
|
+
uri = prefixes[prefix];
|
|
149
|
+
if (uri) {
|
|
150
|
+
return uri + value.substring(colon + 1);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
162
153
|
}
|
|
154
|
+
return null;
|
|
163
155
|
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
dom.baseURI = base; // oinly set if not already set
|
|
156
|
+
}, {
|
|
157
|
+
key: "parseCURIEOrURI",
|
|
158
|
+
value: function parseCURIEOrURI(value, prefixes, base) {
|
|
159
|
+
var curie = this.parseCURIE(value, prefixes, base);
|
|
160
|
+
if (curie) {
|
|
161
|
+
return curie;
|
|
162
|
+
}
|
|
163
|
+
return this.resolveAndNormalize(base, value);
|
|
173
164
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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) {
|
|
165
|
+
}, {
|
|
166
|
+
key: "parsePredicate",
|
|
167
|
+
value: function parsePredicate(value, defaultVocabulary, terms, prefixes, base, ignoreTerms) {
|
|
168
|
+
if (value === '') {
|
|
185
169
|
return null;
|
|
186
170
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
return
|
|
171
|
+
var predicate = this.parseTermOrCURIEOrAbsURI(value, defaultVocabulary, ignoreTerms ? null : terms, prefixes, base);
|
|
172
|
+
if (predicate && predicate.indexOf('_:') === 0) {
|
|
173
|
+
return null;
|
|
190
174
|
}
|
|
191
|
-
return
|
|
192
|
-
} else {
|
|
193
|
-
return this.parseCURIEOrURI(value, prefixes, base);
|
|
175
|
+
return predicate;
|
|
194
176
|
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
return term;
|
|
209
|
-
}
|
|
210
|
-
var lcvalue = value.toLowerCase();
|
|
211
|
-
term = terms[lcvalue];
|
|
212
|
-
if (term) {
|
|
213
|
-
return term;
|
|
177
|
+
}, {
|
|
178
|
+
key: "parsePrefixMappings",
|
|
179
|
+
value: function parsePrefixMappings(str, target) {
|
|
180
|
+
var values = this.tokenize(str);
|
|
181
|
+
var prefix = null;
|
|
182
|
+
// var uri = null
|
|
183
|
+
for (var i = 0; i < values.length; i++) {
|
|
184
|
+
if (values[i][values[i].length - 1] === ':') {
|
|
185
|
+
prefix = values[i].substring(0, values[i].length - 1);
|
|
186
|
+
} else if (prefix) {
|
|
187
|
+
target[prefix] = this.options.base ? Uri.join(values[i], this.options.base) : values[i];
|
|
188
|
+
prefix = null;
|
|
189
|
+
}
|
|
214
190
|
}
|
|
215
191
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
return
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
term = terms[lcvalue];
|
|
234
|
-
if (term) {
|
|
235
|
-
return term;
|
|
236
|
-
}
|
|
237
|
-
if (defaultVocabulary && !this.absURIRE.exec(value)) {
|
|
238
|
-
return defaultVocabulary + value;
|
|
192
|
+
}, {
|
|
193
|
+
key: "parseSafeCURIEOrCURIEOrURI",
|
|
194
|
+
value: function parseSafeCURIEOrCURIEOrURI(value, prefixes, base) {
|
|
195
|
+
value = this.trim(value);
|
|
196
|
+
if (value.charAt(0) === '[' && value.charAt(value.length - 1) === ']') {
|
|
197
|
+
value = value.substring(1, value.length - 1);
|
|
198
|
+
value = value.trim(value);
|
|
199
|
+
if (value.length === 0) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
if (value === '_:') {
|
|
203
|
+
// the one node
|
|
204
|
+
return this.theOne;
|
|
205
|
+
}
|
|
206
|
+
return this.parseCURIE(value, prefixes, base);
|
|
207
|
+
} else {
|
|
208
|
+
return this.parseCURIEOrURI(value, prefixes, base);
|
|
239
209
|
}
|
|
240
210
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
211
|
+
}, {
|
|
212
|
+
key: "parseTermOrCURIEOrAbsURI",
|
|
213
|
+
value: function parseTermOrCURIEOrAbsURI(value, defaultVocabulary, terms, prefixes, base) {
|
|
214
|
+
// alert("Parsing "+value+" with default vocab "+defaultVocabulary)
|
|
215
|
+
value = this.trim(value);
|
|
216
|
+
var curie = this.parseCURIE(value, prefixes, base);
|
|
217
|
+
if (curie) {
|
|
218
|
+
return curie;
|
|
219
|
+
} else if (terms) {
|
|
220
|
+
if (defaultVocabulary && !this.absURIRE.exec(value)) {
|
|
221
|
+
return defaultVocabulary + value;
|
|
222
|
+
}
|
|
223
|
+
var term = terms[value];
|
|
224
|
+
if (term) {
|
|
225
|
+
return term;
|
|
226
|
+
}
|
|
227
|
+
var lcvalue = value.toLowerCase();
|
|
228
|
+
term = terms[lcvalue];
|
|
229
|
+
if (term) {
|
|
230
|
+
return term;
|
|
231
|
+
}
|
|
257
232
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
node = node.documentElement;
|
|
261
|
-
if (!node.baseURI) {
|
|
262
|
-
node.baseURI = base;
|
|
233
|
+
if (this.absURIRE.exec(value)) {
|
|
234
|
+
return this.resolveAndNormalize(base, value);
|
|
263
235
|
}
|
|
264
|
-
|
|
265
|
-
} else if (node.parentNode.nodeType === Node.DOCUMENT_NODE) {
|
|
266
|
-
this.setContext(node);
|
|
236
|
+
return null;
|
|
267
237
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
//
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
238
|
+
}, {
|
|
239
|
+
key: "parseTermOrCURIEOrURI",
|
|
240
|
+
value: function parseTermOrCURIEOrURI(value, defaultVocabulary, terms, prefixes, base) {
|
|
241
|
+
// alert("Parsing "+value+" with default vocab "+defaultVocabulary)
|
|
242
|
+
value = this.trim(value);
|
|
243
|
+
var curie = this.parseCURIE(value, prefixes, base);
|
|
244
|
+
if (curie) {
|
|
245
|
+
return curie;
|
|
246
|
+
} else {
|
|
247
|
+
var term = terms[value];
|
|
248
|
+
if (term) {
|
|
249
|
+
return term;
|
|
250
|
+
}
|
|
251
|
+
var lcvalue = value.toLowerCase();
|
|
252
|
+
term = terms[lcvalue];
|
|
253
|
+
if (term) {
|
|
254
|
+
return term;
|
|
255
|
+
}
|
|
256
|
+
if (defaultVocabulary && !this.absURIRE.exec(value)) {
|
|
257
|
+
return defaultVocabulary + value;
|
|
258
|
+
}
|
|
278
259
|
}
|
|
279
|
-
|
|
280
|
-
|
|
260
|
+
return this.resolveAndNormalize(base, value);
|
|
261
|
+
}
|
|
262
|
+
}, {
|
|
263
|
+
key: "parseURI",
|
|
264
|
+
value: function parseURI(uri) {
|
|
265
|
+
return uri; // We just use strings as URIs, not objects now.
|
|
266
|
+
}
|
|
267
|
+
}, {
|
|
268
|
+
key: "process",
|
|
269
|
+
value: function process(node, options) {
|
|
270
|
+
/*
|
|
271
|
+
if (!window.console) {
|
|
272
|
+
window.console = { log: function() {} }
|
|
273
|
+
} */
|
|
274
|
+
options = options || {};
|
|
275
|
+
var base;
|
|
276
|
+
if (node.nodeType === Node.DOCUMENT_NODE) {
|
|
277
|
+
if (node.baseURI && !options.baseURI) {
|
|
278
|
+
options.baseURI = node.baseURI; // be defensive as DOM implementations vary
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
base = node.baseURI;
|
|
282
|
+
node = node.documentElement;
|
|
283
|
+
if (!node.baseURI) {
|
|
284
|
+
node.baseURI = base;
|
|
285
|
+
}
|
|
286
|
+
this.setContext(node);
|
|
287
|
+
} else if (node.parentNode.nodeType === Node.DOCUMENT_NODE) {
|
|
288
|
+
this.setContext(node);
|
|
281
289
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
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;
|
|
290
|
+
var queue = [];
|
|
291
|
+
// Fix for Firefox that includes the hash in the base URI
|
|
292
|
+
var removeHash = function removeHash(baseURI) {
|
|
293
|
+
// Fix for undefined baseURI property
|
|
294
|
+
if (!baseURI && options && options.baseURI) {
|
|
295
|
+
return options.baseURI;
|
|
295
296
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
297
|
+
var hash = baseURI.indexOf('#');
|
|
298
|
+
if (hash >= 0) {
|
|
299
|
+
baseURI = baseURI.substring(0, hash);
|
|
300
|
+
}
|
|
301
|
+
if (options && options.baseURIMap) {
|
|
302
|
+
baseURI = options.baseURIMap(baseURI);
|
|
303
|
+
}
|
|
304
|
+
return baseURI;
|
|
305
|
+
};
|
|
306
|
+
queue.push({
|
|
307
|
+
current: node,
|
|
308
|
+
context: this.push(null, removeHash(node.baseURI))
|
|
309
|
+
});
|
|
310
|
+
while (queue.length > 0) {
|
|
311
|
+
var item = queue.shift();
|
|
312
|
+
if (item.parent) {
|
|
313
|
+
// Sequence Step 14: list triple generation
|
|
314
|
+
if (item.context.parent && item.context.parent.listMapping === item.listMapping) {
|
|
315
|
+
// Skip a child context with exactly the same mapping
|
|
304
316
|
continue;
|
|
305
317
|
}
|
|
306
|
-
|
|
307
|
-
for (
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
318
|
+
// console.log("Generating lists for "+item.subject+", tag "+item.parent.localName)
|
|
319
|
+
for (var _predicate in item.listMapping) {
|
|
320
|
+
var list = item.listMapping[_predicate];
|
|
321
|
+
if (list.length === 0) {
|
|
322
|
+
this.addTriple(item.parent, item.subject, _predicate, {
|
|
323
|
+
type: RDFaProcessor.objectURI,
|
|
324
|
+
value: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'
|
|
325
|
+
});
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
var bnodes = [];
|
|
329
|
+
for (var _i = 0; _i < list.length; _i++) {
|
|
330
|
+
bnodes.push(this.newBlankNode());
|
|
331
|
+
// this.newSubject(item.parent,bnodes[i])
|
|
332
|
+
}
|
|
311
333
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
334
|
+
for (var _i2 = 0; _i2 < bnodes.length; _i2++) {
|
|
335
|
+
this.addTriple(item.parent, bnodes[_i2], 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first', list[_i2]);
|
|
336
|
+
this.addTriple(item.parent, bnodes[_i2], 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest', {
|
|
337
|
+
type: RDFaProcessor.objectURI,
|
|
338
|
+
value: _i2 + 1 < bnodes.length ? bnodes[_i2 + 1] : 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
this.addTriple(item.parent, item.subject, _predicate, {
|
|
315
342
|
type: RDFaProcessor.objectURI,
|
|
316
|
-
value:
|
|
343
|
+
value: bnodes[0]
|
|
317
344
|
});
|
|
318
345
|
}
|
|
319
|
-
|
|
320
|
-
type: RDFaProcessor.objectURI,
|
|
321
|
-
value: bnodes[0]
|
|
322
|
-
});
|
|
346
|
+
continue;
|
|
323
347
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
vocabulary = this.vocabulary;
|
|
348
|
+
var current = item.current;
|
|
349
|
+
var context = item.context;
|
|
350
|
+
// console.log("Tag: "+current.localName+", listMapping="+JSON.stringify(context.listMapping))
|
|
351
|
+
// Sequence Step 1
|
|
352
|
+
var skip = false;
|
|
353
|
+
var newSubject = null;
|
|
354
|
+
var currentObjectResource = null;
|
|
355
|
+
var typedResource = null;
|
|
356
|
+
var prefixes = context.prefixes;
|
|
357
|
+
var prefixesCopied = false;
|
|
358
|
+
var incomplete = [];
|
|
359
|
+
var listMapping = context.listMapping;
|
|
360
|
+
var listMappingDifferent = !context.parent;
|
|
361
|
+
var language = context.language;
|
|
362
|
+
var vocabulary = context.vocabulary;
|
|
363
|
+
// TODO: the "base" element may be used for HTML+RDFa 1.1
|
|
364
|
+
base = this.parseURI(removeHash(current.baseURI));
|
|
365
|
+
current.item = null;
|
|
366
|
+
// Sequence Step 2: set the default vocabulary
|
|
367
|
+
var vocabAtt = current.getAttributeNode('vocab');
|
|
368
|
+
if (vocabAtt) {
|
|
369
|
+
var value = this.trim(vocabAtt.value);
|
|
370
|
+
if (value.length > 0) {
|
|
371
|
+
vocabulary = value;
|
|
372
|
+
var baseSubject = base.spec;
|
|
373
|
+
// this.newSubject(current,baseSubject)
|
|
374
|
+
this.addTriple(current, baseSubject, 'http://www.w3.org/ns/rdfa#usesVocabulary', {
|
|
375
|
+
type: RDFaProcessor.objectURI,
|
|
376
|
+
value: vocabulary
|
|
377
|
+
});
|
|
378
|
+
} else {
|
|
379
|
+
vocabulary = this.vocabulary;
|
|
380
|
+
}
|
|
358
381
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
382
|
+
// Sequence Step 3: IRI mappings
|
|
383
|
+
// handle xmlns attributes
|
|
384
|
+
for (var i = 0; i < current.attributes.length; i++) {
|
|
385
|
+
var att = current.attributes[i];
|
|
386
|
+
// if (att.namespaceURI=="http://www.w3.org/2000/xmlns/") {
|
|
387
|
+
if (att.nodeName.charAt(0) === 'x' && att.nodeName.indexOf('xmlns:') === 0) {
|
|
388
|
+
if (!prefixesCopied) {
|
|
389
|
+
prefixes = this.copyMappings(prefixes);
|
|
390
|
+
prefixesCopied = true;
|
|
391
|
+
}
|
|
392
|
+
var prefix = att.nodeName.substring(6);
|
|
393
|
+
// TODO: resolve relative?
|
|
394
|
+
var ref = RDFaProcessor.trim(att.value);
|
|
395
|
+
prefixes[prefix] = this.options.base ? Uri.join(ref, this.options.base) : ref;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
// Handle prefix mappings (@prefix)
|
|
399
|
+
var prefixAtt = current.getAttributeNode('prefix');
|
|
400
|
+
if (prefixAtt) {
|
|
366
401
|
if (!prefixesCopied) {
|
|
367
402
|
prefixes = this.copyMappings(prefixes);
|
|
368
403
|
prefixesCopied = true;
|
|
369
404
|
}
|
|
370
|
-
|
|
371
|
-
// TODO: resolve relative?
|
|
372
|
-
var ref = RDFaProcessor.trim(att.value);
|
|
373
|
-
prefixes[prefix] = this.options.base ? Uri.join(ref, this.options.base) : ref;
|
|
405
|
+
this.parsePrefixMappings(prefixAtt.value, prefixes);
|
|
374
406
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
if (!prefixesCopied) {
|
|
380
|
-
prefixes = this.copyMappings(prefixes);
|
|
381
|
-
prefixesCopied = true;
|
|
382
|
-
}
|
|
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;
|
|
407
|
+
// Sequence Step 4: language
|
|
408
|
+
var xmlLangAtt = null;
|
|
409
|
+
for (var _i3 = 0; !xmlLangAtt && _i3 < this.langAttributes.length; _i3++) {
|
|
410
|
+
xmlLangAtt = current.getAttributeNodeNS(this.langAttributes[_i3].namespaceURI, this.langAttributes[_i3].localName);
|
|
396
411
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
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);
|
|
412
|
+
if (xmlLangAtt) {
|
|
413
|
+
var _value = RDFaProcessor.trim(xmlLangAtt.value);
|
|
414
|
+
if (_value.length > 0) {
|
|
415
|
+
language = _value;
|
|
416
|
+
} else {
|
|
417
|
+
language = null;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
420
|
+
var relAtt = current.getAttributeNode('rel');
|
|
421
|
+
var revAtt = current.getAttributeNode('rev');
|
|
422
|
+
var typeofAtt = current.getAttributeNode('typeof');
|
|
423
|
+
var propertyAtt = current.getAttributeNode('property');
|
|
424
|
+
var datatypeAtt = current.getAttributeNode('datatype');
|
|
425
|
+
var datetimeAtt = this.inHTMLMode ? current.getAttributeNode('datetime') : null;
|
|
426
|
+
var contentAtt = current.getAttributeNode('content');
|
|
427
|
+
var aboutAtt = current.getAttributeNode('about');
|
|
428
|
+
var srcAtt = current.getAttributeNode('src');
|
|
429
|
+
var resourceAtt = current.getAttributeNode('resource');
|
|
430
|
+
var hrefAtt = current.getAttributeNode('href');
|
|
431
|
+
var inlistAtt = current.getAttributeNode('inlist');
|
|
432
|
+
var relAttPredicates = [];
|
|
433
|
+
var predicate, values;
|
|
434
|
+
if (relAtt) {
|
|
435
|
+
values = this.tokenize(relAtt.value);
|
|
436
|
+
for (var _i4 = 0; _i4 < values.length; _i4++) {
|
|
437
|
+
predicate = this.parsePredicate(values[_i4], vocabulary, context.terms, prefixes, base, this.inHTMLMode && propertyAtt !== null);
|
|
438
|
+
if (predicate) {
|
|
439
|
+
relAttPredicates.push(predicate);
|
|
440
|
+
}
|
|
428
441
|
}
|
|
429
442
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
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;
|
|
443
|
+
var revAttPredicates = [];
|
|
444
|
+
if (revAtt) {
|
|
445
|
+
values = this.tokenize(revAtt.value);
|
|
446
|
+
for (var _i5 = 0; _i5 < values.length; _i5++) {
|
|
447
|
+
predicate = this.parsePredicate(values[_i5], vocabulary, context.terms, prefixes, base, this.inHTMLMode && propertyAtt);
|
|
448
|
+
if (predicate) {
|
|
449
|
+
revAttPredicates.push(predicate);
|
|
450
|
+
}
|
|
454
451
|
}
|
|
455
452
|
}
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
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();
|
|
453
|
+
// Section 3.1, bullet 7
|
|
454
|
+
if (this.inHTMLMode && (relAtt || revAtt) && propertyAtt) {
|
|
455
|
+
if (relAttPredicates.length === 0) {
|
|
456
|
+
relAtt = null;
|
|
466
457
|
}
|
|
467
|
-
|
|
468
|
-
|
|
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);
|
|
477
|
-
if (typeofAtt) {
|
|
478
|
-
typedResource = newSubject;
|
|
458
|
+
if (revAttPredicates.length === 0) {
|
|
459
|
+
revAtt = null;
|
|
479
460
|
}
|
|
480
461
|
}
|
|
481
|
-
if (
|
|
482
|
-
|
|
462
|
+
if (relAtt || revAtt) {
|
|
463
|
+
// Sequence Step 6: establish new subject and value
|
|
464
|
+
if (aboutAtt) {
|
|
465
|
+
newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value, prefixes, base);
|
|
466
|
+
}
|
|
483
467
|
if (typeofAtt) {
|
|
484
468
|
typedResource = newSubject;
|
|
485
469
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
470
|
+
if (!newSubject) {
|
|
471
|
+
if (current.parentNode.nodeType === Node.DOCUMENT_NODE) {
|
|
472
|
+
newSubject = removeHash(current.baseURI);
|
|
473
|
+
} else if (context.parentObject) {
|
|
474
|
+
// 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
|
|
475
|
+
newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
|
|
476
|
+
}
|
|
493
477
|
}
|
|
494
|
-
if (
|
|
495
|
-
|
|
478
|
+
if (resourceAtt) {
|
|
479
|
+
currentObjectResource = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);
|
|
496
480
|
}
|
|
497
|
-
if (!
|
|
498
|
-
|
|
481
|
+
if (!currentObjectResource) {
|
|
482
|
+
if (hrefAtt) {
|
|
483
|
+
currentObjectResource = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));
|
|
484
|
+
} else if (srcAtt) {
|
|
485
|
+
currentObjectResource = this.resolveAndNormalize(base, encodeURI(srcAtt.value));
|
|
486
|
+
} else if (typeofAtt && !aboutAtt && !(this.inXHTMLMode && (current.localName === 'head' || current.localName === 'body'))) {
|
|
487
|
+
currentObjectResource = this.newBlankNode();
|
|
488
|
+
}
|
|
499
489
|
}
|
|
500
|
-
if (!
|
|
490
|
+
if (typeofAtt && !aboutAtt && this.inXHTMLMode && (current.localName === 'head' || current.localName === 'body')) {
|
|
501
491
|
typedResource = newSubject;
|
|
492
|
+
} else if (typeofAtt && !aboutAtt) {
|
|
493
|
+
typedResource = currentObjectResource;
|
|
502
494
|
}
|
|
503
|
-
|
|
504
|
-
|
|
495
|
+
} else if (propertyAtt && !contentAtt && !datatypeAtt) {
|
|
496
|
+
// Sequence Step 5.1: establish a new subject
|
|
497
|
+
if (aboutAtt) {
|
|
498
|
+
newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value, prefixes, base);
|
|
499
|
+
if (typeofAtt) {
|
|
500
|
+
typedResource = newSubject;
|
|
501
|
+
}
|
|
505
502
|
}
|
|
506
|
-
|
|
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) {
|
|
503
|
+
if (!newSubject && current.parentNode.nodeType === Node.DOCUMENT_NODE) {
|
|
525
504
|
newSubject = removeHash(current.baseURI);
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
} else if (context.parentObject) {
|
|
505
|
+
if (typeofAtt) {
|
|
506
|
+
typedResource = newSubject;
|
|
507
|
+
}
|
|
508
|
+
} else if (!newSubject && context.parentObject) {
|
|
531
509
|
// 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
|
|
532
510
|
newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
|
|
533
|
-
|
|
534
|
-
|
|
511
|
+
}
|
|
512
|
+
if (typeofAtt && !typedResource) {
|
|
513
|
+
if (resourceAtt) {
|
|
514
|
+
typedResource = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);
|
|
515
|
+
}
|
|
516
|
+
if (!typedResource && hrefAtt) {
|
|
517
|
+
typedResource = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));
|
|
535
518
|
}
|
|
519
|
+
if (!typedResource && srcAtt) {
|
|
520
|
+
typedResource = this.resolveAndNormalize(base, encodeURI(srcAtt.value));
|
|
521
|
+
}
|
|
522
|
+
if (!typedResource && (this.inXHTMLMode || this.inHTMLMode) && (current.localName === 'head' || current.localName === 'body')) {
|
|
523
|
+
typedResource = newSubject;
|
|
524
|
+
}
|
|
525
|
+
if (!typedResource) {
|
|
526
|
+
typedResource = this.newBlankNode();
|
|
527
|
+
}
|
|
528
|
+
currentObjectResource = typedResource;
|
|
536
529
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
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
|
-
});
|
|
530
|
+
// console.log(current.localName+", newSubject="+newSubject+", typedResource="+typedResource+", currentObjectResource="+currentObjectResource)
|
|
531
|
+
} else {
|
|
532
|
+
// Sequence Step 5.2: establish a new subject
|
|
533
|
+
if (aboutAtt) {
|
|
534
|
+
newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value, prefixes, base);
|
|
565
535
|
}
|
|
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
|
-
});
|
|
536
|
+
if (!newSubject && resourceAtt) {
|
|
537
|
+
newSubject = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);
|
|
588
538
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
this.addTriple(current, newSubject, relAttPredicates[i], {
|
|
592
|
-
type: RDFaProcessor.objectURI,
|
|
593
|
-
value: currentObjectResource
|
|
594
|
-
});
|
|
539
|
+
if (!newSubject && hrefAtt) {
|
|
540
|
+
newSubject = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));
|
|
595
541
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
for (let i = 0; i < revAttPredicates.length; i++) {
|
|
599
|
-
this.addTriple(current, currentObjectResource, revAttPredicates[i], {
|
|
600
|
-
type: RDFaProcessor.objectURI,
|
|
601
|
-
value: newSubject
|
|
602
|
-
});
|
|
542
|
+
if (!newSubject && srcAtt) {
|
|
543
|
+
newSubject = this.resolveAndNormalize(base, encodeURI(srcAtt.value));
|
|
603
544
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
}
|
|
619
|
-
// console.log("Adding incomplete list for "+predicate)
|
|
620
|
-
incomplete.push({
|
|
621
|
-
predicate: relAttPredicates[i],
|
|
622
|
-
list: list
|
|
623
|
-
});
|
|
545
|
+
if (!newSubject) {
|
|
546
|
+
if (current.parentNode.nodeType === Node.DOCUMENT_NODE) {
|
|
547
|
+
newSubject = removeHash(current.baseURI);
|
|
548
|
+
} else if ((this.inXHTMLMode || this.inHTMLMode) && (current.localName === 'head' || current.localName === 'body')) {
|
|
549
|
+
newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
|
|
550
|
+
} else if (typeofAtt) {
|
|
551
|
+
newSubject = this.newBlankNode();
|
|
552
|
+
} else if (context.parentObject) {
|
|
553
|
+
// 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
|
|
554
|
+
newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
|
|
555
|
+
if (!propertyAtt) {
|
|
556
|
+
skip = true;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
624
559
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
incomplete.push({
|
|
628
|
-
predicate: relAttPredicates[i],
|
|
629
|
-
forward: true
|
|
630
|
-
});
|
|
560
|
+
if (typeofAtt) {
|
|
561
|
+
typedResource = newSubject;
|
|
631
562
|
}
|
|
632
563
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
564
|
+
// console.log(current.tagName+": newSubject="+newSubject+", currentObjectResource="+currentObjectResource+", typedResource="+typedResource+", skip="+skip)
|
|
565
|
+
// var rdfaData = null
|
|
566
|
+
if (newSubject) {
|
|
567
|
+
// this.newSubject(current,newSubject)
|
|
568
|
+
if (aboutAtt || resourceAtt || typedResource) {
|
|
569
|
+
var id = newSubject;
|
|
570
|
+
if (typeofAtt && !aboutAtt && !resourceAtt && currentObjectResource) {
|
|
571
|
+
id = currentObjectResource;
|
|
572
|
+
}
|
|
573
|
+
// console.log("Setting data attribute for "+current.localName+" for subject "+id)
|
|
574
|
+
this.newSubjectOrigin(current, id);
|
|
639
575
|
}
|
|
640
576
|
}
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
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;
|
|
577
|
+
// Sequence Step 7: generate type triple
|
|
578
|
+
if (typedResource) {
|
|
579
|
+
values = this.tokenize(typeofAtt.value);
|
|
580
|
+
for (var _i6 = 0; _i6 < values.length; _i6++) {
|
|
581
|
+
var object = this.parseTermOrCURIEOrAbsURI(values[_i6], vocabulary, context.terms, prefixes, base);
|
|
582
|
+
if (object) {
|
|
583
|
+
this.addTriple(current, typedResource, RDFaProcessor.typeURI, {
|
|
584
|
+
type: RDFaProcessor.objectURI,
|
|
585
|
+
value: object
|
|
586
|
+
});
|
|
587
|
+
}
|
|
661
588
|
}
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
|
|
589
|
+
}
|
|
590
|
+
// Sequence Step 8: new list mappings if there is a new subject
|
|
591
|
+
// console.log("Step 8: newSubject="+newSubject+", context.parentObject="+context.parentObject)
|
|
592
|
+
if (newSubject && newSubject !== context.parentObject) {
|
|
593
|
+
// console.log("Generating new list mapping for "+newSubject)
|
|
594
|
+
listMapping = {};
|
|
595
|
+
listMappingDifferent = true;
|
|
596
|
+
}
|
|
597
|
+
// Sequence Step 9: generate object triple
|
|
598
|
+
if (currentObjectResource) {
|
|
599
|
+
if (relAtt && inlistAtt) {
|
|
600
|
+
for (var _i7 = 0; _i7 < relAttPredicates.length; _i7++) {
|
|
601
|
+
var _list = listMapping[relAttPredicates[_i7]];
|
|
602
|
+
if (!_list) {
|
|
603
|
+
_list = [];
|
|
604
|
+
listMapping[relAttPredicates[_i7]] = _list;
|
|
605
|
+
}
|
|
606
|
+
_list.push({
|
|
607
|
+
type: RDFaProcessor.objectURI,
|
|
608
|
+
value: currentObjectResource
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
} else if (relAtt) {
|
|
612
|
+
for (var _i8 = 0; _i8 < relAttPredicates.length; _i8++) {
|
|
613
|
+
this.addTriple(current, newSubject, relAttPredicates[_i8], {
|
|
614
|
+
type: RDFaProcessor.objectURI,
|
|
615
|
+
value: currentObjectResource
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
if (revAtt) {
|
|
620
|
+
for (var _i9 = 0; _i9 < revAttPredicates.length; _i9++) {
|
|
621
|
+
this.addTriple(current, currentObjectResource, revAttPredicates[_i9], {
|
|
622
|
+
type: RDFaProcessor.objectURI,
|
|
623
|
+
value: newSubject
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
} else {
|
|
628
|
+
// Sequence Step 10: incomplete triples
|
|
629
|
+
if (newSubject && !currentObjectResource && (relAtt || revAtt)) {
|
|
630
|
+
currentObjectResource = this.newBlankNode();
|
|
631
|
+
// alert(current.tagName+": generated blank node, newSubject="+newSubject+" currentObjectResource="+currentObjectResource)
|
|
665
632
|
}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
633
|
+
|
|
634
|
+
if (relAtt && inlistAtt) {
|
|
635
|
+
for (var _i10 = 0; _i10 < relAttPredicates.length; _i10++) {
|
|
636
|
+
var _list2 = listMapping[relAttPredicates[_i10]];
|
|
637
|
+
if (!_list2) {
|
|
638
|
+
_list2 = [];
|
|
639
|
+
listMapping[predicate] = _list2;
|
|
640
|
+
}
|
|
641
|
+
// console.log("Adding incomplete list for "+predicate)
|
|
642
|
+
incomplete.push({
|
|
643
|
+
predicate: relAttPredicates[_i10],
|
|
644
|
+
list: _list2
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
} else if (relAtt) {
|
|
648
|
+
for (var _i11 = 0; _i11 < relAttPredicates.length; _i11++) {
|
|
649
|
+
incomplete.push({
|
|
650
|
+
predicate: relAttPredicates[_i11],
|
|
651
|
+
forward: true
|
|
652
|
+
});
|
|
653
|
+
}
|
|
670
654
|
}
|
|
671
|
-
if (
|
|
672
|
-
|
|
655
|
+
if (revAtt) {
|
|
656
|
+
for (var _i12 = 0; _i12 < revAttPredicates.length; _i12++) {
|
|
657
|
+
incomplete.push({
|
|
658
|
+
predicate: revAttPredicates[_i12],
|
|
659
|
+
forward: false
|
|
660
|
+
});
|
|
661
|
+
}
|
|
673
662
|
}
|
|
674
663
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
if (
|
|
682
|
-
|
|
664
|
+
// Step 11: Current property values
|
|
665
|
+
if (propertyAtt) {
|
|
666
|
+
var datatype = null;
|
|
667
|
+
var content = null;
|
|
668
|
+
if (datatypeAtt) {
|
|
669
|
+
datatype = datatypeAtt.value === '' ? RDFaProcessor.PlainLiteralURI : this.parseTermOrCURIEOrAbsURI(datatypeAtt.value, vocabulary, context.terms, prefixes, base);
|
|
670
|
+
if (datetimeAtt && !contentAtt) {
|
|
671
|
+
content = datetimeAtt.value;
|
|
672
|
+
} else {
|
|
673
|
+
content = datatype === RDFaProcessor.XMLLiteralURI || datatype === RDFaProcessor.HTMLLiteralURI ? null : contentAtt ? contentAtt.value : current.textContent;
|
|
683
674
|
}
|
|
675
|
+
} else if (contentAtt) {
|
|
676
|
+
datatype = RDFaProcessor.PlainLiteralURI;
|
|
677
|
+
content = contentAtt.value;
|
|
678
|
+
} else if (datetimeAtt) {
|
|
679
|
+
content = datetimeAtt.value;
|
|
680
|
+
datatype = RDFaProcessor.deriveDateTimeType(content);
|
|
684
681
|
if (!datatype) {
|
|
685
682
|
datatype = RDFaProcessor.PlainLiteralURI;
|
|
686
683
|
}
|
|
684
|
+
} else if (!relAtt && !revAtt) {
|
|
685
|
+
if (resourceAtt) {
|
|
686
|
+
content = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);
|
|
687
|
+
}
|
|
688
|
+
if (!content && hrefAtt) {
|
|
689
|
+
content = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));
|
|
690
|
+
} else if (!content && srcAtt) {
|
|
691
|
+
content = this.resolveAndNormalize(base, encodeURI(srcAtt.value));
|
|
692
|
+
}
|
|
693
|
+
if (content) {
|
|
694
|
+
datatype = RDFaProcessor.objectURI;
|
|
695
|
+
}
|
|
687
696
|
}
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
if (predicate) {
|
|
693
|
-
if (inlistAtt) {
|
|
694
|
-
let list = listMapping[predicate];
|
|
695
|
-
if (!list) {
|
|
696
|
-
list = [];
|
|
697
|
-
listMapping[predicate] = list;
|
|
698
|
-
}
|
|
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
|
-
});
|
|
697
|
+
if (!datatype) {
|
|
698
|
+
if (typeofAtt && !aboutAtt) {
|
|
699
|
+
datatype = RDFaProcessor.objectURI;
|
|
700
|
+
content = typedResource;
|
|
707
701
|
} else {
|
|
708
|
-
|
|
709
|
-
|
|
702
|
+
content = current.textContent;
|
|
703
|
+
if (this.inHTMLMode && current.localName === 'time') {
|
|
704
|
+
datatype = RDFaProcessor.deriveDateTimeType(content);
|
|
705
|
+
}
|
|
706
|
+
if (!datatype) {
|
|
707
|
+
datatype = RDFaProcessor.PlainLiteralURI;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
values = this.tokenize(propertyAtt.value);
|
|
712
|
+
for (var _i13 = 0; _i13 < values.length; _i13++) {
|
|
713
|
+
var _predicate2 = this.parsePredicate(values[_i13], vocabulary, context.terms, prefixes, base);
|
|
714
|
+
if (_predicate2) {
|
|
715
|
+
if (inlistAtt) {
|
|
716
|
+
var _list3 = listMapping[_predicate2];
|
|
717
|
+
if (!_list3) {
|
|
718
|
+
_list3 = [];
|
|
719
|
+
listMapping[_predicate2] = _list3;
|
|
720
|
+
}
|
|
721
|
+
_list3.push(datatype === RDFaProcessor.XMLLiteralURI || datatype === RDFaProcessor.HTMLLiteralURI ? {
|
|
710
722
|
type: datatype,
|
|
711
723
|
value: current.childNodes
|
|
712
|
-
}
|
|
713
|
-
} else {
|
|
714
|
-
this.addTriple(current, newSubject, predicate, {
|
|
724
|
+
} : {
|
|
715
725
|
type: datatype || RDFaProcessor.PlainLiteralURI,
|
|
716
726
|
value: content,
|
|
717
727
|
language: language
|
|
718
728
|
});
|
|
719
|
-
|
|
729
|
+
} else {
|
|
730
|
+
if (datatype === RDFaProcessor.XMLLiteralURI || datatype === RDFaProcessor.HTMLLiteralURI) {
|
|
731
|
+
this.addTriple(current, newSubject, _predicate2, {
|
|
732
|
+
type: datatype,
|
|
733
|
+
value: current.childNodes
|
|
734
|
+
});
|
|
735
|
+
} else {
|
|
736
|
+
this.addTriple(current, newSubject, _predicate2, {
|
|
737
|
+
type: datatype || RDFaProcessor.PlainLiteralURI,
|
|
738
|
+
value: content,
|
|
739
|
+
language: language
|
|
740
|
+
});
|
|
741
|
+
// console.log(newSubject+" "+predicate+"="+content)
|
|
742
|
+
}
|
|
720
743
|
}
|
|
721
744
|
}
|
|
722
745
|
}
|
|
723
746
|
}
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
})
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
}
|
|
747
|
+
// Sequence Step 12: complete incomplete triples with new subject
|
|
748
|
+
if (newSubject && !skip) {
|
|
749
|
+
for (var _i14 = 0; _i14 < context.incomplete.length; _i14++) {
|
|
750
|
+
if (context.incomplete[_i14].list) {
|
|
751
|
+
// console.log("Adding subject "+newSubject+" to list for "+context.incomplete[i].predicate)
|
|
752
|
+
// TODO: it is unclear what to do here
|
|
753
|
+
context.incomplete[_i14].list.push({
|
|
754
|
+
type: RDFaProcessor.objectURI,
|
|
755
|
+
value: newSubject
|
|
756
|
+
});
|
|
757
|
+
} else if (context.incomplete[_i14].forward) {
|
|
758
|
+
// console.log(current.tagName+": completing forward triple "+context.incomplete[i].predicate+" with object="+newSubject)
|
|
759
|
+
this.addTriple(current, context.subject, context.incomplete[_i14].predicate, {
|
|
760
|
+
type: RDFaProcessor.objectURI,
|
|
761
|
+
value: newSubject
|
|
762
|
+
});
|
|
763
|
+
} else {
|
|
764
|
+
// console.log(current.tagName+": completing reverse triple with object="+context.subject)
|
|
765
|
+
this.addTriple(current, newSubject, context.incomplete[_i14].predicate, {
|
|
766
|
+
type: RDFaProcessor.objectURI,
|
|
767
|
+
value: context.subject
|
|
768
|
+
});
|
|
769
|
+
}
|
|
747
770
|
}
|
|
748
771
|
}
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
+
var childContext = null;
|
|
773
|
+
var listSubject = newSubject;
|
|
774
|
+
if (skip) {
|
|
775
|
+
// TODO: should subject be null?
|
|
776
|
+
childContext = this.push(context, context.subject);
|
|
777
|
+
// TODO: should the entObject be passed along? If not, then intermediary children will keep properties from being associated with incomplete triples.
|
|
778
|
+
// TODO: Verify: if the current baseURI has changed and the parentObject is the parent's base URI, then the baseURI should change
|
|
779
|
+
childContext.parentObject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;
|
|
780
|
+
childContext.incomplete = context.incomplete;
|
|
781
|
+
childContext.language = language;
|
|
782
|
+
childContext.prefixes = prefixes;
|
|
783
|
+
childContext.vocabulary = vocabulary;
|
|
784
|
+
} else {
|
|
785
|
+
childContext = this.push(context, newSubject);
|
|
786
|
+
childContext.parentObject = currentObjectResource || newSubject || context.subject;
|
|
787
|
+
childContext.prefixes = prefixes;
|
|
788
|
+
childContext.incomplete = incomplete;
|
|
789
|
+
if (currentObjectResource) {
|
|
790
|
+
// console.log("Generating new list mapping for "+currentObjectResource)
|
|
791
|
+
listSubject = currentObjectResource;
|
|
792
|
+
listMapping = {};
|
|
793
|
+
listMappingDifferent = true;
|
|
794
|
+
}
|
|
795
|
+
childContext.listMapping = listMapping;
|
|
796
|
+
childContext.language = language;
|
|
797
|
+
childContext.vocabulary = vocabulary;
|
|
772
798
|
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
childContext.vocabulary = vocabulary;
|
|
776
|
-
}
|
|
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
|
|
799
|
+
if (listMappingDifferent) {
|
|
800
|
+
// console.log("Pushing list parent "+current.localName)
|
|
790
801
|
queue.unshift({
|
|
791
|
-
|
|
792
|
-
context:
|
|
802
|
+
parent: current,
|
|
803
|
+
context: context,
|
|
804
|
+
subject: listSubject,
|
|
805
|
+
listMapping: listMapping
|
|
793
806
|
});
|
|
794
807
|
}
|
|
808
|
+
for (var child = current.lastChild; child; child = child.previousSibling) {
|
|
809
|
+
if (child.nodeType === Node.ELEMENT_NODE) {
|
|
810
|
+
// console.log("Pushing child "+child.localName)
|
|
811
|
+
// child.baseURI = current.baseURI
|
|
812
|
+
queue.unshift({
|
|
813
|
+
current: child,
|
|
814
|
+
context: childContext
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
if (this.inHTMLMode) {
|
|
820
|
+
this.copyProperties();
|
|
821
|
+
}
|
|
822
|
+
for (var _i15 = 0; _i15 < this.finishedHandlers.length; _i15++) {
|
|
823
|
+
this.finishedHandlers[_i15](node);
|
|
795
824
|
}
|
|
796
825
|
}
|
|
797
|
-
|
|
798
|
-
|
|
826
|
+
}, {
|
|
827
|
+
key: "push",
|
|
828
|
+
value: function push(parent, subject) {
|
|
829
|
+
return {
|
|
830
|
+
parent: parent,
|
|
831
|
+
subject: subject || (parent ? parent.subject : null),
|
|
832
|
+
parentObject: null,
|
|
833
|
+
incomplete: [],
|
|
834
|
+
listMapping: parent ? parent.listMapping : {},
|
|
835
|
+
language: parent ? parent.language : this.language,
|
|
836
|
+
prefixes: parent ? parent.prefixes : this.target.graph.prefixes,
|
|
837
|
+
terms: parent ? parent.terms : this.target.graph.terms,
|
|
838
|
+
vocabulary: parent ? parent.vocabulary : this.vocabulary
|
|
839
|
+
};
|
|
799
840
|
}
|
|
800
|
-
|
|
801
|
-
|
|
841
|
+
}, {
|
|
842
|
+
key: "resolveAndNormalize",
|
|
843
|
+
value: function resolveAndNormalize(base, uri) {
|
|
844
|
+
// console.log("Joining " + uri + " to " + base + " making " + Uri.join(uri, base))
|
|
845
|
+
return Uri.join(uri, base); // @@ normalize?
|
|
802
846
|
}
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
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();
|
|
847
|
+
}, {
|
|
848
|
+
key: "setContext",
|
|
849
|
+
value: function setContext(node) {
|
|
850
|
+
// We only recognized XHTML+RDFa 1.1 if the version is set propertyly
|
|
851
|
+
if (node.localName === 'html' && node.getAttribute('version') === 'XHTML+RDFa 1.1') {
|
|
852
|
+
this.setXHTMLContext();
|
|
853
|
+
} else if (node.localName === 'html' || node.namespaceURI === 'http://www.w3.org/1999/xhtml') {
|
|
854
|
+
if (typeof document !== 'undefined' && document.doctype) {
|
|
855
|
+
if (document.doctype.publicId === '-//W3C//DTD XHTML+RDFa 1.0//EN' && document.doctype.systemId === 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd') {
|
|
856
|
+
console.log('WARNING: RDF 1.0 is not supported. Defaulting to HTML5 mode.');
|
|
857
|
+
this.setHTMLContext();
|
|
858
|
+
} 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') {
|
|
859
|
+
this.setXHTMLContext();
|
|
860
|
+
} else {
|
|
861
|
+
this.setHTMLContext();
|
|
862
|
+
}
|
|
833
863
|
} else {
|
|
834
864
|
this.setHTMLContext();
|
|
835
865
|
}
|
|
836
866
|
} else {
|
|
837
|
-
this.
|
|
867
|
+
this.setXMLContext();
|
|
838
868
|
}
|
|
839
|
-
} else {
|
|
840
|
-
this.setXMLContext();
|
|
841
869
|
}
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
870
|
+
}, {
|
|
871
|
+
key: "setHTMLContext",
|
|
872
|
+
value: function setHTMLContext() {
|
|
873
|
+
this.setInitialContext();
|
|
874
|
+
this.langAttributes = [{
|
|
875
|
+
namespaceURI: 'http://www.w3.org/XML/1998/namespace',
|
|
876
|
+
localName: 'lang'
|
|
877
|
+
}, {
|
|
878
|
+
namespaceURI: null,
|
|
879
|
+
localName: 'lang'
|
|
880
|
+
}];
|
|
881
|
+
this.inXHTMLMode = false;
|
|
882
|
+
this.inHTMLMode = true;
|
|
883
|
+
}
|
|
884
|
+
}, {
|
|
885
|
+
key: "setInitialContext",
|
|
886
|
+
value: function setInitialContext() {
|
|
887
|
+
this.vocabulary = null;
|
|
888
|
+
// By default, the prefixes are terms are loaded to the RDFa 1.1. standard within the graph constructor
|
|
889
|
+
this.langAttributes = [{
|
|
890
|
+
namespaceURI: 'http://www.w3.org/XML/1998/namespace',
|
|
891
|
+
localName: 'lang'
|
|
892
|
+
}];
|
|
893
|
+
}
|
|
894
|
+
}, {
|
|
895
|
+
key: "setXHTMLContext",
|
|
896
|
+
value: function setXHTMLContext() {
|
|
897
|
+
this.setInitialContext();
|
|
898
|
+
this.inXHTMLMode = true;
|
|
899
|
+
this.inHTMLMode = false;
|
|
900
|
+
this.langAttributes = [{
|
|
901
|
+
namespaceURI: 'http://www.w3.org/XML/1998/namespace',
|
|
902
|
+
localName: 'lang'
|
|
903
|
+
}, {
|
|
904
|
+
namespaceURI: null,
|
|
905
|
+
localName: 'lang'
|
|
906
|
+
}];
|
|
907
|
+
// From http://www.w3.org/2011/rdfa-context/xhtml-rdfa-1.1
|
|
908
|
+
this.target.graph.terms['alternate'] = 'http://www.w3.org/1999/xhtml/vocab#alternate';
|
|
909
|
+
this.target.graph.terms['appendix'] = 'http://www.w3.org/1999/xhtml/vocab#appendix';
|
|
910
|
+
this.target.graph.terms['bookmark'] = 'http://www.w3.org/1999/xhtml/vocab#bookmark';
|
|
911
|
+
this.target.graph.terms['cite'] = 'http://www.w3.org/1999/xhtml/vocab#cite';
|
|
912
|
+
this.target.graph.terms['chapter'] = 'http://www.w3.org/1999/xhtml/vocab#chapter';
|
|
913
|
+
this.target.graph.terms['contents'] = 'http://www.w3.org/1999/xhtml/vocab#contents';
|
|
914
|
+
this.target.graph.terms['copyright'] = 'http://www.w3.org/1999/xhtml/vocab#copyright';
|
|
915
|
+
this.target.graph.terms['first'] = 'http://www.w3.org/1999/xhtml/vocab#first';
|
|
916
|
+
this.target.graph.terms['glossary'] = 'http://www.w3.org/1999/xhtml/vocab#glossary';
|
|
917
|
+
this.target.graph.terms['help'] = 'http://www.w3.org/1999/xhtml/vocab#help';
|
|
918
|
+
this.target.graph.terms['icon'] = 'http://www.w3.org/1999/xhtml/vocab#icon';
|
|
919
|
+
this.target.graph.terms['index'] = 'http://www.w3.org/1999/xhtml/vocab#index';
|
|
920
|
+
this.target.graph.terms['last'] = 'http://www.w3.org/1999/xhtml/vocab#last';
|
|
921
|
+
this.target.graph.terms['license'] = 'http://www.w3.org/1999/xhtml/vocab#license';
|
|
922
|
+
this.target.graph.terms['meta'] = 'http://www.w3.org/1999/xhtml/vocab#meta';
|
|
923
|
+
this.target.graph.terms['next'] = 'http://www.w3.org/1999/xhtml/vocab#next';
|
|
924
|
+
this.target.graph.terms['prev'] = 'http://www.w3.org/1999/xhtml/vocab#prev';
|
|
925
|
+
this.target.graph.terms['previous'] = 'http://www.w3.org/1999/xhtml/vocab#previous';
|
|
926
|
+
this.target.graph.terms['section'] = 'http://www.w3.org/1999/xhtml/vocab#section';
|
|
927
|
+
this.target.graph.terms['stylesheet'] = 'http://www.w3.org/1999/xhtml/vocab#stylesheet';
|
|
928
|
+
this.target.graph.terms['subsection'] = 'http://www.w3.org/1999/xhtml/vocab#subsection';
|
|
929
|
+
this.target.graph.terms['start'] = 'http://www.w3.org/1999/xhtml/vocab#start';
|
|
930
|
+
this.target.graph.terms['top'] = 'http://www.w3.org/1999/xhtml/vocab#top';
|
|
931
|
+
this.target.graph.terms['up'] = 'http://www.w3.org/1999/xhtml/vocab#up';
|
|
932
|
+
this.target.graph.terms['p3pv1'] = 'http://www.w3.org/1999/xhtml/vocab#p3pv1';
|
|
933
|
+
// other
|
|
934
|
+
this.target.graph.terms['related'] = 'http://www.w3.org/1999/xhtml/vocab#related';
|
|
935
|
+
this.target.graph.terms['role'] = 'http://www.w3.org/1999/xhtml/vocab#role';
|
|
936
|
+
this.target.graph.terms['transformation'] = 'http://www.w3.org/1999/xhtml/vocab#transformation';
|
|
937
|
+
}
|
|
938
|
+
}, {
|
|
939
|
+
key: "setXMLContext",
|
|
940
|
+
value: function setXMLContext() {
|
|
941
|
+
this.setInitialContext();
|
|
942
|
+
this.inXHTMLMode = false;
|
|
943
|
+
this.inHTMLMode = false;
|
|
944
|
+
}
|
|
945
|
+
}, {
|
|
946
|
+
key: "tokenize",
|
|
947
|
+
value: function tokenize(str) {
|
|
948
|
+
return this.trim(str).split(/\s+/);
|
|
949
|
+
}
|
|
950
|
+
}, {
|
|
951
|
+
key: "toRDFNodeObject",
|
|
952
|
+
value: function toRDFNodeObject(x) {
|
|
953
|
+
var _this = this;
|
|
954
|
+
if (typeof x === 'undefined') return undefined;
|
|
955
|
+
if (typeof x === 'string') {
|
|
956
|
+
if (x.substring(0, 2) === '_:') {
|
|
957
|
+
if (typeof this.blankNodes[x.substring(2)] === 'undefined') {
|
|
958
|
+
this.blankNodes[x.substring(2)] = new BlankNode(x.substring(2));
|
|
959
|
+
}
|
|
960
|
+
return this.blankNodes[x.substring(2)];
|
|
961
|
+
}
|
|
962
|
+
return rdf.namedNode(x);
|
|
963
|
+
}
|
|
964
|
+
switch (x.type) {
|
|
965
|
+
case RDFaProcessor.objectURI:
|
|
966
|
+
if (x.value.substring(0, 2) === '_:') {
|
|
967
|
+
if (typeof this.blankNodes[x.value.substring(2)] === 'undefined') {
|
|
968
|
+
this.blankNodes[x.value.substring(2)] = new BlankNode(x.value.substring(2));
|
|
969
|
+
}
|
|
970
|
+
return this.blankNodes[x.value.substring(2)];
|
|
971
|
+
}
|
|
972
|
+
return rdf.namedNode(x.value);
|
|
973
|
+
case RDFaProcessor.PlainLiteralURI:
|
|
974
|
+
return new Literal(x.value, x.language || '');
|
|
975
|
+
case RDFaProcessor.XMLLiteralURI:
|
|
976
|
+
case RDFaProcessor.HTMLLiteralURI:
|
|
977
|
+
var string = '';
|
|
978
|
+
Object.keys(x.value).forEach(function (i) {
|
|
979
|
+
string += Util.domToString(x.value[i], _this.htmlOptions);
|
|
980
|
+
});
|
|
981
|
+
return new Literal(string, '', new NamedNode(x.type));
|
|
982
|
+
default:
|
|
983
|
+
return new Literal(x.value, '', new NamedNode(x.type));
|
|
924
984
|
}
|
|
925
|
-
return rdf.namedNode(x);
|
|
926
985
|
}
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
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));
|
|
986
|
+
}, {
|
|
987
|
+
key: "trim",
|
|
988
|
+
value: function trim(str) {
|
|
989
|
+
return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
|
|
947
990
|
}
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
991
|
+
}], [{
|
|
992
|
+
key: "parseRDFaDOM",
|
|
993
|
+
value: function parseRDFaDOM(dom, kb, base) {
|
|
994
|
+
var p = new RDFaProcessor(kb, {
|
|
995
|
+
'base': base
|
|
996
|
+
});
|
|
997
|
+
// Cannot assign to read only property 'baseURI' of object '#<XMLDocument>':
|
|
998
|
+
if (!dom.baseURI) {
|
|
999
|
+
// Note this became a read-only attribute some time before 2018
|
|
1000
|
+
dom.baseURI = base; // oinly set if not already set
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
p.process(dom, {
|
|
1004
|
+
baseURI: base
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
}, {
|
|
1008
|
+
key: "tokenize",
|
|
1009
|
+
value: function tokenize(str) {
|
|
1010
|
+
return this.trim(str).split(/\s+/);
|
|
1011
|
+
}
|
|
1012
|
+
}, {
|
|
1013
|
+
key: "trim",
|
|
1014
|
+
value: function trim(str) {
|
|
1015
|
+
return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
|
|
1016
|
+
}
|
|
1017
|
+
}]);
|
|
1018
|
+
return RDFaProcessor;
|
|
1019
|
+
}();
|
|
1020
|
+
export { RDFaProcessor as default };
|
|
956
1021
|
RDFaProcessor.XMLLiteralURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral';
|
|
957
1022
|
RDFaProcessor.HTMLLiteralURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML';
|
|
958
1023
|
RDFaProcessor.PlainLiteralURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral';
|
|
959
1024
|
RDFaProcessor.objectURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#object';
|
|
960
1025
|
RDFaProcessor.typeURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type';
|
|
961
|
-
RDFaProcessor.nameChar =
|
|
962
|
-
RDFaProcessor.nameStartChar =
|
|
1026
|
+
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]";
|
|
1027
|
+
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_]";
|
|
963
1028
|
RDFaProcessor.NCNAME = new RegExp('^' + RDFaProcessor.nameStartChar + RDFaProcessor.nameChar + '*$');
|
|
964
1029
|
|
|
965
1030
|
/*
|
|
@@ -990,5 +1055,5 @@ RDFaProcessor.dateTimeTypes = [{
|
|
|
990
1055
|
pattern: /-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,
|
|
991
1056
|
type: 'http://www.w3.org/2001/XMLSchema#gYear'
|
|
992
1057
|
}];
|
|
993
|
-
|
|
1058
|
+
var parseRDFaDOM = RDFaProcessor.parseRDFaDOM;
|
|
994
1059
|
export { parseRDFaDOM };
|