@_linked/rdf-mem-store 0.0.1-dev.20260211062424

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.
Files changed (138) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +286 -0
  4. package/lib/cjs/Datafactory.d.ts +29 -0
  5. package/lib/cjs/Datafactory.js +101 -0
  6. package/lib/cjs/Datafactory.js.map +1 -0
  7. package/lib/cjs/InMemoryStore.d.ts +35 -0
  8. package/lib/cjs/InMemoryStore.js +98 -0
  9. package/lib/cjs/InMemoryStore.js.map +1 -0
  10. package/lib/cjs/collections/NodeMap.d.ts +35 -0
  11. package/lib/cjs/collections/NodeMap.js +244 -0
  12. package/lib/cjs/collections/NodeMap.js.map +1 -0
  13. package/lib/cjs/collections/NodeSet.d.ts +55 -0
  14. package/lib/cjs/collections/NodeSet.js +296 -0
  15. package/lib/cjs/collections/NodeSet.js.map +1 -0
  16. package/lib/cjs/collections/NodeURIMappings.d.ts +20 -0
  17. package/lib/cjs/collections/NodeURIMappings.js +65 -0
  18. package/lib/cjs/collections/NodeURIMappings.js.map +1 -0
  19. package/lib/cjs/collections/NodeValuesSet.d.ts +63 -0
  20. package/lib/cjs/collections/NodeValuesSet.js +100 -0
  21. package/lib/cjs/collections/NodeValuesSet.js.map +1 -0
  22. package/lib/cjs/collections/QuadArray.d.ts +17 -0
  23. package/lib/cjs/collections/QuadArray.js +67 -0
  24. package/lib/cjs/collections/QuadArray.js.map +1 -0
  25. package/lib/cjs/collections/QuadMap.d.ts +64 -0
  26. package/lib/cjs/collections/QuadMap.js +155 -0
  27. package/lib/cjs/collections/QuadMap.js.map +1 -0
  28. package/lib/cjs/collections/QuadSet.d.ts +22 -0
  29. package/lib/cjs/collections/QuadSet.js +106 -0
  30. package/lib/cjs/collections/QuadSet.js.map +1 -0
  31. package/lib/cjs/collections/SearchMap.d.ts +5 -0
  32. package/lib/cjs/collections/SearchMap.js +13 -0
  33. package/lib/cjs/collections/SearchMap.js.map +1 -0
  34. package/lib/cjs/events/EventBatcher.d.ts +20 -0
  35. package/lib/cjs/events/EventBatcher.js +97 -0
  36. package/lib/cjs/events/EventBatcher.js.map +1 -0
  37. package/lib/cjs/events/EventEmitter.d.ts +15 -0
  38. package/lib/cjs/events/EventEmitter.js +102 -0
  39. package/lib/cjs/events/EventEmitter.js.map +1 -0
  40. package/lib/cjs/index.d.ts +14 -0
  41. package/lib/cjs/index.js +48 -0
  42. package/lib/cjs/index.js.map +1 -0
  43. package/lib/cjs/interfaces/IGraphObject.d.ts +29 -0
  44. package/lib/cjs/interfaces/IGraphObject.js +3 -0
  45. package/lib/cjs/interfaces/IGraphObject.js.map +1 -0
  46. package/lib/cjs/interfaces/IGraphObjectSet.d.ts +24 -0
  47. package/lib/cjs/interfaces/IGraphObjectSet.js +3 -0
  48. package/lib/cjs/interfaces/IGraphObjectSet.js.map +1 -0
  49. package/lib/cjs/interfaces/IShape.d.ts +22 -0
  50. package/lib/cjs/interfaces/IShape.js +3 -0
  51. package/lib/cjs/interfaces/IShape.js.map +1 -0
  52. package/lib/cjs/interfaces/ISingleGraphObject.d.ts +3 -0
  53. package/lib/cjs/interfaces/ISingleGraphObject.js +3 -0
  54. package/lib/cjs/interfaces/ISingleGraphObject.js.map +1 -0
  55. package/lib/cjs/models.d.ts +1167 -0
  56. package/lib/cjs/models.js +2668 -0
  57. package/lib/cjs/models.js.map +1 -0
  58. package/lib/cjs/package.json +3 -0
  59. package/lib/cjs/utils/Debug.d.ts +3 -0
  60. package/lib/cjs/utils/Debug.js +46 -0
  61. package/lib/cjs/utils/Debug.js.map +1 -0
  62. package/lib/cjs/utils/LocalQueryResolver.d.ts +21 -0
  63. package/lib/cjs/utils/LocalQueryResolver.js +1442 -0
  64. package/lib/cjs/utils/LocalQueryResolver.js.map +1 -0
  65. package/lib/cjs/utils/URI.d.ts +18 -0
  66. package/lib/cjs/utils/URI.js +42 -0
  67. package/lib/cjs/utils/URI.js.map +1 -0
  68. package/lib/cjs/utils/toNamedNode.d.ts +8 -0
  69. package/lib/cjs/utils/toNamedNode.js +15 -0
  70. package/lib/cjs/utils/toNamedNode.js.map +1 -0
  71. package/lib/esm/Datafactory.d.ts +29 -0
  72. package/lib/esm/Datafactory.js +97 -0
  73. package/lib/esm/Datafactory.js.map +1 -0
  74. package/lib/esm/InMemoryStore.d.ts +35 -0
  75. package/lib/esm/InMemoryStore.js +94 -0
  76. package/lib/esm/InMemoryStore.js.map +1 -0
  77. package/lib/esm/collections/NodeMap.d.ts +35 -0
  78. package/lib/esm/collections/NodeMap.js +240 -0
  79. package/lib/esm/collections/NodeMap.js.map +1 -0
  80. package/lib/esm/collections/NodeSet.d.ts +55 -0
  81. package/lib/esm/collections/NodeSet.js +292 -0
  82. package/lib/esm/collections/NodeSet.js.map +1 -0
  83. package/lib/esm/collections/NodeURIMappings.d.ts +20 -0
  84. package/lib/esm/collections/NodeURIMappings.js +61 -0
  85. package/lib/esm/collections/NodeURIMappings.js.map +1 -0
  86. package/lib/esm/collections/NodeValuesSet.d.ts +63 -0
  87. package/lib/esm/collections/NodeValuesSet.js +96 -0
  88. package/lib/esm/collections/NodeValuesSet.js.map +1 -0
  89. package/lib/esm/collections/QuadArray.d.ts +17 -0
  90. package/lib/esm/collections/QuadArray.js +63 -0
  91. package/lib/esm/collections/QuadArray.js.map +1 -0
  92. package/lib/esm/collections/QuadMap.d.ts +64 -0
  93. package/lib/esm/collections/QuadMap.js +151 -0
  94. package/lib/esm/collections/QuadMap.js.map +1 -0
  95. package/lib/esm/collections/QuadSet.d.ts +22 -0
  96. package/lib/esm/collections/QuadSet.js +102 -0
  97. package/lib/esm/collections/QuadSet.js.map +1 -0
  98. package/lib/esm/collections/SearchMap.d.ts +5 -0
  99. package/lib/esm/collections/SearchMap.js +9 -0
  100. package/lib/esm/collections/SearchMap.js.map +1 -0
  101. package/lib/esm/events/EventBatcher.d.ts +20 -0
  102. package/lib/esm/events/EventBatcher.js +90 -0
  103. package/lib/esm/events/EventBatcher.js.map +1 -0
  104. package/lib/esm/events/EventEmitter.d.ts +15 -0
  105. package/lib/esm/events/EventEmitter.js +98 -0
  106. package/lib/esm/events/EventEmitter.js.map +1 -0
  107. package/lib/esm/index.d.ts +14 -0
  108. package/lib/esm/index.js +22 -0
  109. package/lib/esm/index.js.map +1 -0
  110. package/lib/esm/interfaces/IGraphObject.d.ts +29 -0
  111. package/lib/esm/interfaces/IGraphObject.js +2 -0
  112. package/lib/esm/interfaces/IGraphObject.js.map +1 -0
  113. package/lib/esm/interfaces/IGraphObjectSet.d.ts +24 -0
  114. package/lib/esm/interfaces/IGraphObjectSet.js +2 -0
  115. package/lib/esm/interfaces/IGraphObjectSet.js.map +1 -0
  116. package/lib/esm/interfaces/IShape.d.ts +22 -0
  117. package/lib/esm/interfaces/IShape.js +2 -0
  118. package/lib/esm/interfaces/IShape.js.map +1 -0
  119. package/lib/esm/interfaces/ISingleGraphObject.d.ts +3 -0
  120. package/lib/esm/interfaces/ISingleGraphObject.js +2 -0
  121. package/lib/esm/interfaces/ISingleGraphObject.js.map +1 -0
  122. package/lib/esm/models.d.ts +1167 -0
  123. package/lib/esm/models.js +2659 -0
  124. package/lib/esm/models.js.map +1 -0
  125. package/lib/esm/package.json +3 -0
  126. package/lib/esm/utils/Debug.d.ts +3 -0
  127. package/lib/esm/utils/Debug.js +42 -0
  128. package/lib/esm/utils/Debug.js.map +1 -0
  129. package/lib/esm/utils/LocalQueryResolver.d.ts +21 -0
  130. package/lib/esm/utils/LocalQueryResolver.js +1434 -0
  131. package/lib/esm/utils/LocalQueryResolver.js.map +1 -0
  132. package/lib/esm/utils/URI.d.ts +18 -0
  133. package/lib/esm/utils/URI.js +38 -0
  134. package/lib/esm/utils/URI.js.map +1 -0
  135. package/lib/esm/utils/toNamedNode.d.ts +8 -0
  136. package/lib/esm/utils/toNamedNode.js +12 -0
  137. package/lib/esm/utils/toNamedNode.js.map +1 -0
  138. package/package.json +62 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @_linked/rdf-mem-store
2
+
3
+ ## 0.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Initial publish to reserve package name and set up CI/CD.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Semantu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,286 @@
1
+ # @_linked/rdf-mem-store
2
+
3
+ In-memory RDF store for `@_linked/core`. Provides RDF model classes, an in-memory quad graph, and a query resolver that executes query objects generated by core's Shape-based query DSL.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @_linked/rdf-mem-store @_linked/core
9
+ ```
10
+
11
+ ## Quick start
12
+
13
+ ```typescript
14
+ import {LinkedStorage} from '@_linked/core';
15
+ import {InMemoryStore, NamedNode, Literal} from '@_linked/rdf-mem-store';
16
+
17
+ // 1. Create and wire the store
18
+ const store = new InMemoryStore();
19
+ LinkedStorage.setDefaultStore(store);
20
+
21
+ // 2. Create nodes and data — all nodes and quads are global singletons,
22
+ // automatically available to every InMemoryStore
23
+ const alice = NamedNode.getOrCreate('https://example.org/alice');
24
+ const name = NamedNode.getOrCreate('https://schema.org/name');
25
+ alice.setValue(name, 'Alice');
26
+
27
+ // 3. Query using core's Shape DSL (see @_linked/core for Shape setup)
28
+ const results = await Person.select((p) => p.name);
29
+ ```
30
+
31
+ ## Wiring the store into core
32
+
33
+ `InMemoryStore` implements `IQuadStore` from `@_linked/core`. Register it as the default store so core's query DSL can resolve queries:
34
+
35
+ ```typescript
36
+ import {LinkedStorage} from '@_linked/core';
37
+ import {InMemoryStore} from '@_linked/rdf-mem-store';
38
+
39
+ const store = new InMemoryStore();
40
+ LinkedStorage.setDefaultStore(store);
41
+ ```
42
+
43
+ You can also route specific shapes to specific stores:
44
+
45
+ ```typescript
46
+ import {LinkedStorage} from '@_linked/core';
47
+ import {InMemoryStore} from '@_linked/rdf-mem-store';
48
+
49
+ const mainStore = new InMemoryStore();
50
+ const personStore = new InMemoryStore();
51
+
52
+ LinkedStorage.setDefaultStore(mainStore);
53
+ LinkedStorage.setStoreForShapes(personStore, Person);
54
+ ```
55
+
56
+ ## RDF models
57
+
58
+ This package provides the core RDF model classes. All nodes and quads are **global singletons** — calling `NamedNode.getOrCreate(uri)` twice with the same URI returns the same instance.
59
+
60
+ ### NamedNode
61
+
62
+ Represents a URI-identified RDF node. This is the primary building block.
63
+
64
+ ```typescript
65
+ import {NamedNode} from '@_linked/rdf-mem-store';
66
+
67
+ // Get or create a node (singleton per URI)
68
+ const node = NamedNode.getOrCreate('https://example.org/alice');
69
+
70
+ // Create a temporary node (auto-generated URI)
71
+ const temp = NamedNode.create();
72
+
73
+ // Check if a node exists without creating it
74
+ const existing = NamedNode.getNamedNode('https://example.org/alice'); // NamedNode | undefined
75
+ ```
76
+
77
+ `NamedNode` satisfies `NodeReferenceValue` (`{id: string}`) from core, so it can be used anywhere core expects a node reference.
78
+
79
+ ### Literal
80
+
81
+ Represents an RDF literal value (string, number, date, etc.).
82
+
83
+ ```typescript
84
+ import {Literal, NamedNode} from '@_linked/rdf-mem-store';
85
+
86
+ // Plain string literal
87
+ const lit = new Literal('hello');
88
+
89
+ // Typed literal (with datatype)
90
+ import {xsd} from '@_linked/core/ontologies/xsd';
91
+ import {toNamedNode} from '@_linked/rdf-mem-store';
92
+
93
+ const intLit = new Literal('42', toNamedNode(xsd.integer));
94
+ const dateLit = new Literal('2024-01-01T00:00:00.000Z', toNamedNode(xsd.dateTime));
95
+ const boolLit = new Literal('true', toNamedNode(xsd.boolean));
96
+ ```
97
+
98
+ ### Quad
99
+
100
+ Represents an RDF triple/quad (subject-predicate-object-graph).
101
+
102
+ ```typescript
103
+ import {Quad, NamedNode, Literal, defaultGraph} from '@_linked/rdf-mem-store';
104
+
105
+ const subject = NamedNode.getOrCreate('https://example.org/alice');
106
+ const predicate = NamedNode.getOrCreate('https://schema.org/name');
107
+ const object = new Literal('Alice');
108
+
109
+ // Quads are also singletons
110
+ const quad = Quad.getOrCreate(subject, predicate, object, defaultGraph);
111
+ ```
112
+
113
+ ### Graph
114
+
115
+ Represents an RDF named graph.
116
+
117
+ ```typescript
118
+ import {Graph, defaultGraph} from '@_linked/rdf-mem-store';
119
+
120
+ const myGraph = Graph.getOrCreate('https://example.org/my-graph');
121
+ // defaultGraph is the default graph singleton
122
+ ```
123
+
124
+ ## Working with properties
125
+
126
+ `NamedNode` provides methods for setting, getting, and removing property values.
127
+
128
+ ### Setting properties
129
+
130
+ ```typescript
131
+ const alice = NamedNode.getOrCreate('https://example.org/alice');
132
+ const name = NamedNode.getOrCreate('https://schema.org/name');
133
+ const knows = NamedNode.getOrCreate('https://schema.org/knows');
134
+ const bob = NamedNode.getOrCreate('https://example.org/bob');
135
+
136
+ // Set a literal value (creates a Literal and a Quad)
137
+ alice.setValue(name, 'Alice');
138
+
139
+ // Set an object property (node-to-node link)
140
+ alice.set(knows, bob);
141
+
142
+ // Set multiple values at once
143
+ const carol = NamedNode.getOrCreate('https://example.org/carol');
144
+ alice.mset(knows, [bob, carol]);
145
+
146
+ // Overwrite a property (removes existing values first)
147
+ alice.overwrite(name, new Literal('Alicia'));
148
+
149
+ // Overwrite with multiple values
150
+ alice.moverwrite(knows, [bob, carol]);
151
+ ```
152
+
153
+ ### Getting properties
154
+
155
+ ```typescript
156
+ // Get a single value
157
+ const oneKnown = alice.getOne(knows); // Node | undefined
158
+
159
+ // Get all values for a property
160
+ const allKnown = alice.getAll(knows); // NodeValuesSet (iterable)
161
+
162
+ // Get a string value directly
163
+ const nameStr = alice.getValue(name); // string
164
+
165
+ // Get all nodes that point to this node via a property
166
+ const whoKnowsAlice = alice.getAllInverse(knows); // NodeSet<NamedNode>
167
+
168
+ // Check if a property exists
169
+ const hasName = alice.hasProperty(name); // boolean
170
+
171
+ // Get quads for a property
172
+ const quads = alice.getQuads(knows); // QuadSet
173
+ ```
174
+
175
+ ### Removing properties
176
+
177
+ ```typescript
178
+ // Remove a specific value
179
+ alice.unset(knows, bob);
180
+
181
+ // Remove all values for a property
182
+ alice.unsetAll(knows);
183
+
184
+ // Remove the node entirely (removes all quads where it is subject or object)
185
+ alice.remove();
186
+ ```
187
+
188
+ ## Setting up typed data (with Shapes)
189
+
190
+ When using core's Shape DSL, you define shapes and set up data using the RDF model layer. The query resolver traverses the global quad graph to resolve queries.
191
+
192
+ ```typescript
193
+ import {NamedNode, Literal, toNamedNode} from '@_linked/rdf-mem-store';
194
+ import {rdf} from '@_linked/core/ontologies/rdf';
195
+ import {InMemoryStore} from '@_linked/rdf-mem-store';
196
+ import {LinkedStorage} from '@_linked/core';
197
+
198
+ // Assume you have a Person shape with targetClass and properties defined via core
199
+ // (see @_linked/core README for Shape setup)
200
+
201
+ // Create typed entities
202
+ const personType = toNamedNode(Person.targetClass);
203
+ const rdfType = toNamedNode(rdf.type);
204
+ const nameProp = toNamedNode(name); // name from your shape's property path
205
+
206
+ const alice = NamedNode.getOrCreate('https://example.org/alice');
207
+ alice.set(rdfType, personType); // Set rdf:type so the resolver finds this instance
208
+ alice.setValue(nameProp, 'Alice'); // Set the name property
209
+
210
+ // Wire the store
211
+ const store = new InMemoryStore();
212
+ LinkedStorage.setDefaultStore(store);
213
+
214
+ // Now queries work
215
+ const results = await Person.select((p) => p.name);
216
+ // → [{id: 'https://example.org/alice', name: 'Alice'}]
217
+ ```
218
+
219
+ ## toNamedNode helper
220
+
221
+ Since core uses `NodeReferenceValue` (`{id: string}`) for ontology terms, property paths, and target classes, use `toNamedNode` to convert them to `NamedNode` instances when working with the RDF model layer:
222
+
223
+ ```typescript
224
+ import {toNamedNode} from '@_linked/rdf-mem-store';
225
+ import {rdf} from '@_linked/core/ontologies/rdf';
226
+
227
+ // rdf.type is {id: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'}
228
+ const rdfTypeNode = toNamedNode(rdf.type); // → NamedNode
229
+
230
+ // Works with any {id: string} object
231
+ const node = toNamedNode({id: 'https://example.org/foo'}); // → NamedNode
232
+
233
+ // Passes through NamedNode instances unchanged
234
+ const nn = NamedNode.getOrCreate('https://example.org/bar');
235
+ toNamedNode(nn) === nn; // true
236
+ ```
237
+
238
+ ## InMemoryStore API
239
+
240
+ `InMemoryStore` implements `IQuadStore` from core (query methods) and provides additional quad-level methods:
241
+
242
+ ```typescript
243
+ const store = new InMemoryStore();
244
+
245
+ // Query methods (from IQuadStore)
246
+ await store.selectQuery(query); // Resolve a select query
247
+ await store.updateQuery(query); // Resolve an update query
248
+ await store.createQuery(query); // Resolve a create query
249
+ await store.deleteQuery(query); // Resolve a delete query
250
+
251
+ // Quad-level methods
252
+ await store.add(quad); // Add a single quad
253
+ await store.addMultiple(quadSet); // Add multiple quads
254
+ await store.delete(quad); // Remove a single quad
255
+ await store.deleteMultiple(quadSet); // Remove multiple quads
256
+
257
+ // Inspect contents
258
+ store.getContents(); // Returns the QuadSet of tracked quads
259
+ ```
260
+
261
+ ## RDF collections
262
+
263
+ - **`QuadSet`** — Set of Quad instances
264
+ - **`QuadArray`** — Array of Quad instances
265
+ - **`QuadMap`** — Map indexed by quads
266
+ - **`NodeSet`** — Set of NamedNode instances
267
+ - **`NodeMap`** — Map keyed by NamedNode
268
+ - **`NodeURIMappings`** — URI-to-node mapping utilities
269
+ - **`SearchMap`** — Search-optimized map for quad lookups
270
+ - **`NodeValuesSet`** — Set of values for a specific property on a node (returned by `node.getAll()`)
271
+
272
+ ## Related packages
273
+
274
+ - `@_linked/core` — Query DSL, Shape classes, SHACL decorators, LinkedStorage
275
+ - `@_linked/react` — React bindings for Linked queries and shapes
276
+
277
+ ## Changelog
278
+
279
+ ### 1.0.0 (from LINCD.js)
280
+
281
+ Initial extraction from the LINCD monolith. Moves all RDF model classes, the in-memory quad store, and the query resolver into a standalone package.
282
+
283
+ - RDF models (`NamedNode`, `Literal`, `BlankNode`, `Quad`, `Graph`) and all RDF collections extracted from `lincd`.
284
+ - `InMemoryStore` implements `IQuadStore` from `@_linked/core`.
285
+ - `LocalQueryResolver` resolves core's query objects against the in-memory quad graph.
286
+ - `toNamedNode` helper bridges core's `NodeReferenceValue` (`{id: string}`) to `NamedNode` instances.
@@ -0,0 +1,29 @@
1
+ import { Graph, Literal, NamedNode } from './models.js';
2
+ import { Term } from 'rdflib/lib/tf-types';
3
+ import { NodeURIMappings } from './collections/NodeURIMappings.js';
4
+ import { QuadSet } from './collections/QuadSet.js';
5
+ interface DataFactoryConfig {
6
+ preventNewQuads?: boolean;
7
+ emitEvents?: boolean;
8
+ triggerStorage?: boolean;
9
+ nodeMap?: NodeURIMappings;
10
+ targetGraph?: Graph;
11
+ overwriteData?: boolean;
12
+ }
13
+ export declare class Datafactory {
14
+ quads: QuadSet;
15
+ private nodeMap?;
16
+ private preventNewQuads;
17
+ private emitEvents;
18
+ private triggerStorage;
19
+ private targetGraph;
20
+ private clearedProps;
21
+ private overwriteData?;
22
+ constructor(config?: DataFactoryConfig);
23
+ namedNode(uri: string): NamedNode;
24
+ literal(value: any, languageOrDatatype: any): Literal;
25
+ blankNode(value: any): import("./models.js").BlankNode;
26
+ defaultGraph(): any;
27
+ quad(subject: Term, predicate: Term, object: Term, graph: Term): any;
28
+ }
29
+ export {};
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Datafactory = void 0;
4
+ const models_js_1 = require("./models.js");
5
+ const NodeURIMappings_js_1 = require("./collections/NodeURIMappings.js");
6
+ const QuadSet_js_1 = require("./collections/QuadSet.js");
7
+ const CoreMap_1 = require("@_linked/core/collections/CoreMap");
8
+ const CoreSet_1 = require("@_linked/core/collections/CoreSet");
9
+ class Datafactory {
10
+ constructor(config) {
11
+ this.quads = new QuadSet_js_1.QuadSet();
12
+ this.emitEvents = true;
13
+ this.triggerStorage = false;
14
+ for (let key in config) {
15
+ this[key] = config[key];
16
+ }
17
+ if (!(config === null || config === void 0 ? void 0 : config.nodeMap)) {
18
+ this.nodeMap = new NodeURIMappings_js_1.NodeURIMappings();
19
+ }
20
+ this.quad = this.quad.bind(this);
21
+ this.blankNode = this.blankNode.bind(this);
22
+ this.namedNode = this.namedNode.bind(this);
23
+ this.literal = this.literal.bind(this);
24
+ if (config === null || config === void 0 ? void 0 : config.overwriteData) {
25
+ this.clearedProps = new CoreMap_1.CoreMap();
26
+ }
27
+ }
28
+ //TODO:
29
+ // Variable variable(DOMString value);
30
+ // Term fromTerm(Term original);
31
+ // Quad fromQuad(Quad original);
32
+ namedNode(uri) {
33
+ return models_js_1.NamedNode.getOrCreate(uri);
34
+ }
35
+ literal(value, languageOrDatatype) {
36
+ if (languageOrDatatype instanceof models_js_1.NamedNode) {
37
+ return new models_js_1.Literal(value, languageOrDatatype);
38
+ }
39
+ else {
40
+ return new models_js_1.Literal(value, null, languageOrDatatype);
41
+ }
42
+ }
43
+ blankNode(value) {
44
+ //when using start/end blanknode space you can let the factory reuse the same blank nodes
45
+ // if (this.nodeMap) {
46
+ return this.nodeMap.getOrCreateBlankNode(value);
47
+ // }
48
+ // return BlankNode.getOrCreate(value);
49
+ }
50
+ defaultGraph() {
51
+ return models_js_1.defaultGraph;
52
+ }
53
+ quad(subject, predicate, object, graph) {
54
+ //if a target graph is given, we always use that, regardless of whether there was any graph present in the data
55
+ //else if a graph was in the data, use that, or fall back to default graph
56
+ if (this.targetGraph) {
57
+ graph = this.targetGraph;
58
+ }
59
+ else if (!graph) {
60
+ graph = models_js_1.defaultGraph;
61
+ }
62
+ //in LINCD we use Graph objects which extend NamedNode
63
+ //but when parsing with N3 we get NamedNode objects
64
+ if (graph instanceof models_js_1.NamedNode) {
65
+ graph = models_js_1.Graph.getOrCreate(graph.uri);
66
+ }
67
+ //sometimes we want to update the graph with new data coming in from JSONLD
68
+ //so if overwrite data is true, we clear old data for any subj/pred combination we find
69
+ if (this.overwriteData &&
70
+ (!this.clearedProps.has(subject) ||
71
+ !this.clearedProps
72
+ .get(subject)
73
+ .has(predicate))) {
74
+ //remove without triggering storage events
75
+ subject.getQuads(predicate).removeAll(false);
76
+ if (!this.clearedProps.has(subject)) {
77
+ this.clearedProps.set(subject, new CoreSet_1.CoreSet());
78
+ }
79
+ this.clearedProps.get(subject).add(predicate);
80
+ }
81
+ let quad;
82
+ if (this.preventNewQuads) {
83
+ quad = models_js_1.Quad.get(subject, predicate, object, graph);
84
+ if (quad) {
85
+ this.quads.add(quad);
86
+ }
87
+ else {
88
+ //NOTE: this is not standard, so preventNewQuads will not work with other tools
89
+ //But it is useful for LINCD, where we want to prevent new quads from being created. Like when we share quads to be removed with other threads
90
+ return true;
91
+ }
92
+ }
93
+ else {
94
+ quad = models_js_1.Quad.getOrCreate(subject, predicate, object, graph, false, this.triggerStorage, this.emitEvents);
95
+ this.quads.add(quad);
96
+ }
97
+ return quad;
98
+ }
99
+ }
100
+ exports.Datafactory = Datafactory;
101
+ //# sourceMappingURL=Datafactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Datafactory.js","sourceRoot":"","sources":["../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AC,EAAE,CAAC;gBACjD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAoB,EAAE,IAAI,iBAAO,EAAa,CAAC,CAAC;YACxE,CAAC;YACD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAoB,CAAC,CAAC,GAAG,CAAC,SAAsB,CAAC,CAAC;QAC1E,CAAC;QAED,IAAI,IAAI,CAAC;QACT,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,IAAI,GAAG,gBAAI,CAAC,GAAG,CACb,OAAoB,EACpB,SAAsB,EACtB,MAAc,EACd,KAAc,CACf,CAAC;YACF,IAAI,IAAI,EAAE,CAAC;gBACT,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC;iBAAM,CAAC;gBACN,+EAA+E;gBAC/E,8IAA8I;gBAC9I,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,GAAG,gBAAI,CAAC,WAAW,CACrB,OAAoB,EACpB,SAAsB,EACtB,MAAc,EACd,KAAc,EACd,KAAK,EACL,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,UAAU,CAChB,CAAC;YACF,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AApHD,kCAoHC"}
@@ -0,0 +1,35 @@
1
+ import { IQuadStore } from '@_linked/core/interfaces/IQuadStore';
2
+ import { SelectQuery } from '@_linked/core/queries/SelectQuery';
3
+ import { UpdateQuery } from '@_linked/core/queries/UpdateQuery';
4
+ import { CreateQuery } from '@_linked/core/queries/CreateQuery';
5
+ import { DeleteQuery, DeleteResponse } from '@_linked/core/queries/DeleteQuery';
6
+ import { Graph, Quad } from './models';
7
+ import { QuadSet } from './collections/QuadSet';
8
+ import { QuadArray } from './collections/QuadArray';
9
+ export declare class InMemoryStore implements IQuadStore {
10
+ /**
11
+ * You can use this to define (overwrite) which graph this store uses for its quads
12
+ */
13
+ targetGraph: Graph;
14
+ protected contents: QuadSet;
15
+ private initPromise;
16
+ init(): Promise<any>;
17
+ loadContents(): Promise<QuadSet>;
18
+ /**
19
+ * returns the contents of the InMemoryStore as a QuadSet
20
+ * do NOT modify the returned QuadSet directly. Add or remove contents to this store instead
21
+ */
22
+ getContents(): QuadSet;
23
+ selectQuery<ResultType>(query: SelectQuery<any>): Promise<ResultType>;
24
+ updateQuery?<RType>(query: UpdateQuery<RType>): Promise<RType>;
25
+ createQuery?<R>(q: CreateQuery<R>): Promise<R>;
26
+ deleteQuery(query: DeleteQuery): Promise<DeleteResponse>;
27
+ add(quad: Quad): Promise<any>;
28
+ addMultiple(quads: QuadSet): Promise<any>;
29
+ delete(quad: Quad): Promise<any>;
30
+ deleteMultiple(quads: QuadSet): Promise<any>;
31
+ protected onContentsUpdated(): Promise<boolean>;
32
+ protected addNewContents(quads: QuadArray | QuadSet): QuadArray | QuadSet;
33
+ private _addMultiple;
34
+ private _deleteMultiple;
35
+ }
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InMemoryStore = void 0;
4
+ const LocalQueryResolver_1 = require("./utils/LocalQueryResolver");
5
+ const models_1 = require("./models");
6
+ const QuadSet_1 = require("./collections/QuadSet");
7
+ const QuadArray_1 = require("./collections/QuadArray");
8
+ class InMemoryStore {
9
+ init() {
10
+ if (!this.initPromise) {
11
+ this.initPromise = this.loadContents();
12
+ }
13
+ return this.initPromise;
14
+ }
15
+ loadContents() {
16
+ //by default an in-memory store starts empty - it has no permanent storage
17
+ //overwrite this method to change that
18
+ this.contents = new QuadSet_1.QuadSet();
19
+ return Promise.resolve(this.contents);
20
+ }
21
+ /**
22
+ * returns the contents of the InMemoryStore as a QuadSet
23
+ * do NOT modify the returned QuadSet directly. Add or remove contents to this store instead
24
+ */
25
+ getContents() {
26
+ return this.contents;
27
+ }
28
+ selectQuery(query) {
29
+ return Promise.resolve((0, LocalQueryResolver_1.resolveLocal)(query)).catch((e) => {
30
+ console.error('Error in query', e);
31
+ return new QuadArray_1.QuadArray();
32
+ });
33
+ }
34
+ updateQuery(query) {
35
+ return Promise.resolve((0, LocalQueryResolver_1.updateLocal)(query));
36
+ }
37
+ createQuery(q) {
38
+ return Promise.resolve((0, LocalQueryResolver_1.createLocal)(q));
39
+ }
40
+ deleteQuery(query) {
41
+ return Promise.resolve((0, LocalQueryResolver_1.deleteLocal)(query));
42
+ }
43
+ add(quad) {
44
+ return this.init().then(() => {
45
+ this.addNewContents(new QuadArray_1.QuadArray(quad));
46
+ this.onContentsUpdated();
47
+ return Promise.resolve(true);
48
+ });
49
+ }
50
+ addMultiple(quads) {
51
+ return this.init().then(() => {
52
+ this._addMultiple(quads);
53
+ this.onContentsUpdated();
54
+ return Promise.resolve(true);
55
+ });
56
+ }
57
+ delete(quad) {
58
+ return this.init().then(() => {
59
+ this._deleteMultiple(new QuadArray_1.QuadArray(quad));
60
+ this.onContentsUpdated();
61
+ return true;
62
+ });
63
+ }
64
+ deleteMultiple(quads) {
65
+ return this.init().then(() => {
66
+ this._deleteMultiple(quads);
67
+ this.onContentsUpdated();
68
+ return true;
69
+ });
70
+ }
71
+ onContentsUpdated() {
72
+ //by default in memory store does nothing here. Extending classes could choose to sync to a more permanent form of storage
73
+ return Promise.resolve(false);
74
+ }
75
+ addNewContents(quads) {
76
+ let graph = this.targetGraph || models_1.defaultGraph;
77
+ if (graph) {
78
+ quads = quads.moveTo(graph, false);
79
+ }
80
+ this.contents.addFrom(quads);
81
+ return quads;
82
+ }
83
+ _addMultiple(quads) {
84
+ this.addNewContents(quads);
85
+ }
86
+ _deleteMultiple(quads) {
87
+ let graph = this.targetGraph || models_1.defaultGraph;
88
+ if (graph) {
89
+ quads = quads.moveTo(graph, false);
90
+ }
91
+ quads.forEach((quad) => {
92
+ this.contents.delete(quad);
93
+ quad.remove(false);
94
+ });
95
+ }
96
+ }
97
+ exports.InMemoryStore = InMemoryStore;
98
+ //# sourceMappingURL=InMemoryStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InMemoryStore.js","sourceRoot":"","sources":["../../src/InMemoryStore.ts"],"names":[],"mappings":";;;AAKA,mEAKoC;AACpC,qCAAmD;AACnD,mDAA8C;AAC9C,uDAAkD;AAElD,MAAa,aAAa;IAQxB,IAAI;QACF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,YAAY;QACV,0EAA0E;QAC1E,sCAAsC;QACtC,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAO,EAAE,CAAC;QAC9B,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,WAAW,CAAa,KAAuB;QAC7C,OAAO,OAAO,CAAC,OAAO,CAAC,IAAA,iCAAY,EAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACtD,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;YACnC,OAAO,IAAI,qBAAS,EAAE,CAAC;QACzB,CAAC,CAAwB,CAAC;IAC5B,CAAC;IAED,WAAW,CAAS,KAAyB;QAC3C,OAAO,OAAO,CAAC,OAAO,CAAC,IAAA,gCAAW,EAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED,WAAW,CAAK,CAAiB;QAC/B,OAAO,OAAO,CAAC,OAAO,CAAC,IAAA,gCAAW,EAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,WAAW,CAAC,KAAkB;QAC5B,OAAO,OAAO,CAAC,OAAO,CAAC,IAAA,gC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AI,KAAK,GAAG,IAAI,CAAC,WAAW,IAAI,qBAAY,CAAC;QAC7C,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACrC,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,YAAY,CAAC,KAA0B;QAC7C,IAAI,CAAC,cAAc,CAAC,KAAkB,CAAC,CAAC;IAC1C,CAAC;IAEO,eAAe,CAAC,KAA0B;QAChD,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,IAAI,qBAAY,CAAC;QAC7C,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACrC,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA7GD,sCA6GC"}
@@ -0,0 +1,35 @@
1
+ import { CoreMap } from '@_linked/core/collections/CoreMap';
2
+ import { IGraphObjectSet } from '../interfaces/IGraphObjectSet.js';
3
+ import { NamedNode, Node } from '../models.js';
4
+ import { QuadSet } from './QuadSet.js';
5
+ import { QuadArray } from './QuadArray.js';
6
+ import { NodeSet } from './NodeSet.js';
7
+ import { ICoreIterable } from '@_linked/core/interfaces/ICoreIterable';
8
+ export declare class NodeMap<R extends Node> extends CoreMap<string, R> implements IGraphObjectSet<R> {
9
+ constructor(iterable?: Iterable<[string, R]>);
10
+ getQuads(property: NamedNode): QuadSet;
11
+ getInverseQuads(property: NamedNode): QuadSet;
12
+ getAll(property: NamedNode): NodeSet;
13
+ getAllInverse(property: NamedNode): NodeSet<NamedNode>;
14
+ getMultipleInverse(properties: ICoreIterable<NamedNode>): NodeSet;
15
+ getMultiple(properties: ICoreIterable<NamedNode>): NodeSet;
16
+ getDeep(property: NamedNode, maxDepth?: number): NodeSet;
17
+ getOneFromPath(...properties: NamedNode[]): Node | undefined;
18
+ getAllFromPath(...properties: NamedNode[]): NodeSet;
19
+ getProperties(includeFromIncomingArcs?: boolean): NodeSet<NamedNode>;
20
+ getInverseProperties(): NodeSet<NamedNode>;
21
+ getOne(property: NamedNode): Node | any;
22
+ getOneInverse(property: NamedNode): NamedNode | any;
23
+ getAllQuads(includeAsObject?: boolean, includeImplicit?: boolean): QuadArray;
24
+ getAllInverseQuads(includeImplicit?: boolean): QuadArray;
25
+ where(property: NamedNode, value: Node): this;
26
+ getWhere(property: NamedNode, value: Node): Node | undefined;
27
+ setEach(property: NamedNode, value: Node): boolean;
28
+ msetEach(property: NamedNode, values: ICoreIterable<Node>): boolean;
29
+ updateEach(property: NamedNode, value: Node): boolean;
30
+ mupdateEach(property: NamedNode, values: ICoreIterable<Node>): boolean;
31
+ unsetEach(property: NamedNode, value: Node): boolean;
32
+ unsetAllEach(property: NamedNode): boolean;
33
+ promiseLoaded(loadInverseProperties?: boolean): Promise<boolean>;
34
+ isLoaded(includingInverseProperties?: boolean): boolean;
35
+ }