@cooljapan/oxirs 0.2.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.
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "KitaSan <info@kitasan.io>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for OxiRS - Run RDF/SPARQL in the browser",
8
- "version": "0.2.0",
8
+ "version": "0.2.1",
9
9
  "license": "Apache-2.0",
10
10
  "repository": {
11
11
  "type": "git",
@@ -15,14 +15,11 @@
15
15
  "oxirs_wasm_bg.wasm",
16
16
  "oxirs_wasm.js",
17
17
  "oxirs_wasm_bg.js",
18
- "oxirs_wasm.d.ts",
19
- "index.js",
20
- "types.d.ts"
18
+ "oxirs_wasm.d.ts"
21
19
  ],
22
- "main": "index.js",
23
- "module": "oxirs_wasm.js",
20
+ "main": "oxirs_wasm.js",
24
21
  "homepage": "https://github.com/cool-japan/oxirs",
25
- "types": "types.d.ts",
22
+ "types": "oxirs_wasm.d.ts",
26
23
  "sideEffects": [
27
24
  "./oxirs_wasm.js",
28
25
  "./snippets/*"
@@ -32,11 +29,6 @@
32
29
  "webassembly",
33
30
  "rdf",
34
31
  "sparql",
35
- "browser",
36
- "semantic-web",
37
- "linked-data"
38
- ],
39
- "publishConfig": {
40
- "access": "public"
41
- }
42
- }
32
+ "browser"
33
+ ]
34
+ }
package/index.js DELETED
@@ -1,41 +0,0 @@
1
- /**
2
- * OxiRS WASM - JavaScript wrapper
3
- *
4
- * @module oxirs-wasm
5
- */
6
-
7
- import init, { OxiRSStore, Triple, version, log } from './oxirs_wasm.js';
8
-
9
- let initialized = false;
10
-
11
- /**
12
- * Initialize the WASM module
13
- * @returns {Promise<void>}
14
- */
15
- export async function initialize() {
16
- if (!initialized) {
17
- await init();
18
- initialized = true;
19
- }
20
- }
21
-
22
- /**
23
- * Create a new RDF store
24
- * @returns {Promise<OxiRSStore>}
25
- */
26
- export async function createStore() {
27
- await initialize();
28
- return new OxiRSStore();
29
- }
30
-
31
- /**
32
- * Get the version of OxiRS WASM
33
- * @returns {Promise<string>}
34
- */
35
- export async function getVersion() {
36
- await initialize();
37
- return version();
38
- }
39
-
40
- // Re-export classes
41
- export { OxiRSStore, Triple, log };
package/types.d.ts DELETED
@@ -1,159 +0,0 @@
1
- /**
2
- * OxiRS WASM TypeScript definitions
3
- */
4
-
5
- declare module '@cooljapan/oxirs' {
6
- /**
7
- * Initialize the WASM module
8
- */
9
- export function initialize(): Promise<void>;
10
-
11
- /**
12
- * Create a new RDF store
13
- */
14
- export function createStore(): Promise<OxiRSStore>;
15
-
16
- /**
17
- * Get the version of OxiRS WASM
18
- */
19
- export function getVersion(): Promise<string>;
20
-
21
- /**
22
- * Log a message to the browser console
23
- */
24
- export function log(message: string): void;
25
-
26
- /**
27
- * RDF Triple
28
- */
29
- export class Triple {
30
- constructor(subject: string, predicate: string, object: string);
31
-
32
- readonly subject: string;
33
- readonly predicate: string;
34
- readonly object: string;
35
- }
36
-
37
- /**
38
- * In-memory RDF store
39
- */
40
- export class OxiRSStore {
41
- constructor();
42
-
43
- /**
44
- * Load Turtle data
45
- * @param turtle - Turtle formatted RDF data
46
- * @returns Number of triples loaded
47
- */
48
- loadTurtle(turtle: string): Promise<number>;
49
-
50
- /**
51
- * Load N-Triples data
52
- * @param ntriples - N-Triples formatted RDF data
53
- * @returns Number of triples loaded
54
- */
55
- loadNTriples(ntriples: string): Promise<number>;
56
-
57
- /**
58
- * Insert a single triple
59
- */
60
- insert(subject: string, predicate: string, object: string): boolean;
61
-
62
- /**
63
- * Delete a single triple
64
- */
65
- delete(subject: string, predicate: string, object: string): boolean;
66
-
67
- /**
68
- * Check if a triple exists
69
- */
70
- contains(subject: string, predicate: string, object: string): boolean;
71
-
72
- /**
73
- * Get the number of triples
74
- */
75
- size(): number;
76
-
77
- /**
78
- * Clear all triples
79
- */
80
- clear(): void;
81
-
82
- /**
83
- * Execute a SPARQL SELECT query
84
- * @param sparql - SPARQL query string
85
- * @returns Array of binding objects
86
- */
87
- query(sparql: string): Promise<QueryResult[]>;
88
-
89
- /**
90
- * Execute a SPARQL ASK query
91
- * @param sparql - SPARQL query string
92
- * @returns Boolean result
93
- */
94
- ask(sparql: string): Promise<boolean>;
95
-
96
- /**
97
- * Execute a SPARQL CONSTRUCT query
98
- * @param sparql - SPARQL query string
99
- * @returns Array of Triple objects
100
- */
101
- construct(sparql: string): Promise<Triple[]>;
102
-
103
- /**
104
- * Export to Turtle format
105
- */
106
- toTurtle(): string;
107
-
108
- /**
109
- * Export to N-Triples format
110
- */
111
- toNTriples(): string;
112
-
113
- /**
114
- * Get all subjects
115
- */
116
- subjects(): string[];
117
-
118
- /**
119
- * Get all predicates
120
- */
121
- predicates(): string[];
122
-
123
- /**
124
- * Get all objects
125
- */
126
- objects(): string[];
127
-
128
- /**
129
- * Add a namespace prefix
130
- */
131
- addPrefix(prefix: string, uri: string): void;
132
- }
133
-
134
- /**
135
- * Query result binding
136
- */
137
- export interface QueryResult {
138
- [variable: string]: string;
139
- }
140
-
141
- /**
142
- * Validation report
143
- */
144
- export interface ValidationReport {
145
- conforms: boolean;
146
- results: ValidationResult[];
147
- }
148
-
149
- /**
150
- * Validation result
151
- */
152
- export interface ValidationResult {
153
- focusNode: string;
154
- resultPath?: string;
155
- value?: string;
156
- message: string;
157
- severity: 'Violation' | 'Warning' | 'Info';
158
- }
159
- }