rdflib 2.3.1-233cf569 → 2.3.1-5f933d36

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/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.1-233cf569",
4
+ "version": "2.3.1-5f933d36",
5
5
  "private": false,
6
6
  "browserslist": [
7
7
  "> 0.5%"
@@ -44,49 +44,50 @@
44
44
  "homepage": "http://github.com/linkeddata/rdflib.js",
45
45
  "bugs": "http://github.com/linkeddata/rdflib.js/issues",
46
46
  "dependencies": {
47
- "@babel/runtime": "^7.26.9",
47
+ "@babel/runtime": "^7.28.4",
48
48
  "@frogcat/ttl2jsonld": "^0.0.10",
49
49
  "@rdfjs/types": "^2.0.1",
50
50
  "@xmldom/xmldom": "^0.8.10",
51
- "cross-fetch": "^3.2.0",
52
- "jsonld": "^8.3.3",
53
- "n3": "^1.23.1",
51
+ "cross-fetch": "^4.1.0",
52
+ "jsonld": "^9.0.0",
53
+ "n3": "^1.26.0",
54
54
  "solid-namespace": "^0.5.4"
55
55
  },
56
56
  "devDependencies": {
57
- "@babel/cli": "^7.26.4",
58
- "@babel/core": "^7.26.9",
57
+ "@babel/cli": "^7.28.3",
58
+ "@babel/core": "^7.28.5",
59
59
  "@babel/plugin-proposal-class-properties": "^7.18.6",
60
- "@babel/plugin-transform-runtime": "^7.26.9",
61
- "@babel/preset-env": "^7.26.9",
62
- "@babel/preset-typescript": "^7.26.0",
63
- "@babel/register": "^7.25.9",
60
+ "@babel/plugin-transform-runtime": "^7.28.5",
61
+ "@babel/preset-env": "^7.28.5",
62
+ "@babel/preset-typescript": "^7.28.5",
63
+ "@babel/register": "^7.28.3",
64
64
  "@types/chai": "^4.3.20",
65
65
  "@types/dirty-chai": "^2.0.5",
66
- "@types/express": "^4.17.21",
66
+ "@types/express": "^4.17.25",
67
67
  "@types/jsonld": "^1.5.15",
68
68
  "@types/mocha": "^10.0.10",
69
69
  "@types/sinon-chai": "^3.2.12",
70
- "babel-loader": "^9.2.1",
70
+ "babel-loader": "^10.0.0",
71
71
  "chai": "^4.5.0",
72
- "diff": "^5.2.0",
72
+ "colors": "^1.4.0",
73
+ "diff": "^8.0.2",
73
74
  "dirty-chai": "^2.0.1",
74
- "eslint": "^9.20.1",
75
- "fs-grep": "0.0.5",
76
- "locate-path": "^7.2.0",
77
- "mocha": "^10.8.2",
75
+ "eslint": "^9.39.1",
76
+ "locate-path": "^8.0.0",
77
+ "mocha": "^11.7.5",
78
78
  "nock": "^13.5.6",
79
79
  "node-fetch": "^3.3.2",
80
- "node-polyfill-webpack-plugin": "^2.0.1",
81
- "sinon": "^15.2.0",
80
+ "node-polyfill-webpack-plugin": "^4.1.0",
81
+ "rimraf": "^6.1.2",
82
+ "sinon": "^21.0.0",
82
83
  "sinon-chai": "^3.7.0",
83
- "source-map-loader": "^4.0.2",
84
+ "source-map-loader": "^5.0.0",
84
85
  "ts-node": "^10.9.2",
85
- "typedoc": "^0.25.13",
86
+ "typedoc": "^0.28.15",
86
87
  "typescript": "^5.0.4",
87
- "webpack": "^5.98.0",
88
- "webpack-cli": "^5.1.4",
89
- "webpack-dev-server": "^4.15.2"
88
+ "webpack": "^5.103.0",
89
+ "webpack-cli": "^6.0.1",
90
+ "webpack-dev-server": "^5.2.2"
90
91
  },
91
92
  "scripts": {
92
93
  "build": "babel src --extensions \".ts,.js\" -d lib",
@@ -101,8 +102,8 @@
101
102
  "test": "npm run test:unit && npm run test:serialize && npm run test:types",
102
103
  "test:clean": "rimraf tests/serialize/,*",
103
104
  "test:serialize": "npm run build && npm run test:serialize:all && npm run test:clean",
104
- "test:serialize:all": "npm run test:serialize:1 && npm run test:serialize:2 && npm run test:serialize:3 && npm run test:serialize:4 && npm run test:serialize:5 && npm run test:serialize:6 && npm run test:serialize:7 && npm run test:serialize:8 && npm run test:serialize:10 && npm run test:serialize:11 && npm run test:serialize:12 && npm run test:serialize:13 && npm run test:serialize:14 && npm run test:serialize:15",
105
- "test:serialize:1": "cd ./tests/serialize && node ./data.js -in=t1.ttl -format=application/rdf+xml -out=,t1.xml && fs-grep http://www.w3.org/2001/XMLSchema#integer ,t1.xml",
105
+ "test:serialize:all": "npm run test:serialize:1 && npm run test:serialize:2 && npm run test:serialize:3 && npm run test:serialize:4 && npm run test:serialize:5 && npm run test:serialize:6 && npm run test:serialize:7 && npm run test:serialize:8 && npm run test:serialize:10 && npm run test:serialize:11 && npm run test:serialize:12 && npm run test:serialize:13 && npm run test:serialize:14 && npm run test:serialize:15 && npm run test:serialize:16 && npm run test:serialize:17 && npm run test:serialize:18",
106
+ "test:serialize:1": "cd ./tests/serialize && node ./data.js -in=t1.ttl -format=application/rdf+xml -out=,t1.xml && node diff ,t1.xml t1-ref.xml",
106
107
  "test:serialize:2": "cd ./tests/serialize && node ./data.js -in=t2.ttl -format=application/rdf+xml -out=,t2.xml && node diff ,t2.xml t2-ref.xml",
107
108
  "test:serialize:3": "cd ./tests/serialize && node ./data.js -in=t3.ttl -format=application/rdf+xml -out=,t3.xml && node diff ,t3.xml t3-ref.xml",
108
109
  "test:serialize:4": "cd ./tests/serialize && node ./data.js -in=t3.ttl -out=,t4.ttl && node diff ,t4.ttl t4-ref.ttl",
@@ -117,7 +118,8 @@
117
118
  "test:serialize:14": "cd ./tests/serialize && node ./data.js -in=t14.html -format=text/turtle -out=,t14.ttl && node diff ,t14.ttl t14-ref.ttl",
118
119
  "test:serialize:15": "cd ./tests/serialize && node ./data.js -in=t15.html -format=text/turtle -out=,t15.ttl && node diff ,t15.ttl t15-ref.ttl",
119
120
  "test:serialize:16": "cd ./tests/serialize && node ./data.js -in=t1.ttl -format=application/ld+json -out=,t1.jsonld && node diff ,t1.jsonld t16-ref.jsonld",
120
- "test:serialize:17": "cd ./tests/serialize && node ./data.js -in=t17.ttl -format=application/rdf+xml -out=,t17.xml && node diff ,t17.xml t17-ref.xml",
121
+ "test:serialize:17": "cd ./tests/serialize && node ./data.js -in=t17.ttl -format=application/rdf+xml -out=,t17.xml && node diff ,t17.xml t17-ref.xml",
122
+ "test:serialize:18": "cd ./tests/serialize && node ./data.js -in=t18.ttl -format=application/rdf+xml -out=,t18.xml && node diff ,t18.xml t18-ref.xml",
121
123
  "test:types": "tsc --noEmit --target es2019 --moduleResolution node tests/types/*.ts",
122
124
  "test:unit": "mocha --growl --require ./tests/babel-register.js tests/unit/**-test.*",
123
125
  "test:unit:egp": "mocha --require ./tests/babel-register.js tests/unit/fetcher-egp-test.js",
package/src/serializer.js CHANGED
@@ -5,14 +5,12 @@
5
5
  ** This is or was https://github.com/linkeddata/rdflib.js/blob/main/src/serializer.js
6
6
  ** Licence: MIT
7
7
  */
8
- import NamedNode from './named-node'
9
- import BlankNode from './blank-node'
8
+ import * as ttl2jsonld from '@frogcat/ttl2jsonld'
9
+ import solidNs from 'solid-namespace'
10
+ import CanonicalDataFactory from './factories/canonical-data-factory'
10
11
  import * as Uri from './uri'
11
12
  import * as Util from './utils-js'
12
- import CanonicalDataFactory from './factories/canonical-data-factory'
13
13
  import { createXSD } from './xsd'
14
- import solidNs from 'solid-namespace'
15
- import * as ttl2jsonld from '@frogcat/ttl2jsonld'
16
14
 
17
15
 
18
16
  export default function createSerializer(store) {
@@ -39,7 +37,7 @@ export class Serializer {
39
37
 
40
38
  this.namespacesUsed = [] // Count actually used and so needed in @prefixes
41
39
  this.keywords = ['a'] // The only one we generate at the moment
42
- this.prefixchars = 'abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
40
+ this.prefixchars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
43
41
  this.incoming = null // Array not calculated yet
44
42
  this.formulas = [] // remembering original formulae from hashes
45
43
  this.store = store
@@ -176,7 +174,7 @@ export class Serializer {
176
174
  if (slash >= 0) p = p.slice(slash + 1)
177
175
  var i = 0
178
176
  while (i < p.length) {
179
- if (this.prefixchars.indexOf(p[i])) {
177
+ if (this.prefixchars.indexOf(p[i]) >= 0) {
180
178
  i++
181
179
  } else {
182
180
  break
@@ -914,10 +912,10 @@ export class Serializer {
914
912
  break
915
913
  case 'Literal':
916
914
  results = results.concat(['<' + t +
917
- (st.object.datatype.equals(this.xsd.string)
918
- ? ''
919
- : ' rdf:datatype="' + escapeForXML(st.object.datatype.uri) + '"') +
920
- (st.object.language ? ' xml:lang="' + st.object.language + '"' : '') +
915
+ (st.object.language ? ' xml:lang="' + st.object.language + '"' :
916
+ (st.object.datatype.equals(this.xsd.string)
917
+ ? ''
918
+ : ' rdf:datatype="' + escapeForXML(st.object.datatype.uri) + '"')) +
921
919
  '>' + escapeForXML(st.object.value) +
922
920
  '</' + t + '>'])
923
921
  break
@@ -980,9 +978,10 @@ export class Serializer {
980
978
  break
981
979
  case 'Literal':
982
980
  results = results.concat(['<' + qname(st.predicate) +
983
- (st.object.datatype.equals(this.xsd.string) ? '' : ' rdf:datatype="' + escapeForXML(st.object.datatype.value) + '"') +
984
- (st.object.language ? ' xml:lang="' + st.object.language + '"' : '') +
985
- '>' + escapeForXML(st.object.value) +
981
+ (st.object.language ?
982
+ ' xml:lang="' + st.object.language + '"' :
983
+ (st.object.datatype.equals(this.xsd.string) ? '' : ' rdf:datatype="' + escapeForXML(st.object.datatype.value) + '"'))
984
+ + '>' + escapeForXML(st.object.value) +
986
985
  '</' + qname(st.predicate) + '>'])
987
986
  break
988
987
  case 'Collection':
@@ -1 +0,0 @@
1
- (self.webpackChunk$rdf=self.webpackChunk$rdf||[]).push([[789],{7789:()=>{}}]);