@_linked/core 2.12.0 → 2.13.0-next.20260706164859

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 (246) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/esm/queries/IRPipeline.d.ts +7 -1
  3. package/lib/esm/queries/IRPipeline.js +20 -6
  4. package/lib/esm/queries/IRPipeline.js.map +1 -1
  5. package/lib/esm/queries/queryDispatch.js +12 -2
  6. package/lib/esm/queries/queryDispatch.js.map +1 -1
  7. package/package.json +10 -13
  8. package/lib/cjs/collections/CoreSet.d.ts +0 -47
  9. package/lib/cjs/collections/CoreSet.js +0 -136
  10. package/lib/cjs/collections/CoreSet.js.map +0 -1
  11. package/lib/cjs/collections/ShapeSet.d.ts +0 -6
  12. package/lib/cjs/collections/ShapeSet.js +0 -20
  13. package/lib/cjs/collections/ShapeSet.js.map +0 -1
  14. package/lib/cjs/expressions/Expr.d.ts +0 -29
  15. package/lib/cjs/expressions/Expr.js +0 -80
  16. package/lib/cjs/expressions/Expr.js.map +0 -1
  17. package/lib/cjs/expressions/ExpressionMethods.d.ts +0 -85
  18. package/lib/cjs/expressions/ExpressionMethods.js +0 -3
  19. package/lib/cjs/expressions/ExpressionMethods.js.map +0 -1
  20. package/lib/cjs/expressions/ExpressionNode.d.ts +0 -144
  21. package/lib/cjs/expressions/ExpressionNode.js +0 -432
  22. package/lib/cjs/expressions/ExpressionNode.js.map +0 -1
  23. package/lib/cjs/index.d.ts +0 -29
  24. package/lib/cjs/index.js +0 -65
  25. package/lib/cjs/index.js.map +0 -1
  26. package/lib/cjs/interfaces/ICoreIterable.d.ts +0 -14
  27. package/lib/cjs/interfaces/ICoreIterable.js +0 -3
  28. package/lib/cjs/interfaces/ICoreIterable.js.map +0 -1
  29. package/lib/cjs/interfaces/IDataset.d.ts +0 -26
  30. package/lib/cjs/interfaces/IDataset.js +0 -3
  31. package/lib/cjs/interfaces/IDataset.js.map +0 -1
  32. package/lib/cjs/interfaces/IFileStore.d.ts +0 -16
  33. package/lib/cjs/interfaces/IFileStore.js +0 -3
  34. package/lib/cjs/interfaces/IFileStore.js.map +0 -1
  35. package/lib/cjs/ontologies/linked-core.d.ts +0 -15
  36. package/lib/cjs/ontologies/linked-core.js +0 -38
  37. package/lib/cjs/ontologies/linked-core.js.map +0 -1
  38. package/lib/cjs/ontologies/npm.d.ts +0 -6
  39. package/lib/cjs/ontologies/npm.js +0 -15
  40. package/lib/cjs/ontologies/npm.js.map +0 -1
  41. package/lib/cjs/ontologies/owl.d.ts +0 -14
  42. package/lib/cjs/ontologies/owl.js +0 -21
  43. package/lib/cjs/ontologies/owl.js.map +0 -1
  44. package/lib/cjs/ontologies/rdf.d.ts +0 -13
  45. package/lib/cjs/ontologies/rdf.js +0 -27
  46. package/lib/cjs/ontologies/rdf.js.map +0 -1
  47. package/lib/cjs/ontologies/rdfs.d.ts +0 -16
  48. package/lib/cjs/ontologies/rdfs.js +0 -33
  49. package/lib/cjs/ontologies/rdfs.js.map +0 -1
  50. package/lib/cjs/ontologies/shacl.d.ts +0 -103
  51. package/lib/cjs/ontologies/shacl.js +0 -152
  52. package/lib/cjs/ontologies/shacl.js.map +0 -1
  53. package/lib/cjs/ontologies/xsd.d.ts +0 -19
  54. package/lib/cjs/ontologies/xsd.js +0 -41
  55. package/lib/cjs/ontologies/xsd.js.map +0 -1
  56. package/lib/cjs/package.d.ts +0 -4
  57. package/lib/cjs/package.js +0 -6
  58. package/lib/cjs/package.js.map +0 -1
  59. package/lib/cjs/package.json +0 -9
  60. package/lib/cjs/paths/PropertyPathExpr.d.ts +0 -38
  61. package/lib/cjs/paths/PropertyPathExpr.js +0 -221
  62. package/lib/cjs/paths/PropertyPathExpr.js.map +0 -1
  63. package/lib/cjs/paths/normalizePropertyPath.d.ts +0 -23
  64. package/lib/cjs/paths/normalizePropertyPath.js +0 -75
  65. package/lib/cjs/paths/normalizePropertyPath.js.map +0 -1
  66. package/lib/cjs/paths/pathExprToSparql.d.ts +0 -14
  67. package/lib/cjs/paths/pathExprToSparql.js +0 -136
  68. package/lib/cjs/paths/pathExprToSparql.js.map +0 -1
  69. package/lib/cjs/queries/ContextRef.d.ts +0 -32
  70. package/lib/cjs/queries/ContextRef.js +0 -69
  71. package/lib/cjs/queries/ContextRef.js.map +0 -1
  72. package/lib/cjs/queries/CreateBuilder.d.ts +0 -59
  73. package/lib/cjs/queries/CreateBuilder.js +0 -138
  74. package/lib/cjs/queries/CreateBuilder.js.map +0 -1
  75. package/lib/cjs/queries/CreateQuery.d.ts +0 -20
  76. package/lib/cjs/queries/CreateQuery.js +0 -3
  77. package/lib/cjs/queries/CreateQuery.js.map +0 -1
  78. package/lib/cjs/queries/DeleteBuilder.d.ts +0 -56
  79. package/lib/cjs/queries/DeleteBuilder.js +0 -172
  80. package/lib/cjs/queries/DeleteBuilder.js.map +0 -1
  81. package/lib/cjs/queries/DeleteQuery.d.ts +0 -37
  82. package/lib/cjs/queries/DeleteQuery.js +0 -3
  83. package/lib/cjs/queries/DeleteQuery.js.map +0 -1
  84. package/lib/cjs/queries/DslJsonExpression.d.ts +0 -68
  85. package/lib/cjs/queries/DslJsonExpression.js +0 -427
  86. package/lib/cjs/queries/DslJsonExpression.js.map +0 -1
  87. package/lib/cjs/queries/FieldSet.d.ts +0 -310
  88. package/lib/cjs/queries/FieldSet.js +0 -802
  89. package/lib/cjs/queries/FieldSet.js.map +0 -1
  90. package/lib/cjs/queries/IRAliasScope.d.ts +0 -20
  91. package/lib/cjs/queries/IRAliasScope.js +0 -52
  92. package/lib/cjs/queries/IRAliasScope.js.map +0 -1
  93. package/lib/cjs/queries/IRCanonicalize.d.ts +0 -19
  94. package/lib/cjs/queries/IRCanonicalize.js +0 -19
  95. package/lib/cjs/queries/IRCanonicalize.js.map +0 -1
  96. package/lib/cjs/queries/IRDesugar.d.ts +0 -123
  97. package/lib/cjs/queries/IRDesugar.js +0 -261
  98. package/lib/cjs/queries/IRDesugar.js.map +0 -1
  99. package/lib/cjs/queries/IRLower.d.ts +0 -25
  100. package/lib/cjs/queries/IRLower.js +0 -398
  101. package/lib/cjs/queries/IRLower.js.map +0 -1
  102. package/lib/cjs/queries/IRMutation.d.ts +0 -53
  103. package/lib/cjs/queries/IRMutation.js +0 -130
  104. package/lib/cjs/queries/IRMutation.js.map +0 -1
  105. package/lib/cjs/queries/IRPipeline.d.ts +0 -8
  106. package/lib/cjs/queries/IRPipeline.js +0 -25
  107. package/lib/cjs/queries/IRPipeline.js.map +0 -1
  108. package/lib/cjs/queries/IRProjection.d.ts +0 -39
  109. package/lib/cjs/queries/IRProjection.js +0 -105
  110. package/lib/cjs/queries/IRProjection.js.map +0 -1
  111. package/lib/cjs/queries/IntermediateRepresentation.d.ts +0 -282
  112. package/lib/cjs/queries/IntermediateRepresentation.js +0 -3
  113. package/lib/cjs/queries/IntermediateRepresentation.js.map +0 -1
  114. package/lib/cjs/queries/MutationQuery.d.ts +0 -50
  115. package/lib/cjs/queries/MutationQuery.js +0 -334
  116. package/lib/cjs/queries/MutationQuery.js.map +0 -1
  117. package/lib/cjs/queries/MutationSerialization.d.ts +0 -102
  118. package/lib/cjs/queries/MutationSerialization.js +0 -207
  119. package/lib/cjs/queries/MutationSerialization.js.map +0 -1
  120. package/lib/cjs/queries/MutationThenable.d.ts +0 -18
  121. package/lib/cjs/queries/MutationThenable.js +0 -32
  122. package/lib/cjs/queries/MutationThenable.js.map +0 -1
  123. package/lib/cjs/queries/PropertyPath.d.ts +0 -38
  124. package/lib/cjs/queries/PropertyPath.js +0 -82
  125. package/lib/cjs/queries/PropertyPath.js.map +0 -1
  126. package/lib/cjs/queries/ProxiedPathBuilder.d.ts +0 -14
  127. package/lib/cjs/queries/ProxiedPathBuilder.js +0 -29
  128. package/lib/cjs/queries/ProxiedPathBuilder.js.map +0 -1
  129. package/lib/cjs/queries/QueryBuilder.d.ts +0 -193
  130. package/lib/cjs/queries/QueryBuilder.js +0 -519
  131. package/lib/cjs/queries/QueryBuilder.js.map +0 -1
  132. package/lib/cjs/queries/QueryBuilderSerialization.d.ts +0 -31
  133. package/lib/cjs/queries/QueryBuilderSerialization.js +0 -68
  134. package/lib/cjs/queries/QueryBuilderSerialization.js.map +0 -1
  135. package/lib/cjs/queries/QueryContext.d.ts +0 -50
  136. package/lib/cjs/queries/QueryContext.js +0 -147
  137. package/lib/cjs/queries/QueryContext.js.map +0 -1
  138. package/lib/cjs/queries/QueryFactory.d.ts +0 -80
  139. package/lib/cjs/queries/QueryFactory.js +0 -21
  140. package/lib/cjs/queries/QueryFactory.js.map +0 -1
  141. package/lib/cjs/queries/SelectQuery.d.ts +0 -302
  142. package/lib/cjs/queries/SelectQuery.js +0 -761
  143. package/lib/cjs/queries/SelectQuery.js.map +0 -1
  144. package/lib/cjs/queries/UpdateBuilder.d.ts +0 -69
  145. package/lib/cjs/queries/UpdateBuilder.js +0 -199
  146. package/lib/cjs/queries/UpdateBuilder.js.map +0 -1
  147. package/lib/cjs/queries/UpdateQuery.d.ts +0 -18
  148. package/lib/cjs/queries/UpdateQuery.js +0 -3
  149. package/lib/cjs/queries/UpdateQuery.js.map +0 -1
  150. package/lib/cjs/queries/fromJSON.d.ts +0 -16
  151. package/lib/cjs/queries/fromJSON.js +0 -41
  152. package/lib/cjs/queries/fromJSON.js.map +0 -1
  153. package/lib/cjs/queries/lower.d.ts +0 -28
  154. package/lib/cjs/queries/lower.js +0 -114
  155. package/lib/cjs/queries/lower.js.map +0 -1
  156. package/lib/cjs/queries/lowerMutationJSON.d.ts +0 -25
  157. package/lib/cjs/queries/lowerMutationJSON.js +0 -173
  158. package/lib/cjs/queries/lowerMutationJSON.js.map +0 -1
  159. package/lib/cjs/queries/mutationLowerSpec.d.ts +0 -32
  160. package/lib/cjs/queries/mutationLowerSpec.js +0 -8
  161. package/lib/cjs/queries/mutationLowerSpec.js.map +0 -1
  162. package/lib/cjs/queries/queryDispatch.d.ts +0 -33
  163. package/lib/cjs/queries/queryDispatch.js +0 -33
  164. package/lib/cjs/queries/queryDispatch.js.map +0 -1
  165. package/lib/cjs/queries/resolveShape.d.ts +0 -10
  166. package/lib/cjs/queries/resolveShape.js +0 -23
  167. package/lib/cjs/queries/resolveShape.js.map +0 -1
  168. package/lib/cjs/queries/wireVersion.d.ts +0 -7
  169. package/lib/cjs/queries/wireVersion.js +0 -25
  170. package/lib/cjs/queries/wireVersion.js.map +0 -1
  171. package/lib/cjs/shapes/List.d.ts +0 -35
  172. package/lib/cjs/shapes/List.js +0 -72
  173. package/lib/cjs/shapes/List.js.map +0 -1
  174. package/lib/cjs/shapes/PathNode.d.ts +0 -20
  175. package/lib/cjs/shapes/PathNode.js +0 -68
  176. package/lib/cjs/shapes/PathNode.js.map +0 -1
  177. package/lib/cjs/shapes/SHACL.d.ts +0 -300
  178. package/lib/cjs/shapes/SHACL.js +0 -612
  179. package/lib/cjs/shapes/SHACL.js.map +0 -1
  180. package/lib/cjs/shapes/Shape.d.ts +0 -74
  181. package/lib/cjs/shapes/Shape.js +0 -124
  182. package/lib/cjs/shapes/Shape.js.map +0 -1
  183. package/lib/cjs/shapes/serializePathToNodeData.d.ts +0 -24
  184. package/lib/cjs/shapes/serializePathToNodeData.js +0 -67
  185. package/lib/cjs/shapes/serializePathToNodeData.js.map +0 -1
  186. package/lib/cjs/shapes/syncShapes.d.ts +0 -38
  187. package/lib/cjs/shapes/syncShapes.js +0 -214
  188. package/lib/cjs/shapes/syncShapes.js.map +0 -1
  189. package/lib/cjs/sparql/SparqlAlgebra.d.ts +0 -190
  190. package/lib/cjs/sparql/SparqlAlgebra.js +0 -4
  191. package/lib/cjs/sparql/SparqlAlgebra.js.map +0 -1
  192. package/lib/cjs/sparql/SparqlDataset.d.ts +0 -60
  193. package/lib/cjs/sparql/SparqlDataset.js +0 -117
  194. package/lib/cjs/sparql/SparqlDataset.js.map +0 -1
  195. package/lib/cjs/sparql/algebraToString.d.ts +0 -13
  196. package/lib/cjs/sparql/algebraToString.js +0 -385
  197. package/lib/cjs/sparql/algebraToString.js.map +0 -1
  198. package/lib/cjs/sparql/index.d.ts +0 -9
  199. package/lib/cjs/sparql/index.js +0 -41
  200. package/lib/cjs/sparql/index.js.map +0 -1
  201. package/lib/cjs/sparql/irToAlgebra.d.ts +0 -79
  202. package/lib/cjs/sparql/irToAlgebra.js +0 -2042
  203. package/lib/cjs/sparql/irToAlgebra.js.map +0 -1
  204. package/lib/cjs/sparql/resultMapping.d.ts +0 -36
  205. package/lib/cjs/sparql/resultMapping.js +0 -563
  206. package/lib/cjs/sparql/resultMapping.js.map +0 -1
  207. package/lib/cjs/sparql/sparqlUtils.d.ts +0 -53
  208. package/lib/cjs/sparql/sparqlUtils.js +0 -154
  209. package/lib/cjs/sparql/sparqlUtils.js.map +0 -1
  210. package/lib/cjs/utils/LinkedErrorLogging.d.ts +0 -13
  211. package/lib/cjs/utils/LinkedErrorLogging.js +0 -22
  212. package/lib/cjs/utils/LinkedErrorLogging.js.map +0 -1
  213. package/lib/cjs/utils/LinkedFileStorage.d.ts +0 -23
  214. package/lib/cjs/utils/LinkedFileStorage.js +0 -62
  215. package/lib/cjs/utils/LinkedFileStorage.js.map +0 -1
  216. package/lib/cjs/utils/LinkedStorage.d.ts +0 -40
  217. package/lib/cjs/utils/LinkedStorage.js +0 -148
  218. package/lib/cjs/utils/LinkedStorage.js.map +0 -1
  219. package/lib/cjs/utils/NameSpace.d.ts +0 -2
  220. package/lib/cjs/utils/NameSpace.js +0 -8
  221. package/lib/cjs/utils/NameSpace.js.map +0 -1
  222. package/lib/cjs/utils/NodeReference.d.ts +0 -30
  223. package/lib/cjs/utils/NodeReference.js +0 -54
  224. package/lib/cjs/utils/NodeReference.js.map +0 -1
  225. package/lib/cjs/utils/Package.d.ts +0 -153
  226. package/lib/cjs/utils/Package.js +0 -419
  227. package/lib/cjs/utils/Package.js.map +0 -1
  228. package/lib/cjs/utils/Prefix.d.ts +0 -22
  229. package/lib/cjs/utils/Prefix.js +0 -104
  230. package/lib/cjs/utils/Prefix.js.map +0 -1
  231. package/lib/cjs/utils/ShapeClass.d.ts +0 -30
  232. package/lib/cjs/utils/ShapeClass.js +0 -180
  233. package/lib/cjs/utils/ShapeClass.js.map +0 -1
  234. package/lib/cjs/utils/URI.d.ts +0 -18
  235. package/lib/cjs/utils/URI.js +0 -42
  236. package/lib/cjs/utils/URI.js.map +0 -1
  237. package/lib/cjs/utils/cached.d.ts +0 -14
  238. package/lib/cjs/utils/cached.js +0 -71
  239. package/lib/cjs/utils/cached.js.map +0 -1
  240. package/lib/cjs/utils/loadStores.d.ts +0 -34
  241. package/lib/cjs/utils/loadStores.js +0 -105
  242. package/lib/cjs/utils/loadStores.js.map +0 -1
  243. package/lib/cjs/utils/parseDatasetsConfig.d.ts +0 -49
  244. package/lib/cjs/utils/parseDatasetsConfig.js +0 -110
  245. package/lib/cjs/utils/parseDatasetsConfig.js.map +0 -1
  246. package/lib/esm/package.json +0 -9
@@ -1,190 +0,0 @@
1
- export type SparqlTerm = {
2
- kind: 'variable';
3
- name: string;
4
- } | {
5
- kind: 'iri';
6
- value: string;
7
- } | {
8
- kind: 'literal';
9
- value: string;
10
- datatype?: string;
11
- language?: string;
12
- } | {
13
- kind: 'path';
14
- value: string;
15
- uris: string[];
16
- };
17
- export type SparqlTriple = {
18
- subject: SparqlTerm;
19
- predicate: SparqlTerm;
20
- object: SparqlTerm;
21
- };
22
- export type SparqlAlgebraNode = SparqlBGP | SparqlJoin | SparqlLeftJoin | SparqlFilter | SparqlUnion | SparqlMinus | SparqlExtend | SparqlGraph | SparqlValues | SparqlSubSelect;
23
- export type SparqlBGP = {
24
- type: 'bgp';
25
- triples: SparqlTriple[];
26
- };
27
- export type SparqlJoin = {
28
- type: 'join';
29
- left: SparqlAlgebraNode;
30
- right: SparqlAlgebraNode;
31
- };
32
- export type SparqlLeftJoin = {
33
- type: 'left_join';
34
- left: SparqlAlgebraNode;
35
- right: SparqlAlgebraNode;
36
- condition?: SparqlExpression;
37
- };
38
- export type SparqlFilter = {
39
- type: 'filter';
40
- expression: SparqlExpression;
41
- inner: SparqlAlgebraNode;
42
- };
43
- export type SparqlUnion = {
44
- type: 'union';
45
- left: SparqlAlgebraNode;
46
- right: SparqlAlgebraNode;
47
- };
48
- export type SparqlMinus = {
49
- type: 'minus';
50
- left: SparqlAlgebraNode;
51
- right: SparqlAlgebraNode;
52
- };
53
- export type SparqlExtend = {
54
- type: 'extend';
55
- inner: SparqlAlgebraNode;
56
- variable: string;
57
- expression: SparqlExpression;
58
- };
59
- export type SparqlGraph = {
60
- type: 'graph';
61
- iri: string;
62
- inner: SparqlAlgebraNode;
63
- };
64
- export type SparqlValues = {
65
- type: 'values';
66
- variable: string;
67
- iris: string[];
68
- };
69
- /**
70
- * A nested sub-SELECT used as a group graph pattern inside a WHERE block.
71
- *
72
- * Emitted for nested-select inner LIMIT/OFFSET: the root→child traverse is
73
- * wrapped in `{ SELECT <projection> WHERE { <inner> } ORDER BY … LIMIT … OFFSET … }`
74
- * so the related collection is bounded per parent. Only valid when the outer
75
- * query targets a single root subject (see irToAlgebra).
76
- */
77
- export type SparqlSubSelect = {
78
- type: 'subselect';
79
- projection: string[];
80
- inner: SparqlAlgebraNode;
81
- orderBy?: SparqlOrderCondition[];
82
- limit?: number;
83
- offset?: number;
84
- };
85
- export type SparqlExpression = SparqlVariableExpr | SparqlIriExpr | SparqlLiteralExpr | SparqlBinaryExpr | SparqlLogicalExpr | SparqlNotExpr | SparqlFunctionExpr | SparqlAggregateExpr | SparqlExistsExpr | SparqlBoundExpr | SparqlInExpr;
86
- /** Membership test — `value IN (list)` / `value NOT IN (list)`. */
87
- export type SparqlInExpr = {
88
- kind: 'in_expr';
89
- negated: boolean;
90
- value: SparqlExpression;
91
- list: SparqlExpression[];
92
- };
93
- export type SparqlVariableExpr = {
94
- kind: 'variable_expr';
95
- name: string;
96
- };
97
- export type SparqlIriExpr = {
98
- kind: 'iri_expr';
99
- value: string;
100
- };
101
- export type SparqlLiteralExpr = {
102
- kind: 'literal_expr';
103
- value: string;
104
- datatype?: string;
105
- };
106
- export type SparqlBinaryExpr = {
107
- kind: 'binary_expr';
108
- op: string;
109
- left: SparqlExpression;
110
- right: SparqlExpression;
111
- };
112
- export type SparqlLogicalExpr = {
113
- kind: 'logical_expr';
114
- op: 'and' | 'or';
115
- exprs: SparqlExpression[];
116
- };
117
- export type SparqlNotExpr = {
118
- kind: 'not_expr';
119
- inner: SparqlExpression;
120
- };
121
- export type SparqlFunctionExpr = {
122
- kind: 'function_expr';
123
- name: string;
124
- args: SparqlExpression[];
125
- };
126
- export type SparqlAggregateExpr = {
127
- kind: 'aggregate_expr';
128
- name: string;
129
- args: SparqlExpression[];
130
- distinct?: boolean;
131
- };
132
- export type SparqlExistsExpr = {
133
- kind: 'exists_expr';
134
- pattern: SparqlAlgebraNode;
135
- negated: boolean;
136
- };
137
- export type SparqlBoundExpr = {
138
- kind: 'bound_expr';
139
- variable: string;
140
- };
141
- export type SparqlProjectionItem = {
142
- kind: 'variable';
143
- name: string;
144
- } | {
145
- kind: 'aggregate';
146
- expression: SparqlAggregateExpr;
147
- alias: string;
148
- } | {
149
- kind: 'expression';
150
- expression: SparqlExpression;
151
- alias: string;
152
- };
153
- export type SparqlOrderCondition = {
154
- expression: SparqlExpression;
155
- direction: 'ASC' | 'DESC';
156
- };
157
- export type SparqlAggregateBinding = {
158
- variable: string;
159
- aggregate: SparqlAggregateExpr;
160
- };
161
- export type SparqlSelectPlan = {
162
- type: 'select';
163
- algebra: SparqlAlgebraNode;
164
- projection: SparqlProjectionItem[];
165
- distinct?: boolean;
166
- orderBy?: SparqlOrderCondition[];
167
- limit?: number;
168
- offset?: number;
169
- groupBy?: string[];
170
- having?: SparqlExpression;
171
- aggregates?: SparqlAggregateBinding[];
172
- };
173
- export type SparqlInsertDataPlan = {
174
- type: 'insert_data';
175
- triples: SparqlTriple[];
176
- graph?: string;
177
- };
178
- export type SparqlDeleteInsertPlan = {
179
- type: 'delete_insert';
180
- deletePatterns: SparqlTriple[];
181
- insertPatterns: SparqlTriple[];
182
- whereAlgebra: SparqlAlgebraNode;
183
- graph?: string;
184
- };
185
- export type SparqlDeleteWherePlan = {
186
- type: 'delete_where';
187
- patterns: SparqlAlgebraNode;
188
- graph?: string;
189
- };
190
- export type SparqlPlan = SparqlSelectPlan | SparqlInsertDataPlan | SparqlDeleteInsertPlan | SparqlDeleteWherePlan;
@@ -1,4 +0,0 @@
1
- "use strict";
2
- // --- Term types ---
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=SparqlAlgebra.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SparqlAlgebra.js","sourceRoot":"","sources":["../../../src/sparql/SparqlAlgebra.ts"],"names":[],"mappings":";AAAA,qBAAqB"}
@@ -1,60 +0,0 @@
1
- import type { IDataset } from '../interfaces/IDataset.js';
2
- import type { SelectQuery } from '../queries/SelectQuery.js';
3
- import type { CreateQuery } from '../queries/CreateQuery.js';
4
- import type { UpdateQuery } from '../queries/UpdateQuery.js';
5
- import type { DeleteQuery, DeleteResponse } from '../queries/DeleteQuery.js';
6
- import type { SelectResult, CreateResult, UpdateResult } from '../queries/IntermediateRepresentation.js';
7
- import type { SparqlJsonResults } from './resultMapping.js';
8
- import { type SparqlOptions } from './sparqlUtils.js';
9
- import { Shape } from '../shapes/Shape.js';
10
- /**
11
- * Abstract base class for SPARQL-backed datasets.
12
- *
13
- * Extends Shape so dataset configurations can themselves be persisted as linked data.
14
- * Handles the full pipeline: IR query → SPARQL string → execute → map results.
15
- * Subclasses only need to implement the two transport methods:
16
- * - `executeSparqlSelect` — send a SPARQL SELECT and return JSON results
17
- * - `executeSparqlUpdate` — send a SPARQL UPDATE (INSERT DATA / DELETE..INSERT / etc.)
18
- *
19
- * Example subclass (Fuseki):
20
- * ```ts
21
- * class FusekiDataset extends SparqlDataset {
22
- * constructor(baseUrl: string, dataset: string) {
23
- * super({ dataRoot: 'http://data.example.org' });
24
- * this.queryEndpoint = `${baseUrl}/${dataset}/sparql`;
25
- * this.updateEndpoint = `${baseUrl}/${dataset}/update`;
26
- * }
27
- * protected async executeSparqlSelect(sparql: string) {
28
- * const res = await fetch(this.queryEndpoint, { ... });
29
- * return res.json();
30
- * }
31
- * protected async executeSparqlUpdate(sparql: string) {
32
- * await fetch(this.updateEndpoint, { ... });
33
- * }
34
- * }
35
- * ```
36
- */
37
- export declare abstract class SparqlDataset extends Shape implements IDataset {
38
- protected options?: SparqlOptions;
39
- constructor(options?: SparqlOptions);
40
- /**
41
- * Send a SPARQL SELECT/ASK/CONSTRUCT query and return the parsed
42
- * SPARQL JSON Results (application/sparql-results+json).
43
- */
44
- protected abstract executeSparqlSelect(sparql: string): Promise<SparqlJsonResults>;
45
- /**
46
- * Send a SPARQL UPDATE request (INSERT DATA, DELETE/INSERT, etc.).
47
- * No return value — the update is fire-and-forget at the SPARQL level.
48
- */
49
- protected abstract executeSparqlUpdate(sparql: string): Promise<void>;
50
- selectQuery(query: SelectQuery): Promise<SelectResult>;
51
- createQuery(query: CreateQuery): Promise<CreateResult>;
52
- updateQuery(query: UpdateQuery): Promise<UpdateResult>;
53
- deleteQuery(query: DeleteQuery): Promise<DeleteResponse>;
54
- /**
55
- * Execute a raw SPARQL query string directly against the dataset.
56
- * Defaults to SELECT; pass `'update'` for INSERT/DELETE operations.
57
- */
58
- rawQuery(sparql: string, mode?: 'query' | 'update'): Promise<SparqlJsonResults | void>;
59
- }
60
- export { SparqlDataset as SparqlStore };
@@ -1,117 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SparqlStore = exports.SparqlDataset = void 0;
13
- const irToAlgebra_js_1 = require("./irToAlgebra.js");
14
- const resultMapping_js_1 = require("./resultMapping.js");
15
- const sparqlUtils_js_1 = require("./sparqlUtils.js");
16
- const Shape_js_1 = require("../shapes/Shape.js");
17
- const lower_js_1 = require("../queries/lower.js");
18
- /**
19
- * Abstract base class for SPARQL-backed datasets.
20
- *
21
- * Extends Shape so dataset configurations can themselves be persisted as linked data.
22
- * Handles the full pipeline: IR query → SPARQL string → execute → map results.
23
- * Subclasses only need to implement the two transport methods:
24
- * - `executeSparqlSelect` — send a SPARQL SELECT and return JSON results
25
- * - `executeSparqlUpdate` — send a SPARQL UPDATE (INSERT DATA / DELETE..INSERT / etc.)
26
- *
27
- * Example subclass (Fuseki):
28
- * ```ts
29
- * class FusekiDataset extends SparqlDataset {
30
- * constructor(baseUrl: string, dataset: string) {
31
- * super({ dataRoot: 'http://data.example.org' });
32
- * this.queryEndpoint = `${baseUrl}/${dataset}/sparql`;
33
- * this.updateEndpoint = `${baseUrl}/${dataset}/update`;
34
- * }
35
- * protected async executeSparqlSelect(sparql: string) {
36
- * const res = await fetch(this.queryEndpoint, { ... });
37
- * return res.json();
38
- * }
39
- * protected async executeSparqlUpdate(sparql: string) {
40
- * await fetch(this.updateEndpoint, { ... });
41
- * }
42
- * }
43
- * ```
44
- */
45
- class SparqlDataset extends Shape_js_1.Shape {
46
- constructor(options) {
47
- super();
48
- this.options = options;
49
- }
50
- selectQuery(query) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- const ir = (0, lower_js_1.lower)(query);
53
- const sparql = (0, irToAlgebra_js_1.selectToSparql)(ir, this.options);
54
- const json = yield this.executeSparqlSelect(sparql);
55
- return (0, resultMapping_js_1.mapSparqlSelectResult)(json, ir);
56
- });
57
- }
58
- createQuery(query) {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- const ir = (0, lower_js_1.lower)(query);
61
- const uri = ir.data.id || (0, sparqlUtils_js_1.generateEntityUri)(ir.data.shape, this.options);
62
- ir.data.id = uri;
63
- const sparql = (0, irToAlgebra_js_1.createToSparql)(ir, this.options);
64
- yield this.executeSparqlUpdate(sparql);
65
- return (0, resultMapping_js_1.mapSparqlCreateResult)(uri, ir);
66
- });
67
- }
68
- updateQuery(query) {
69
- return __awaiter(this, void 0, void 0, function* () {
70
- const ir = (0, lower_js_1.lower)(query);
71
- if (ir.kind === 'update_where') {
72
- const sparql = (0, irToAlgebra_js_1.updateWhereToSparql)(ir, this.options);
73
- yield this.executeSparqlUpdate(sparql);
74
- return { id: '' };
75
- }
76
- const sparql = (0, irToAlgebra_js_1.updateToSparql)(ir, this.options);
77
- yield this.executeSparqlUpdate(sparql);
78
- return (0, resultMapping_js_1.mapSparqlUpdateResult)(ir);
79
- });
80
- }
81
- deleteQuery(query) {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- const ir = (0, lower_js_1.lower)(query);
84
- if (ir.kind === 'delete_all') {
85
- const sparql = (0, irToAlgebra_js_1.deleteAllToSparql)(ir, this.options);
86
- yield this.executeSparqlUpdate(sparql);
87
- return { deleted: [], count: 0 };
88
- }
89
- if (ir.kind === 'delete_where') {
90
- const sparql = (0, irToAlgebra_js_1.deleteWhereToSparql)(ir, this.options);
91
- yield this.executeSparqlUpdate(sparql);
92
- return { deleted: [], count: 0 };
93
- }
94
- const sparql = (0, irToAlgebra_js_1.deleteToSparql)(ir, this.options);
95
- yield this.executeSparqlUpdate(sparql);
96
- return {
97
- deleted: ir.ids,
98
- count: ir.ids.length,
99
- };
100
- });
101
- }
102
- /**
103
- * Execute a raw SPARQL query string directly against the dataset.
104
- * Defaults to SELECT; pass `'update'` for INSERT/DELETE operations.
105
- */
106
- rawQuery(sparql, mode) {
107
- return __awaiter(this, void 0, void 0, function* () {
108
- if (mode === 'update') {
109
- return this.executeSparqlUpdate(sparql);
110
- }
111
- return this.executeSparqlSelect(sparql);
112
- });
113
- }
114
- }
115
- exports.SparqlDataset = SparqlDataset;
116
- exports.SparqlStore = SparqlDataset;
117
- //# sourceMappingURL=SparqlDataset.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SparqlDataset.js","sourceRoot":"","sources":["../../../src/sparql/SparqlDataset.ts"],"names":[],"mappings":"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"}
@@ -1,13 +0,0 @@
1
- import type { SparqlAlgebraNode, SparqlExpression, SparqlTerm, SparqlSelectPlan, SparqlInsertDataPlan, SparqlDeleteInsertPlan, SparqlDeleteWherePlan } from './SparqlAlgebra.js';
2
- import { type SparqlOptions } from './sparqlUtils.js';
3
- type UriCollector = {
4
- uris: Set<string>;
5
- };
6
- export declare function serializeTerm(term: SparqlTerm, collector?: UriCollector): string;
7
- export declare function serializeExpression(expr: SparqlExpression, collector?: UriCollector): string;
8
- export declare function serializeAlgebraNode(node: SparqlAlgebraNode, collector?: UriCollector): string;
9
- export declare function selectPlanToSparql(plan: SparqlSelectPlan, _options?: SparqlOptions): string;
10
- export declare function insertDataPlanToSparql(plan: SparqlInsertDataPlan, _options?: SparqlOptions): string;
11
- export declare function deleteInsertPlanToSparql(plan: SparqlDeleteInsertPlan, _options?: SparqlOptions): string;
12
- export declare function deleteWherePlanToSparql(plan: SparqlDeleteWherePlan, _options?: SparqlOptions): string;
13
- export {};