@vortex-rdf/vortex-rdf-store 0.1.0 → 0.2.1
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/README.md +5 -4
- package/entry/browser.d.ts +0 -3
- package/entry/browser.js +2 -4
- package/entry/node.d.ts +0 -3
- package/entry/node.js +2 -4
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# Vortex-RDF for JavaScript
|
|
2
|
+
[](https://www.npmjs.com/package/@vortex-rdf/vortex-rdf-store)
|
|
2
3
|
|
|
3
4
|
JavaScript bindings of [`vortex-rdf-core`](https://crates.io/crates/vortex-rdf-core) compiled via WebAssembly.
|
|
4
5
|
|
|
@@ -164,14 +165,14 @@ The default `{ builder: 'Unsorted', layout: 'Dictionary' }` already gives compac
|
|
|
164
165
|
For one-shot conversions without holding a store:
|
|
165
166
|
|
|
166
167
|
```javascript
|
|
167
|
-
import { rdf_to_vortex, vortex_to_rdf
|
|
168
|
+
import { rdf_to_vortex, vortex_to_rdf } from '@vortex-rdf/vortex-rdf-store';
|
|
168
169
|
|
|
169
170
|
const bytes = await rdf_to_vortex(turtleText, 'turtle', { builder: 'Sorted' });
|
|
170
171
|
const text = await vortex_to_rdf(bytes, 'nquads');
|
|
171
172
|
|
|
172
|
-
// N-Quads
|
|
173
|
-
const bytes2 = await
|
|
174
|
-
const text2 = await
|
|
173
|
+
// N-Quads is just another format
|
|
174
|
+
const bytes2 = await rdf_to_vortex(nquadsText, 'nquads');
|
|
175
|
+
const text2 = await vortex_to_rdf(bytes2, 'nquads');
|
|
175
176
|
```
|
|
176
177
|
|
|
177
178
|
### TypeScript support
|
package/entry/browser.d.ts
CHANGED
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
// Node entry (they differ only in how the wasm bytes are loaded at runtime).
|
|
3
3
|
export {
|
|
4
4
|
VortexRdfStore,
|
|
5
|
-
init_panic_hook,
|
|
6
5
|
rdf_to_vortex,
|
|
7
6
|
vortex_to_rdf,
|
|
8
|
-
nquads_to_vortex,
|
|
9
|
-
vortex_to_nquads,
|
|
10
7
|
} from '../pkg/web/vortex_rdf.js';
|
|
11
8
|
export type {
|
|
12
9
|
BuildOptions,
|
package/entry/browser.js
CHANGED
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
// wasm-bindgen `web`-target path, understood natively by modern bundlers
|
|
4
4
|
// (Vite, webpack 5+, Rollup) via `new URL(..., import.meta.url)` and by a
|
|
5
5
|
// bare `<script type="module">` served from a CDN.
|
|
6
|
-
import init from '../pkg/web/vortex_rdf.js';
|
|
6
|
+
import init, { init_panic_hook } from '../pkg/web/vortex_rdf.js';
|
|
7
7
|
|
|
8
8
|
await init();
|
|
9
|
+
init_panic_hook();
|
|
9
10
|
|
|
10
11
|
export {
|
|
11
12
|
VortexRdfStore,
|
|
12
|
-
init_panic_hook,
|
|
13
13
|
rdf_to_vortex,
|
|
14
14
|
vortex_to_rdf,
|
|
15
|
-
nquads_to_vortex,
|
|
16
|
-
vortex_to_nquads,
|
|
17
15
|
} from '../pkg/web/vortex_rdf.js';
|
package/entry/node.d.ts
CHANGED
|
@@ -3,11 +3,8 @@
|
|
|
3
3
|
// for the caller). Kept in sync with entry/node.js's re-exports.
|
|
4
4
|
export {
|
|
5
5
|
VortexRdfStore,
|
|
6
|
-
init_panic_hook,
|
|
7
6
|
rdf_to_vortex,
|
|
8
7
|
vortex_to_rdf,
|
|
9
|
-
nquads_to_vortex,
|
|
10
|
-
vortex_to_nquads,
|
|
11
8
|
} from '../pkg/web/vortex_rdf.js';
|
|
12
9
|
export type {
|
|
13
10
|
BuildOptions,
|
package/entry/node.js
CHANGED
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
// here even though it works for a real browser or bundler.
|
|
5
5
|
import { readFile } from 'node:fs/promises';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
|
-
import init from '../pkg/web/vortex_rdf.js';
|
|
7
|
+
import init, { init_panic_hook } from '../pkg/web/vortex_rdf.js';
|
|
8
8
|
|
|
9
9
|
const wasmPath = fileURLToPath(new URL('../pkg/web/vortex_rdf_bg.wasm', import.meta.url));
|
|
10
10
|
await init({ module_or_path: await readFile(wasmPath) });
|
|
11
|
+
init_panic_hook();
|
|
11
12
|
|
|
12
13
|
export {
|
|
13
14
|
VortexRdfStore,
|
|
14
|
-
init_panic_hook,
|
|
15
15
|
rdf_to_vortex,
|
|
16
16
|
vortex_to_rdf,
|
|
17
|
-
nquads_to_vortex,
|
|
18
|
-
vortex_to_nquads,
|
|
19
17
|
} from '../pkg/web/vortex_rdf.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vortex-rdf/vortex-rdf-store",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "High-performance, zero-copy columnar RDF serialization format",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,7 +32,10 @@
|
|
|
32
32
|
"build:clean-manifest": "node -e \"require('fs').rmSync('pkg/web/package.json',{force:true})\"",
|
|
33
33
|
"build": "npm run build:wasm && npm run build:clean-manifest",
|
|
34
34
|
"prepublishOnly": "npm run build",
|
|
35
|
-
"test": "vitest run"
|
|
35
|
+
"test": "vitest run",
|
|
36
|
+
"bench": "tsx --expose-gc --max-old-space-size=8192 bench/compare.bench.ts",
|
|
37
|
+
"bench:build": "npm run build && npm run bench",
|
|
38
|
+
"bench:codspeed": "tsx --expose-gc bench/codspeed.bench.ts"
|
|
36
39
|
},
|
|
37
40
|
"keywords": [
|
|
38
41
|
"rdf",
|
|
@@ -45,8 +48,13 @@
|
|
|
45
48
|
"author": "Julián Rojas",
|
|
46
49
|
"license": "MIT",
|
|
47
50
|
"devDependencies": {
|
|
51
|
+
"@codspeed/tinybench-plugin": "^5.7.1",
|
|
48
52
|
"@types/node": "^26.1.1",
|
|
53
|
+
"oxigraph": "^0.5.9",
|
|
49
54
|
"rdf-data-factory": "^2.0.2",
|
|
55
|
+
"rdf-stores": "^2.2.0",
|
|
56
|
+
"tinybench": "^6.1.2",
|
|
57
|
+
"tsx": "^4.23.1",
|
|
50
58
|
"typescript": "^7.0.2",
|
|
51
59
|
"vitest": "^4.1.10",
|
|
52
60
|
"wasm-pack": "^0.15.0"
|