rdflib 2.3.0-ab7e9999 → 2.3.0

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/esm/n3parser.js CHANGED
@@ -674,11 +674,6 @@ export class SinkParser {
674
674
  if (j < 0) {
675
675
  throw BadSyntax(this._thisDoc, this.lines, str, i, "EOF when ']' expected after [ <propertyList>");
676
676
  }
677
- if (str.slice(j, j + 1) == ".") {
678
- // If a dot is found after a blank node, treat it as statement terminator
679
- res.push(subj);
680
- return j;
681
- }
682
677
  if (str.slice(j, j + 1) != "]") {
683
678
  throw BadSyntax(this._thisDoc, this.lines, str, j, "']' expected");
684
679
  }
@@ -1127,19 +1122,7 @@ export class SinkParser {
1127
1122
  return -1;
1128
1123
  }
1129
1124
  var i = j;
1130
- while (i < pyjslib_len(str)) {
1131
- var c = str.charAt(i);
1132
- // Allow dot in names unless it is followed by whitespace/comment/EOF
1133
- if (c === '.') {
1134
- var next = str.charAt(i + 1);
1135
- if (next === '' || /[\s#]/.test(next)) {
1136
- break; // treat as statement terminator, not part of name
1137
- }
1138
- // else: accept '.' as part of name
1139
- } else if (_notNameChars.indexOf(c) >= 0) {
1140
- // Other invalid characters terminate the name
1141
- break;
1142
- }
1125
+ while (i < pyjslib_len(str) && _notNameChars.indexOf(str.charAt(i)) < 0) {
1143
1126
  var i = i + 1;
1144
1127
  }
1145
1128
  res.push(str.slice(j, i));
@@ -1165,17 +1148,12 @@ export class SinkParser {
1165
1148
  var i = i + 1;
1166
1149
  while (i < pyjslib_len(str)) {
1167
1150
  var c = str.charAt(i);
1168
- // Allow dot unless followed by whitespace/comment/EOF; otherwise break on invalid chars
1169
- if (c === '.') {
1170
- var next = str.charAt(i + 1);
1171
- if (next === '' || /[\s#]/.test(next)) {
1172
- break; // dot ends the name here
1173
- }
1174
- } else if (_notNameChars.indexOf(c) >= 0) {
1151
+ if (_notNameChars.indexOf(c) < 0) {
1152
+ var ln = ln + c;
1153
+ var i = i + 1;
1154
+ } else {
1175
1155
  break;
1176
1156
  }
1177
- var ln = ln + c;
1178
- var i = i + 1;
1179
1157
  }
1180
1158
  } else {
1181
1159
  var ln = "";
@@ -1186,17 +1164,12 @@ export class SinkParser {
1186
1164
  var ln = "";
1187
1165
  while (i < pyjslib_len(str)) {
1188
1166
  var c = str.charAt(i);
1189
- // Allow dot unless followed by whitespace/comment/EOF; otherwise break on invalid chars
1190
- if (c === '.') {
1191
- var next = str.charAt(i + 1);
1192
- if (next === '' || /[\s#]/.test(next)) {
1193
- break; // dot ends the name here
1194
- }
1195
- } else if (_notNameChars.indexOf(c) >= 0) {
1167
+ if (_notNameChars.indexOf(c) < 0) {
1168
+ var ln = ln + c;
1169
+ var i = i + 1;
1170
+ } else {
1196
1171
  break;
1197
1172
  }
1198
- var ln = ln + c;
1199
- var i = i + 1;
1200
1173
  }
1201
1174
  res.push(new pyjslib_Tuple([pfx, ln]));
1202
1175
  return i;
package/esm/serializer.js CHANGED
@@ -21,7 +21,6 @@ export default function createSerializer(store) {
21
21
  export class Serializer {
22
22
  constructor(store) {
23
23
  _defineProperty(this, "_notQNameChars", '\t\r\n !"#$%&\'()*.,+/;<=>?@[\\]^`{|}~');
24
- // issue#228
25
24
  _defineProperty(this, "_notNameChars", this._notQNameChars + ':');
26
25
  // stringToN3: String escaping for N3
27
26
  _defineProperty(this, "validPrefix", new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/));
package/lib/n3parser.js CHANGED
@@ -682,11 +682,6 @@ class SinkParser {
682
682
  if (j < 0) {
683
683
  throw BadSyntax(this._thisDoc, this.lines, str, i, "EOF when ']' expected after [ <propertyList>");
684
684
  }
685
- if (str.slice(j, j + 1) == ".") {
686
- // If a dot is found after a blank node, treat it as statement terminator
687
- res.push(subj);
688
- return j;
689
- }
690
685
  if (str.slice(j, j + 1) != "]") {
691
686
  throw BadSyntax(this._thisDoc, this.lines, str, j, "']' expected");
692
687
  }
@@ -1135,19 +1130,7 @@ class SinkParser {
1135
1130
  return -1;
1136
1131
  }
1137
1132
  var i = j;
1138
- while (i < pyjslib_len(str)) {
1139
- var c = str.charAt(i);
1140
- // Allow dot in names unless it is followed by whitespace/comment/EOF
1141
- if (c === '.') {
1142
- var next = str.charAt(i + 1);
1143
- if (next === '' || /[\s#]/.test(next)) {
1144
- break; // treat as statement terminator, not part of name
1145
- }
1146
- // else: accept '.' as part of name
1147
- } else if (_notNameChars.indexOf(c) >= 0) {
1148
- // Other invalid characters terminate the name
1149
- break;
1150
- }
1133
+ while (i < pyjslib_len(str) && _notNameChars.indexOf(str.charAt(i)) < 0) {
1151
1134
  var i = i + 1;
1152
1135
  }
1153
1136
  res.push(str.slice(j, i));
@@ -1173,17 +1156,12 @@ class SinkParser {
1173
1156
  var i = i + 1;
1174
1157
  while (i < pyjslib_len(str)) {
1175
1158
  var c = str.charAt(i);
1176
- // Allow dot unless followed by whitespace/comment/EOF; otherwise break on invalid chars
1177
- if (c === '.') {
1178
- var next = str.charAt(i + 1);
1179
- if (next === '' || /[\s#]/.test(next)) {
1180
- break; // dot ends the name here
1181
- }
1182
- } else if (_notNameChars.indexOf(c) >= 0) {
1159
+ if (_notNameChars.indexOf(c) < 0) {
1160
+ var ln = ln + c;
1161
+ var i = i + 1;
1162
+ } else {
1183
1163
  break;
1184
1164
  }
1185
- var ln = ln + c;
1186
- var i = i + 1;
1187
1165
  }
1188
1166
  } else {
1189
1167
  var ln = "";
@@ -1194,17 +1172,12 @@ class SinkParser {
1194
1172
  var ln = "";
1195
1173
  while (i < pyjslib_len(str)) {
1196
1174
  var c = str.charAt(i);
1197
- // Allow dot unless followed by whitespace/comment/EOF; otherwise break on invalid chars
1198
- if (c === '.') {
1199
- var next = str.charAt(i + 1);
1200
- if (next === '' || /[\s#]/.test(next)) {
1201
- break; // dot ends the name here
1202
- }
1203
- } else if (_notNameChars.indexOf(c) >= 0) {
1175
+ if (_notNameChars.indexOf(c) < 0) {
1176
+ var ln = ln + c;
1177
+ var i = i + 1;
1178
+ } else {
1204
1179
  break;
1205
1180
  }
1206
- var ln = ln + c;
1207
- var i = i + 1;
1208
1181
  }
1209
1182
  res.push(new pyjslib_Tuple([pfx, ln]));
1210
1183
  return i;
package/lib/serializer.js CHANGED
@@ -31,7 +31,6 @@ function createSerializer(store) {
31
31
  class Serializer {
32
32
  constructor(store) {
33
33
  (0, _defineProperty2.default)(this, "_notQNameChars", '\t\r\n !"#$%&\'()*.,+/;<=>?@[\\]^`{|}~');
34
- // issue#228
35
34
  (0, _defineProperty2.default)(this, "_notNameChars", this._notQNameChars + ':');
36
35
  // stringToN3: String escaping for N3
37
36
  (0, _defineProperty2.default)(this, "validPrefix", new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rdflib",
3
3
  "description": "an RDF library for node.js. Suitable for client and server side.",
4
- "version": "2.3.0-ab7e9999",
4
+ "version": "2.3.0",
5
5
  "private": false,
6
6
  "browserslist": [
7
7
  "> 0.5%"
package/src/n3parser.js CHANGED
@@ -554,7 +554,7 @@ export class SinkParser {
554
554
  <- prop -<
555
555
  _operator_*/
556
556
 
557
- var j = this.skipSpace(str, i);
557
+ var j = this.skipSpace(str, i);
558
558
  if ((j < 0)) {
559
559
  return j;
560
560
  }
@@ -703,17 +703,22 @@ export class SinkParser {
703
703
  if ((j >= 0)) {
704
704
  var subj = objs[0];
705
705
  if ((pyjslib_len(objs) > 1)) {
706
+
706
707
  var __obj = new pyjslib_Iterator(objs);
707
708
  try {
708
709
  while (true) {
709
710
  var obj = __obj.next();
711
+
712
+
710
713
  this.makeStatement(new pyjslib_Tuple([this._context, this._store.sym(DAML_sameAs_URI), subj, obj]));
714
+
711
715
  }
712
716
  } catch (e) {
713
717
  if (e != StopIteration) {
714
718
  throw e;
715
719
  }
716
720
  }
721
+
717
722
  }
718
723
  var j = this.skipSpace(str, j);
719
724
  if ((j < 0)) {
@@ -738,11 +743,6 @@ export class SinkParser {
738
743
  if ((j < 0)) {
739
744
  throw BadSyntax(this._thisDoc, this.lines, str, i, "EOF when ']' expected after [ <propertyList>");
740
745
  }
741
- if ((str.slice( j, ( j + 1 ) ) == ".")) {
742
- // If a dot is found after a blank node, treat it as statement terminator
743
- res.push(subj);
744
- return j;
745
- }
746
746
  if ((str.slice( j, ( j + 1 ) ) != "]")) {
747
747
  throw BadSyntax(this._thisDoc, this.lines, str, j, "']' expected");
748
748
  }
@@ -1208,19 +1208,7 @@ export class SinkParser {
1208
1208
  return -1;
1209
1209
  }
1210
1210
  var i = j;
1211
- while ((i < pyjslib_len(str))) {
1212
- var c = str.charAt(i);
1213
- // Allow dot in names unless it is followed by whitespace/comment/EOF
1214
- if (c === '.') {
1215
- var next = str.charAt(i + 1);
1216
- if (next === '' || /[\s#]/.test(next)) {
1217
- break; // treat as statement terminator, not part of name
1218
- }
1219
- // else: accept '.' as part of name
1220
- } else if (_notNameChars.indexOf(c) >= 0) {
1221
- // Other invalid characters terminate the name
1222
- break;
1223
- }
1211
+ while ((i < pyjslib_len(str)) && (_notNameChars.indexOf(str.charAt(i)) < 0)) {
1224
1212
  var i = ( i + 1 ) ;
1225
1213
  }
1226
1214
  res.push(str.slice( j, i));
@@ -1247,17 +1235,13 @@ export class SinkParser {
1247
1235
  var i = ( i + 1 ) ;
1248
1236
  while ((i < pyjslib_len(str))) {
1249
1237
  var c = str.charAt(i);
1250
- // Allow dot unless followed by whitespace/comment/EOF; otherwise break on invalid chars
1251
- if (c === '.') {
1252
- var next = str.charAt(i + 1);
1253
- if (next === '' || /[\s#]/.test(next)) {
1254
- break; // dot ends the name here
1255
- }
1256
- } else if (_notNameChars.indexOf(c) >= 0) {
1238
+ if ((_notNameChars.indexOf(c) < 0)) {
1239
+ var ln = ( ln + c ) ;
1240
+ var i = ( i + 1 ) ;
1241
+ }
1242
+ else {
1257
1243
  break;
1258
1244
  }
1259
- var ln = ( ln + c ) ;
1260
- var i = ( i + 1 ) ;
1261
1245
  }
1262
1246
  }
1263
1247
  else {
@@ -1269,17 +1253,13 @@ export class SinkParser {
1269
1253
  var ln = "";
1270
1254
  while ((i < pyjslib_len(str))) {
1271
1255
  var c = str.charAt(i);
1272
- // Allow dot unless followed by whitespace/comment/EOF; otherwise break on invalid chars
1273
- if (c === '.') {
1274
- var next = str.charAt(i + 1);
1275
- if (next === '' || /[\s#]/.test(next)) {
1276
- break; // dot ends the name here
1277
- }
1278
- } else if (_notNameChars.indexOf(c) >= 0) {
1256
+ if ((_notNameChars.indexOf(c) < 0)) {
1257
+ var ln = ( ln + c ) ;
1258
+ var i = ( i + 1 ) ;
1259
+ }
1260
+ else {
1279
1261
  break;
1280
1262
  }
1281
- var ln = ( ln + c ) ;
1282
- var i = ( i + 1 ) ;
1283
1263
  }
1284
1264
  res.push(new pyjslib_Tuple([pfx, ln]));
1285
1265
  return i;
package/src/serializer.js CHANGED
@@ -251,7 +251,7 @@ export class Serializer {
251
251
  return this.statementsToN3(f.statements)
252
252
  }
253
253
 
254
- _notQNameChars = '\t\r\n !"#$%&\'()*.,+/;<=>?@[\\]^`{|}~' // issue#228
254
+ _notQNameChars = '\t\r\n !"#$%&\'()*.,+/;<=>?@[\\]^`{|}~'
255
255
  _notNameChars =
256
256
  (this._notQNameChars + ':')
257
257