@undefineds.co/xpod 0.3.6 → 0.3.15

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 (249) hide show
  1. package/config/cli.json +1 -1
  2. package/config/cloud.json +54 -22
  3. package/config/local.json +56 -12
  4. package/config/resolver.json +10 -2
  5. package/config/xpod.base.json +50 -0
  6. package/config/xpod.json +8 -8
  7. package/dist/agents/config/resolve.js +10 -10
  8. package/dist/agents/config/resolve.js.map +1 -1
  9. package/dist/api/chatkit/index.d.ts +1 -1
  10. package/dist/api/chatkit/index.js.map +1 -1
  11. package/dist/api/chatkit/pod-store.d.ts +14 -11
  12. package/dist/api/chatkit/pod-store.js +114 -78
  13. package/dist/api/chatkit/pod-store.js.map +1 -1
  14. package/dist/api/chatkit/runtime/AcpAgentRuntime.js +1 -1
  15. package/dist/api/chatkit/runtime/AcpAgentRuntime.js.map +1 -1
  16. package/dist/api/chatkit/service.js +1 -1
  17. package/dist/api/chatkit/service.js.map +1 -1
  18. package/dist/api/chatkit/types.d.ts +11 -11
  19. package/dist/api/chatkit/types.js +3 -3
  20. package/dist/api/chatkit/types.js.map +1 -1
  21. package/dist/api/container/cloud.js +0 -8
  22. package/dist/api/container/cloud.js.map +1 -1
  23. package/dist/api/container/index.js +2 -1
  24. package/dist/api/container/index.js.map +1 -1
  25. package/dist/api/container/local.js +0 -7
  26. package/dist/api/container/local.js.map +1 -1
  27. package/dist/api/container/routes.js +3 -17
  28. package/dist/api/container/routes.js.map +1 -1
  29. package/dist/api/container/types.d.ts +0 -2
  30. package/dist/api/container/types.js.map +1 -1
  31. package/dist/api/handlers/PodManagementHandler.d.ts +3 -0
  32. package/dist/api/handlers/PodManagementHandler.js +71 -1
  33. package/dist/api/handlers/PodManagementHandler.js.map +1 -1
  34. package/dist/api/handlers/RunHandler.js +5 -5
  35. package/dist/api/handlers/RunHandler.js.map +1 -1
  36. package/dist/api/runs/AgentRuntimeTypes.d.ts +7 -8
  37. package/dist/api/runs/AgentRuntimeTypes.js.map +1 -1
  38. package/dist/api/runs/InngestRunExecutionBackend.d.ts +2 -2
  39. package/dist/api/runs/ManagedRunWorker.d.ts +1 -1
  40. package/dist/api/runs/ManagedRunWorker.js +6 -6
  41. package/dist/api/runs/ManagedRunWorker.js.map +1 -1
  42. package/dist/api/runs/PiAgentRuntimeDriver.d.ts +16 -1
  43. package/dist/api/runs/PiAgentRuntimeDriver.js +182 -23
  44. package/dist/api/runs/PiAgentRuntimeDriver.js.map +1 -1
  45. package/dist/api/runs/RunStateCenter.d.ts +3 -3
  46. package/dist/api/runs/RunStateCenter.js +13 -13
  47. package/dist/api/runs/RunStateCenter.js.map +1 -1
  48. package/dist/api/runs/store.d.ts +4 -4
  49. package/dist/api/runs/store.js +2 -2
  50. package/dist/api/runs/store.js.map +1 -1
  51. package/dist/api/service/VectorStoreService.d.ts +1 -1
  52. package/dist/api/service/VectorStoreService.js +16 -16
  53. package/dist/api/service/VectorStoreService.js.map +1 -1
  54. package/dist/api/tasks/InngestTaskScheduler.d.ts +4 -4
  55. package/dist/api/tasks/TaskMaterializer.d.ts +3 -3
  56. package/dist/api/tasks/TaskMaterializer.js +11 -11
  57. package/dist/api/tasks/TaskMaterializer.js.map +1 -1
  58. package/dist/api/tasks/TaskService.d.ts +3 -3
  59. package/dist/api/tasks/TaskService.js +11 -7
  60. package/dist/api/tasks/TaskService.js.map +1 -1
  61. package/dist/api/tasks/store.d.ts +10 -4
  62. package/dist/api/tasks/store.js +14 -4
  63. package/dist/api/tasks/store.js.map +1 -1
  64. package/dist/api/workspace/types.d.ts +3 -3
  65. package/dist/api/workspace/types.js +6 -6
  66. package/dist/api/workspace/types.js.map +1 -1
  67. package/dist/cli/commands/config.js +2 -2
  68. package/dist/cli/commands/config.js.map +1 -1
  69. package/dist/cli/commands/start.js +9 -3
  70. package/dist/cli/commands/start.js.map +1 -1
  71. package/dist/components/components.jsonld +8 -2
  72. package/dist/components/context.jsonld +308 -51
  73. package/dist/http/search/SearchHttpHandler.js +8 -8
  74. package/dist/http/search/SearchHttpHandler.js.map +1 -1
  75. package/dist/identity/drizzle/PodLookupRepository.d.ts +11 -1
  76. package/dist/identity/drizzle/PodLookupRepository.js +95 -4
  77. package/dist/identity/drizzle/PodLookupRepository.js.map +1 -1
  78. package/dist/identity/drizzle/db.js +4 -43
  79. package/dist/identity/drizzle/db.js.map +1 -1
  80. package/dist/identity/drizzle/schema.pg.d.ts +0 -5
  81. package/dist/identity/drizzle/schema.pg.js +2 -16
  82. package/dist/identity/drizzle/schema.pg.js.map +1 -1
  83. package/dist/identity/drizzle/schema.sqlite.d.ts +19 -176
  84. package/dist/identity/drizzle/schema.sqlite.js +2 -16
  85. package/dist/identity/drizzle/schema.sqlite.js.map +1 -1
  86. package/dist/identity/oidc/AutoDetectIdentityProviderHandler.d.ts +4 -4
  87. package/dist/identity/oidc/AutoDetectIdentityProviderHandler.js +7 -7
  88. package/dist/identity/oidc/AutoDetectIdentityProviderHandler.js.map +1 -1
  89. package/dist/identity/oidc/AutoDetectIdentityProviderHandler.jsonld +6 -6
  90. package/dist/identity/oidc/AutoDetectOidcHandler.d.ts +4 -4
  91. package/dist/identity/oidc/AutoDetectOidcHandler.js +6 -6
  92. package/dist/identity/oidc/AutoDetectOidcHandler.js.map +1 -1
  93. package/dist/identity/oidc/AutoDetectOidcHandler.jsonld +6 -6
  94. package/dist/identity/oidc/ScopedPickWebIdHandler.d.ts +37 -0
  95. package/dist/identity/oidc/ScopedPickWebIdHandler.js +211 -0
  96. package/dist/identity/oidc/ScopedPickWebIdHandler.js.map +1 -0
  97. package/dist/identity/oidc/ScopedPickWebIdHandler.jsonld +158 -0
  98. package/dist/index.d.ts +12 -2
  99. package/dist/index.js +16 -4
  100. package/dist/index.js.map +1 -1
  101. package/dist/main.js +8 -2
  102. package/dist/main.js.map +1 -1
  103. package/dist/provision/ProvisionPodCreator.d.ts +3 -4
  104. package/dist/provision/ProvisionPodCreator.js +8 -13
  105. package/dist/provision/ProvisionPodCreator.js.map +1 -1
  106. package/dist/provision/ProvisionPodCreator.jsonld +7 -7
  107. package/dist/runtime/Proxy.d.ts +0 -1
  108. package/dist/runtime/Proxy.js +0 -9
  109. package/dist/runtime/Proxy.js.map +1 -1
  110. package/dist/runtime/bootstrap.d.ts +1 -0
  111. package/dist/runtime/bootstrap.js +5 -2
  112. package/dist/runtime/bootstrap.js.map +1 -1
  113. package/dist/runtime/css-process.d.ts +12 -4
  114. package/dist/runtime/css-process.js +61 -14
  115. package/dist/runtime/css-process.js.map +1 -1
  116. package/dist/runtime/oidc-issuer.d.ts +3 -2
  117. package/dist/runtime/oidc-issuer.js +3 -2
  118. package/dist/runtime/oidc-issuer.js.map +1 -1
  119. package/dist/runtime/runtime-types.d.ts +1 -0
  120. package/dist/runtime/runtime-types.js.map +1 -1
  121. package/dist/solidfs/LocalFirstRdfRepresentationResolver.d.ts +21 -0
  122. package/dist/solidfs/LocalFirstRdfRepresentationResolver.js +38 -0
  123. package/dist/solidfs/LocalFirstRdfRepresentationResolver.js.map +1 -0
  124. package/dist/solidfs/LocalSolidFS.d.ts +18 -0
  125. package/dist/solidfs/LocalSolidFS.js +539 -0
  126. package/dist/solidfs/LocalSolidFS.js.map +1 -0
  127. package/dist/solidfs/PodSolidFsHttpClient.d.ts +16 -0
  128. package/dist/solidfs/PodSolidFsHttpClient.js +93 -0
  129. package/dist/solidfs/PodSolidFsHttpClient.js.map +1 -0
  130. package/dist/solidfs/PodSolidFsHydrator.d.ts +27 -0
  131. package/dist/solidfs/PodSolidFsHydrator.js +127 -0
  132. package/dist/solidfs/PodSolidFsHydrator.js.map +1 -0
  133. package/dist/solidfs/PodSolidFsSyncer.d.ts +21 -0
  134. package/dist/solidfs/PodSolidFsSyncer.js +78 -0
  135. package/dist/solidfs/PodSolidFsSyncer.js.map +1 -0
  136. package/dist/solidfs/RdfIndexSolidFsSyncer.d.ts +22 -0
  137. package/dist/solidfs/RdfIndexSolidFsSyncer.js +131 -0
  138. package/dist/solidfs/RdfIndexSolidFsSyncer.js.map +1 -0
  139. package/dist/solidfs/index.d.ts +7 -0
  140. package/dist/solidfs/index.js +24 -0
  141. package/dist/solidfs/index.js.map +1 -0
  142. package/dist/solidfs/types.d.ts +131 -0
  143. package/dist/solidfs/types.js +19 -0
  144. package/dist/solidfs/types.js.map +1 -0
  145. package/dist/storage/RepresentationPartialConvertingStore.js +6 -13
  146. package/dist/storage/RepresentationPartialConvertingStore.js.map +1 -1
  147. package/dist/storage/SparqlUpdateResourceStore.d.ts +4 -0
  148. package/dist/storage/SparqlUpdateResourceStore.js +13 -0
  149. package/dist/storage/SparqlUpdateResourceStore.js.map +1 -1
  150. package/dist/storage/SparqlUpdateResourceStore.jsonld +26 -0
  151. package/dist/storage/accessors/MixDataAccessor.d.ts +85 -4
  152. package/dist/storage/accessors/MixDataAccessor.js +511 -16
  153. package/dist/storage/accessors/MixDataAccessor.js.map +1 -1
  154. package/dist/storage/accessors/MixDataAccessor.jsonld +176 -1
  155. package/dist/storage/accessors/QuintStoreSparqlDataAccessor.d.ts +7 -0
  156. package/dist/storage/accessors/QuintStoreSparqlDataAccessor.js +72 -4
  157. package/dist/storage/accessors/QuintStoreSparqlDataAccessor.js.map +1 -1
  158. package/dist/storage/accessors/QuintStoreSparqlDataAccessor.jsonld +24 -0
  159. package/dist/storage/quint/BaseQuintStore.d.ts +3 -0
  160. package/dist/storage/quint/BaseQuintStore.js +51 -27
  161. package/dist/storage/quint/BaseQuintStore.js.map +1 -1
  162. package/dist/storage/quint/PgQuintStore.d.ts +1 -0
  163. package/dist/storage/quint/PgQuintStore.js +50 -32
  164. package/dist/storage/quint/PgQuintStore.js.map +1 -1
  165. package/dist/storage/quint/PgQuintStore.jsonld +4 -3
  166. package/dist/storage/quint/SqliteQuintStore.d.ts +5 -0
  167. package/dist/storage/quint/SqliteQuintStore.js +100 -0
  168. package/dist/storage/quint/SqliteQuintStore.js.map +1 -1
  169. package/dist/storage/quint/SqliteQuintStore.jsonld +20 -0
  170. package/dist/storage/quint/types.d.ts +16 -0
  171. package/dist/storage/quint/types.js.map +1 -1
  172. package/dist/storage/rdf/Rdf3xTripleIndex.d.ts +55 -0
  173. package/dist/storage/rdf/Rdf3xTripleIndex.js +1235 -0
  174. package/dist/storage/rdf/Rdf3xTripleIndex.js.map +1 -0
  175. package/dist/storage/rdf/RdfContentTypes.d.ts +9 -0
  176. package/dist/storage/rdf/RdfContentTypes.js +79 -0
  177. package/dist/storage/rdf/RdfContentTypes.js.map +1 -0
  178. package/dist/storage/rdf/RdfLocalQueryEngine.d.ts +79 -0
  179. package/dist/storage/rdf/RdfLocalQueryEngine.js +2705 -0
  180. package/dist/storage/rdf/RdfLocalQueryEngine.js.map +1 -0
  181. package/dist/storage/rdf/RdfQuadIndex.d.ts +98 -0
  182. package/dist/storage/rdf/RdfQuadIndex.js +1840 -0
  183. package/dist/storage/rdf/RdfQuadIndex.js.map +1 -0
  184. package/dist/storage/rdf/RdfQuadIndex.jsonld +416 -0
  185. package/dist/storage/rdf/RdfShadowComparator.d.ts +12 -0
  186. package/dist/storage/rdf/RdfShadowComparator.js +47 -0
  187. package/dist/storage/rdf/RdfShadowComparator.js.map +1 -0
  188. package/dist/storage/rdf/RdfSparqlAdapter.d.ts +147 -0
  189. package/dist/storage/rdf/RdfSparqlAdapter.js +2420 -0
  190. package/dist/storage/rdf/RdfSparqlAdapter.js.map +1 -0
  191. package/dist/storage/rdf/RdfSparqlAdapter.jsonld +414 -0
  192. package/dist/storage/rdf/RdfTermDictionary.d.ts +27 -0
  193. package/dist/storage/rdf/RdfTermDictionary.js +352 -0
  194. package/dist/storage/rdf/RdfTermDictionary.js.map +1 -0
  195. package/dist/storage/rdf/RdfTermDictionary.jsonld +114 -0
  196. package/dist/storage/rdf/RdfTermSemantics.d.ts +6 -0
  197. package/dist/storage/rdf/RdfTermSemantics.js +40 -0
  198. package/dist/storage/rdf/RdfTermSemantics.js.map +1 -0
  199. package/dist/storage/rdf/RdfTextIndex.d.ts +23 -0
  200. package/dist/storage/rdf/RdfTextIndex.js +569 -0
  201. package/dist/storage/rdf/RdfTextIndex.js.map +1 -0
  202. package/dist/storage/rdf/RdfVectorIndex.d.ts +22 -0
  203. package/dist/storage/rdf/RdfVectorIndex.js +631 -0
  204. package/dist/storage/rdf/RdfVectorIndex.js.map +1 -0
  205. package/dist/storage/rdf/RdfXmlSerializer.d.ts +2 -0
  206. package/dist/storage/rdf/RdfXmlSerializer.js +123 -0
  207. package/dist/storage/rdf/RdfXmlSerializer.js.map +1 -0
  208. package/dist/storage/rdf/ShadowRdfQuintStore.d.ts +58 -0
  209. package/dist/storage/rdf/ShadowRdfQuintStore.js +202 -0
  210. package/dist/storage/rdf/ShadowRdfQuintStore.js.map +1 -0
  211. package/dist/storage/rdf/ShadowRdfQuintStore.jsonld +308 -0
  212. package/dist/storage/rdf/SolidRdfEngine.d.ts +56 -0
  213. package/dist/storage/rdf/SolidRdfEngine.js +292 -0
  214. package/dist/storage/rdf/SolidRdfEngine.js.map +1 -0
  215. package/dist/storage/rdf/SolidRdfEngine.jsonld +372 -0
  216. package/dist/storage/rdf/SolidRdfSparqlEngine.d.ts +92 -0
  217. package/dist/storage/rdf/SolidRdfSparqlEngine.js +477 -0
  218. package/dist/storage/rdf/SolidRdfSparqlEngine.js.map +1 -0
  219. package/dist/storage/rdf/SolidRdfSparqlEngine.jsonld +257 -0
  220. package/dist/storage/rdf/index.d.ts +15 -0
  221. package/dist/storage/rdf/index.js +61 -0
  222. package/dist/storage/rdf/index.js.map +1 -0
  223. package/dist/storage/rdf/models-benchmark.d.ts +260 -0
  224. package/dist/storage/rdf/models-benchmark.js +1405 -0
  225. package/dist/storage/rdf/models-benchmark.js.map +1 -0
  226. package/dist/storage/rdf/types.d.ts +726 -0
  227. package/dist/storage/rdf/types.js +3 -0
  228. package/dist/storage/rdf/types.js.map +1 -0
  229. package/dist/storage/rdf/types.jsonld +316 -0
  230. package/dist/storage/vector/VectorIndexingListener.d.ts +5 -5
  231. package/dist/storage/vector/VectorIndexingListener.js +19 -19
  232. package/dist/storage/vector/VectorIndexingListener.js.map +1 -1
  233. package/package.json +3 -2
  234. package/templates/pod/acp/.acr.hbs +39 -0
  235. package/templates/pod/acp/README.acr +18 -0
  236. package/templates/pod/acp/profile/card.acr +22 -0
  237. package/templates/pod/base/README$.md.hbs +27 -0
  238. package/templates/pod/base/profile/card$.ttl.hbs +13 -0
  239. package/templates/pod/wac/.acl.hbs +26 -0
  240. package/templates/pod/wac/README.acl.hbs +14 -0
  241. package/templates/pod/wac/profile/card.acl.hbs +19 -0
  242. package/dist/api/handlers/WebIdProfileHandler.d.ts +0 -16
  243. package/dist/api/handlers/WebIdProfileHandler.js +0 -423
  244. package/dist/api/handlers/WebIdProfileHandler.js.map +0 -1
  245. package/dist/identity/drizzle/WebIdProfileRepository.d.ts +0 -63
  246. package/dist/identity/drizzle/WebIdProfileRepository.js +0 -168
  247. package/dist/identity/drizzle/WebIdProfileRepository.js.map +0 -1
  248. package/dist/identity/drizzle/WebIdProfileRepository.jsonld +0 -112
  249. package/dist/storage/quint/BaseQuintStore.jsonld +0 -257
@@ -0,0 +1,308 @@
1
+ {
2
+ "@context": [
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@undefineds.co/xpod/^0.0.0/components/context.jsonld"
4
+ ],
5
+ "@id": "npmd:@undefineds.co/xpod",
6
+ "components": [
7
+ {
8
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStoreOptions",
9
+ "@type": "AbstractClass",
10
+ "requireElement": "ShadowRdfQuintStoreOptions",
11
+ "parameters": [],
12
+ "memberFields": [
13
+ {
14
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStoreOptions__member_compatibilityStore",
15
+ "memberFieldName": "compatibilityStore"
16
+ },
17
+ {
18
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStoreOptions__member_index",
19
+ "memberFieldName": "index"
20
+ },
21
+ {
22
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStoreOptions__member_autoOpen",
23
+ "memberFieldName": "autoOpen"
24
+ },
25
+ {
26
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStoreOptions__member_autoBackfill",
27
+ "memberFieldName": "autoBackfill"
28
+ }
29
+ ],
30
+ "constructorArguments": []
31
+ },
32
+ {
33
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore",
34
+ "@type": "Class",
35
+ "requireElement": "ShadowRdfQuintStore",
36
+ "extends": [
37
+ "undefineds:dist/storage/quint/types.jsonld#QuintStore"
38
+ ],
39
+ "comment": "Shadow-first bridge from the existing TEXT QuintStore to the term-id RDF index. Reads keep using the compatibility store. Writes are mirrored into RdfQuadIndex so callers can run explicit shadow comparisons before any query path is switched to SolidRdfEngine.",
40
+ "parameters": [
41
+ {
42
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_compatibilityStore",
43
+ "range": "undefineds:dist/storage/quint/types.jsonld#QuintStore"
44
+ },
45
+ {
46
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_index_path",
47
+ "range": "xsd:string"
48
+ },
49
+ {
50
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_index_debug",
51
+ "range": {
52
+ "@type": "ParameterRangeUnion",
53
+ "parameterRangeElements": [
54
+ "xsd:boolean",
55
+ {
56
+ "@type": "ParameterRangeUndefined"
57
+ }
58
+ ]
59
+ }
60
+ },
61
+ {
62
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_autoOpen",
63
+ "range": {
64
+ "@type": "ParameterRangeUnion",
65
+ "parameterRangeElements": [
66
+ "xsd:boolean",
67
+ {
68
+ "@type": "ParameterRangeUndefined"
69
+ }
70
+ ]
71
+ }
72
+ },
73
+ {
74
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_autoBackfill_enabled",
75
+ "range": {
76
+ "@type": "ParameterRangeUnion",
77
+ "parameterRangeElements": [
78
+ "xsd:boolean",
79
+ {
80
+ "@type": "ParameterRangeUndefined"
81
+ }
82
+ ]
83
+ }
84
+ },
85
+ {
86
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_autoBackfill_clear",
87
+ "range": {
88
+ "@type": "ParameterRangeUnion",
89
+ "parameterRangeElements": [
90
+ "xsd:boolean",
91
+ {
92
+ "@type": "ParameterRangeUndefined"
93
+ }
94
+ ]
95
+ }
96
+ },
97
+ {
98
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_autoBackfill_batchSize",
99
+ "range": {
100
+ "@type": "ParameterRangeUnion",
101
+ "parameterRangeElements": [
102
+ "xsd:number",
103
+ {
104
+ "@type": "ParameterRangeUndefined"
105
+ }
106
+ ]
107
+ }
108
+ }
109
+ ],
110
+ "memberFields": [
111
+ {
112
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_index",
113
+ "memberFieldName": "index",
114
+ "range": "undefineds:dist/storage/rdf/RdfQuadIndex.jsonld#RdfQuadIndex"
115
+ },
116
+ {
117
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_compatibilityStore",
118
+ "memberFieldName": "compatibilityStore"
119
+ },
120
+ {
121
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_ownsIndex",
122
+ "memberFieldName": "ownsIndex"
123
+ },
124
+ {
125
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_comparator",
126
+ "memberFieldName": "comparator"
127
+ },
128
+ {
129
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_autoBackfill",
130
+ "memberFieldName": "autoBackfill"
131
+ },
132
+ {
133
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_opened",
134
+ "memberFieldName": "opened"
135
+ },
136
+ {
137
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_opening",
138
+ "memberFieldName": "opening"
139
+ },
140
+ {
141
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_autoBackfilled",
142
+ "memberFieldName": "autoBackfilled"
143
+ },
144
+ {
145
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_constructor",
146
+ "memberFieldName": "constructor"
147
+ },
148
+ {
149
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_open",
150
+ "memberFieldName": "open"
151
+ },
152
+ {
153
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_openOnce",
154
+ "memberFieldName": "openOnce"
155
+ },
156
+ {
157
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_close",
158
+ "memberFieldName": "close"
159
+ },
160
+ {
161
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_get",
162
+ "memberFieldName": "get"
163
+ },
164
+ {
165
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_match",
166
+ "memberFieldName": "match"
167
+ },
168
+ {
169
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_getByGraphPrefix",
170
+ "memberFieldName": "getByGraphPrefix"
171
+ },
172
+ {
173
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_count",
174
+ "memberFieldName": "count"
175
+ },
176
+ {
177
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_getCompound",
178
+ "memberFieldName": "getCompound"
179
+ },
180
+ {
181
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_getAttributes",
182
+ "memberFieldName": "getAttributes"
183
+ },
184
+ {
185
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_put",
186
+ "memberFieldName": "put"
187
+ },
188
+ {
189
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_multiPut",
190
+ "memberFieldName": "multiPut"
191
+ },
192
+ {
193
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_replaceSource",
194
+ "memberFieldName": "replaceSource"
195
+ },
196
+ {
197
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_deleteSource",
198
+ "memberFieldName": "deleteSource"
199
+ },
200
+ {
201
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_updateEmbedding",
202
+ "memberFieldName": "updateEmbedding"
203
+ },
204
+ {
205
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_del",
206
+ "memberFieldName": "del"
207
+ },
208
+ {
209
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_multiDel",
210
+ "memberFieldName": "multiDel"
211
+ },
212
+ {
213
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_stats",
214
+ "memberFieldName": "stats"
215
+ },
216
+ {
217
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_clear",
218
+ "memberFieldName": "clear"
219
+ },
220
+ {
221
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_backfillShadowIndex",
222
+ "memberFieldName": "backfillShadowIndex"
223
+ },
224
+ {
225
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_shadowGet",
226
+ "memberFieldName": "shadowGet"
227
+ },
228
+ {
229
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_runAutoBackfill",
230
+ "memberFieldName": "runAutoBackfill"
231
+ },
232
+ {
233
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_shouldAutoBackfill",
234
+ "memberFieldName": "shouldAutoBackfill"
235
+ },
236
+ {
237
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore__member_autoBackfillOptions",
238
+ "memberFieldName": "autoBackfillOptions"
239
+ }
240
+ ],
241
+ "constructorArguments": [
242
+ {
243
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options__constructorArgument",
244
+ "fields": [
245
+ {
246
+ "keyRaw": "compatibilityStore",
247
+ "value": {
248
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_compatibilityStore"
249
+ }
250
+ },
251
+ {
252
+ "keyRaw": "index",
253
+ "value": {
254
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_index__constructorArgument",
255
+ "fields": [
256
+ {
257
+ "keyRaw": "path",
258
+ "value": {
259
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_index_path"
260
+ }
261
+ },
262
+ {
263
+ "keyRaw": "debug",
264
+ "value": {
265
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_index_debug"
266
+ }
267
+ }
268
+ ]
269
+ }
270
+ },
271
+ {
272
+ "keyRaw": "autoOpen",
273
+ "value": {
274
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_autoOpen"
275
+ }
276
+ },
277
+ {
278
+ "keyRaw": "autoBackfill",
279
+ "value": {
280
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_autoBackfill__constructorArgument",
281
+ "fields": [
282
+ {
283
+ "keyRaw": "enabled",
284
+ "value": {
285
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_autoBackfill_enabled"
286
+ }
287
+ },
288
+ {
289
+ "keyRaw": "clear",
290
+ "value": {
291
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_autoBackfill_clear"
292
+ }
293
+ },
294
+ {
295
+ "keyRaw": "batchSize",
296
+ "value": {
297
+ "@id": "undefineds:dist/storage/rdf/ShadowRdfQuintStore.jsonld#ShadowRdfQuintStore_options_autoBackfill_batchSize"
298
+ }
299
+ }
300
+ ]
301
+ }
302
+ }
303
+ ]
304
+ }
305
+ ]
306
+ }
307
+ ]
308
+ }
@@ -0,0 +1,56 @@
1
+ import type { Quad } from '@rdfjs/types';
2
+ import type { QuintPattern, QuintStore } from '../quint/types';
3
+ import type { Rdf3xShadowJoinResult, Rdf3xShadowScanResult, Rdf3xTripleIndexOptions, RdfIndexPutOptions, RdfPatternQuery, RdfQuadJoinOptions, RdfQuadJoinPattern, RdfQuadIndexOptions, RdfQuadIndexScanResult, RdfSourceInput, RdfShadowScanResult, RdfTextChunkInput, RdfTextIndexOptions, RdfTextSearchOptions, RdfTextSearchResult, RdfTextSourceInput, RdfVectorChunkInput, RdfVectorIndexOptions, RdfVectorSearchOptions, RdfVectorSearchResult, RdfVectorSourceInput } from './types';
4
+ import { RdfQuadIndex } from './RdfQuadIndex';
5
+ import { Rdf3xTripleIndex } from './Rdf3xTripleIndex';
6
+ import { RdfTextIndex } from './RdfTextIndex';
7
+ import { RdfVectorIndex } from './RdfVectorIndex';
8
+ import type { RdfLocalQuery, RdfLocalQueryResult } from './types';
9
+ export interface SolidRdfEngineOptions {
10
+ index: RdfQuadIndex | RdfQuadIndexOptions;
11
+ textIndex?: RdfTextIndex | RdfTextIndexOptions;
12
+ vectorIndex?: RdfVectorIndex | RdfVectorIndexOptions;
13
+ rdf3xIndex?: Rdf3xTripleIndex | Rdf3xTripleIndexOptions;
14
+ rdf3xPrimary?: boolean;
15
+ compatibilityStore?: QuintStore;
16
+ autoOpen?: boolean;
17
+ }
18
+ export declare class SolidRdfEngine {
19
+ readonly index: RdfQuadIndex;
20
+ readonly textIndex?: RdfTextIndex;
21
+ readonly vectorIndex?: RdfVectorIndex;
22
+ readonly rdf3xIndex?: Rdf3xTripleIndex;
23
+ private readonly ownsIndex;
24
+ private readonly ownsTextIndex;
25
+ private readonly ownsVectorIndex;
26
+ private readonly ownsRdf3xIndex;
27
+ private readonly rdf3xPrimary;
28
+ private readonly compatibilityStore?;
29
+ private shadowComparator?;
30
+ private readonly queryEngine;
31
+ private rdf3xDirty;
32
+ constructor(options: SolidRdfEngineOptions);
33
+ open(): void;
34
+ close(): Promise<void>;
35
+ put(quads: Quad | Quad[], options?: RdfIndexPutOptions): void;
36
+ replaceSource(quads: Quad[], source: RdfSourceInput): void;
37
+ deleteSource(source: string): number;
38
+ delete(pattern: QuintPattern): number;
39
+ scan(query: RdfPatternQuery): RdfQuadIndexScanResult;
40
+ query(query: RdfLocalQuery): RdfLocalQueryResult;
41
+ indexTextSource(source: RdfTextSourceInput, text: string, chunks?: RdfTextChunkInput[]): void;
42
+ deleteTextSource(source: string): number;
43
+ searchText(options: RdfTextSearchOptions | string): RdfTextSearchResult[];
44
+ indexVectorSource(source: RdfVectorSourceInput, chunks: RdfVectorChunkInput[]): void;
45
+ deleteVectorSource(source: string): number;
46
+ searchVector(options: RdfVectorSearchOptions): RdfVectorSearchResult[];
47
+ shadowScan(query: RdfPatternQuery): Promise<RdfShadowScanResult>;
48
+ shadowRdf3xScan(query: RdfPatternQuery): Rdf3xShadowScanResult;
49
+ shadowRdf3xJoin(patterns: RdfQuadJoinPattern[], options?: RdfQuadJoinOptions): Rdf3xShadowJoinResult;
50
+ supportsPrimary(query: RdfPatternQuery): boolean;
51
+ private requireTextIndex;
52
+ private requireVectorIndex;
53
+ private requireRdf3xIndex;
54
+ private markRdf3xDirty;
55
+ private refreshRdf3xPrimary;
56
+ }
@@ -0,0 +1,292 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SolidRdfEngine = void 0;
4
+ const n3_1 = require("n3");
5
+ const types_1 = require("../quint/types");
6
+ const RdfQuadIndex_1 = require("./RdfQuadIndex");
7
+ const Rdf3xTripleIndex_1 = require("./Rdf3xTripleIndex");
8
+ const RdfTextIndex_1 = require("./RdfTextIndex");
9
+ const RdfVectorIndex_1 = require("./RdfVectorIndex");
10
+ const RdfShadowComparator_1 = require("./RdfShadowComparator");
11
+ const RdfLocalQueryEngine_1 = require("./RdfLocalQueryEngine");
12
+ class SolidRdfEngine {
13
+ constructor(options) {
14
+ this.rdf3xDirty = true;
15
+ if (options.index instanceof RdfQuadIndex_1.RdfQuadIndex) {
16
+ this.index = options.index;
17
+ this.ownsIndex = false;
18
+ }
19
+ else {
20
+ this.index = new RdfQuadIndex_1.RdfQuadIndex(options.index);
21
+ this.ownsIndex = true;
22
+ }
23
+ if (options.textIndex instanceof RdfTextIndex_1.RdfTextIndex) {
24
+ this.textIndex = options.textIndex;
25
+ this.ownsTextIndex = false;
26
+ }
27
+ else if (isRdfTextIndexOptions(options.textIndex)) {
28
+ this.textIndex = new RdfTextIndex_1.RdfTextIndex(options.textIndex);
29
+ this.ownsTextIndex = true;
30
+ }
31
+ else {
32
+ this.ownsTextIndex = false;
33
+ }
34
+ if (options.vectorIndex instanceof RdfVectorIndex_1.RdfVectorIndex) {
35
+ this.vectorIndex = options.vectorIndex;
36
+ this.ownsVectorIndex = false;
37
+ }
38
+ else if (isRdfVectorIndexOptions(options.vectorIndex)) {
39
+ this.vectorIndex = new RdfVectorIndex_1.RdfVectorIndex(options.vectorIndex);
40
+ this.ownsVectorIndex = true;
41
+ }
42
+ else {
43
+ this.ownsVectorIndex = false;
44
+ }
45
+ if (options.rdf3xIndex instanceof Rdf3xTripleIndex_1.Rdf3xTripleIndex) {
46
+ this.rdf3xIndex = options.rdf3xIndex;
47
+ this.ownsRdf3xIndex = false;
48
+ }
49
+ else if (isRdf3xTripleIndexOptions(options.rdf3xIndex)) {
50
+ this.rdf3xIndex = new Rdf3xTripleIndex_1.Rdf3xTripleIndex(options.rdf3xIndex);
51
+ this.ownsRdf3xIndex = true;
52
+ }
53
+ else {
54
+ this.ownsRdf3xIndex = false;
55
+ }
56
+ if (options.rdf3xPrimary && !this.rdf3xIndex) {
57
+ throw new Error('SolidRdfEngine rdf3xPrimary requires an rdf3xIndex');
58
+ }
59
+ this.rdf3xPrimary = Boolean(options.rdf3xPrimary);
60
+ this.compatibilityStore = options.compatibilityStore;
61
+ this.queryEngine = new RdfLocalQueryEngine_1.RdfLocalQueryEngine(this.index, this.textIndex, this.vectorIndex, this.rdf3xPrimary ? this.rdf3xIndex : undefined);
62
+ if (this.compatibilityStore) {
63
+ this.shadowComparator = new RdfShadowComparator_1.RdfShadowComparator(this.index, this.compatibilityStore);
64
+ }
65
+ if (options.autoOpen) {
66
+ this.open();
67
+ }
68
+ }
69
+ open() {
70
+ this.index.open();
71
+ this.textIndex?.open();
72
+ this.vectorIndex?.open();
73
+ this.rdf3xIndex?.open();
74
+ }
75
+ async close() {
76
+ if (this.ownsRdf3xIndex) {
77
+ this.rdf3xIndex?.close();
78
+ }
79
+ if (this.ownsVectorIndex) {
80
+ this.vectorIndex?.close();
81
+ }
82
+ if (this.ownsTextIndex) {
83
+ this.textIndex?.close();
84
+ }
85
+ if (this.ownsIndex) {
86
+ this.index.close();
87
+ }
88
+ if (this.compatibilityStore) {
89
+ await this.compatibilityStore.close();
90
+ }
91
+ }
92
+ put(quads, options) {
93
+ this.index.multiPut(Array.isArray(quads) ? quads : [quads], options);
94
+ this.markRdf3xDirty();
95
+ }
96
+ replaceSource(quads, source) {
97
+ this.index.replaceSource(quads, source);
98
+ this.markRdf3xDirty();
99
+ }
100
+ deleteSource(source) {
101
+ const changes = this.index.deleteSource(source);
102
+ if (changes > 0) {
103
+ this.markRdf3xDirty();
104
+ }
105
+ return changes;
106
+ }
107
+ delete(pattern) {
108
+ const changes = this.index.delete(pattern);
109
+ if (changes > 0) {
110
+ this.markRdf3xDirty();
111
+ }
112
+ return changes;
113
+ }
114
+ scan(query) {
115
+ return this.index.scan(query.pattern, query.options);
116
+ }
117
+ query(query) {
118
+ this.refreshRdf3xPrimary();
119
+ return this.queryEngine.query(query);
120
+ }
121
+ indexTextSource(source, text, chunks) {
122
+ this.requireTextIndex().indexText(source, text, chunks);
123
+ }
124
+ deleteTextSource(source) {
125
+ return this.requireTextIndex().deleteSource(source);
126
+ }
127
+ searchText(options) {
128
+ return this.requireTextIndex().search(typeof options === 'string' ? { query: options } : options);
129
+ }
130
+ indexVectorSource(source, chunks) {
131
+ this.requireVectorIndex().indexVector(source, chunks);
132
+ }
133
+ deleteVectorSource(source) {
134
+ return this.requireVectorIndex().deleteSource(source);
135
+ }
136
+ searchVector(options) {
137
+ return this.requireVectorIndex().search(options);
138
+ }
139
+ async shadowScan(query) {
140
+ if (!this.shadowComparator) {
141
+ throw new Error('SolidRdfEngine shadowScan requires a compatibility QuintStore');
142
+ }
143
+ return this.shadowComparator.compareScan(query);
144
+ }
145
+ shadowRdf3xScan(query) {
146
+ const rdf3xIndex = this.requireRdf3xIndex();
147
+ const rdf3xPattern = toRdf3xTriplePattern(query.pattern);
148
+ const rebuild = rdf3xIndex.rebuildFromCurrentQuads();
149
+ const primary = this.index.scan(query.pattern, query.options);
150
+ const rdf3x = rdf3xIndex.scan(rdf3xPattern, query.options);
151
+ const diff = (0, RdfShadowComparator_1.diffQuads)(rdf3x.quads, primary.quads);
152
+ const orderedMatch = canonicalQuadKeys(primary.quads).join('\n') === canonicalQuadKeys(rdf3x.quads).join('\n');
153
+ return {
154
+ matched: diff.missingFromPrimary.length === 0 && diff.extraInPrimary.length === 0,
155
+ orderedMatch,
156
+ primary: primary.quads,
157
+ rdf3x: rdf3x.quads,
158
+ diff: {
159
+ missingFromRdf3x: diff.extraInPrimary,
160
+ extraInRdf3x: diff.missingFromPrimary,
161
+ },
162
+ primaryMetrics: primary.metrics,
163
+ rdf3xMetrics: rdf3x.metrics,
164
+ rebuild,
165
+ };
166
+ }
167
+ shadowRdf3xJoin(patterns, options) {
168
+ const rdf3xIndex = this.requireRdf3xIndex();
169
+ const rebuild = rdf3xIndex.rebuildFromCurrentQuads();
170
+ const primary = this.index.joinPatterns(patterns, options);
171
+ const rdf3x = rdf3xIndex.joinPatterns(patterns, options);
172
+ const primaryKeys = primary.bindings.map(canonicalBindingKey);
173
+ const rdf3xKeys = rdf3x.bindings.map(canonicalBindingKey);
174
+ const diff = diffBindingKeys(rdf3xKeys, primaryKeys);
175
+ return {
176
+ matched: diff.missingFromRdf3x.length === 0 && diff.extraInRdf3x.length === 0,
177
+ orderedMatch: primaryKeys.join('\n') === rdf3xKeys.join('\n'),
178
+ primary: primary.bindings,
179
+ rdf3x: rdf3x.bindings,
180
+ diff,
181
+ primaryMetrics: primary.metrics,
182
+ rdf3xMetrics: rdf3x.metrics,
183
+ rebuild,
184
+ };
185
+ }
186
+ supportsPrimary(query) {
187
+ try {
188
+ this.index.scan(query.pattern, { ...query.options, limit: 0 });
189
+ return true;
190
+ }
191
+ catch {
192
+ return false;
193
+ }
194
+ }
195
+ requireTextIndex() {
196
+ if (!this.textIndex) {
197
+ throw new Error('SolidRdfEngine text index is not configured');
198
+ }
199
+ return this.textIndex;
200
+ }
201
+ requireVectorIndex() {
202
+ if (!this.vectorIndex) {
203
+ throw new Error('SolidRdfEngine vector index is not configured');
204
+ }
205
+ return this.vectorIndex;
206
+ }
207
+ requireRdf3xIndex() {
208
+ if (!this.rdf3xIndex) {
209
+ throw new Error('SolidRdfEngine RDF-3X shadow index is not configured');
210
+ }
211
+ return this.rdf3xIndex;
212
+ }
213
+ markRdf3xDirty() {
214
+ if (this.rdf3xIndex) {
215
+ this.rdf3xDirty = true;
216
+ }
217
+ }
218
+ refreshRdf3xPrimary() {
219
+ if (!this.rdf3xPrimary || !this.rdf3xDirty) {
220
+ return;
221
+ }
222
+ this.requireRdf3xIndex().rebuildFromCurrentQuads();
223
+ this.rdf3xDirty = false;
224
+ }
225
+ }
226
+ exports.SolidRdfEngine = SolidRdfEngine;
227
+ function isRdfTextIndexOptions(input) {
228
+ return input !== undefined && !(input instanceof RdfTextIndex_1.RdfTextIndex) && typeof input.path === 'string';
229
+ }
230
+ function isRdfVectorIndexOptions(input) {
231
+ return input !== undefined && !(input instanceof RdfVectorIndex_1.RdfVectorIndex) && typeof input.path === 'string';
232
+ }
233
+ function isRdf3xTripleIndexOptions(input) {
234
+ return input !== undefined && !(input instanceof Rdf3xTripleIndex_1.Rdf3xTripleIndex) && typeof input.path === 'string';
235
+ }
236
+ function canonicalQuadKeys(quads) {
237
+ return quads.map((quad) => [
238
+ (0, n3_1.termToId)(quad.graph),
239
+ (0, n3_1.termToId)(quad.subject),
240
+ (0, n3_1.termToId)(quad.predicate),
241
+ (0, n3_1.termToId)(quad.object),
242
+ ].join('\u001f'));
243
+ }
244
+ function canonicalBindingKey(binding) {
245
+ return Object.keys(binding)
246
+ .sort()
247
+ .map((key) => `${key}=${(0, n3_1.termToId)(binding[key])}`)
248
+ .join('\u001f');
249
+ }
250
+ function diffBindingKeys(rdf3xKeys, primaryKeys) {
251
+ const rdf3xSet = new Set(rdf3xKeys);
252
+ const primarySet = new Set(primaryKeys);
253
+ return {
254
+ missingFromRdf3x: Array.from(primarySet).filter((key) => !rdf3xSet.has(key)).sort(),
255
+ extraInRdf3x: Array.from(rdf3xSet).filter((key) => !primarySet.has(key)).sort(),
256
+ };
257
+ }
258
+ function toRdf3xTriplePattern(pattern) {
259
+ const result = {};
260
+ for (const key of ['graph', 'subject', 'predicate', 'object']) {
261
+ const value = pattern[key];
262
+ if (!value) {
263
+ continue;
264
+ }
265
+ if (!(0, types_1.isTerm)(value)) {
266
+ if (key === 'graph' && isStartsWithOperator(value)) {
267
+ result.graph = { $startsWith: value.$startsWith };
268
+ continue;
269
+ }
270
+ if (key === 'object' && isNumericObjectRangeOperator(value)) {
271
+ result.object = value;
272
+ continue;
273
+ }
274
+ throw new Error(`SolidRdfEngine RDF-3X shadow scan only supports exact ${key} terms${key === 'graph' ? ' or graph $startsWith' : ''}`);
275
+ }
276
+ result[key] = value;
277
+ }
278
+ return result;
279
+ }
280
+ function isStartsWithOperator(value) {
281
+ return value !== null
282
+ && typeof value === 'object'
283
+ && '$startsWith' in value
284
+ && typeof value.$startsWith === 'string';
285
+ }
286
+ function isNumericObjectRangeOperator(value) {
287
+ return value !== null
288
+ && typeof value === 'object'
289
+ && !('termType' in value)
290
+ && ['$gt', '$gte', '$lt', '$lte'].some((operator) => operator in value);
291
+ }
292
+ //# sourceMappingURL=SolidRdfEngine.js.map