@neo4j/graph-schema-utils 1.0.0-next.0 → 1.0.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -1
- package/dist/formatters/json/extensions.d.ts +4 -0
- package/dist/formatters/json/extensions.js +360 -0
- package/dist/formatters/json/extensions.js.map +1 -0
- package/dist/formatters/json/index.d.ts +1 -0
- package/dist/formatters/json/index.js +2 -0
- package/dist/formatters/json/index.js.map +1 -0
- package/dist/formatters/json/types.d.ts +138 -0
- package/dist/formatters/json/types.js +17 -0
- package/dist/formatters/json/types.js.map +1 -0
- package/dist/formatters/llm-prompt/index.d.ts +3 -0
- package/dist/formatters/llm-prompt/index.js +102 -0
- package/dist/formatters/llm-prompt/index.js.map +1 -0
- package/dist/formatters/llm-prompt/types.d.ts +5 -0
- package/dist/formatters/llm-prompt/types.js +2 -0
- package/dist/formatters/llm-prompt/types.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/model/index.d.ts +116 -0
- package/dist/model/index.js +167 -0
- package/dist/model/index.js.map +1 -0
- package/dist/validation.d.ts +9 -0
- package/dist/validation.js +49 -0
- package/dist/validation.js.map +1 -0
- package/package.json +16 -9
- package/src/index.js +0 -4
- package/src/model/index.js +0 -330
- package/src/types.d.ts +0 -5
- package/src/validation.js +0 -65
package/README.md
CHANGED
|
@@ -8,10 +8,61 @@ npm install @neo4j/graph-schema-utils
|
|
|
8
8
|
|
|
9
9
|
## Use
|
|
10
10
|
|
|
11
|
+
### Validate
|
|
12
|
+
|
|
13
|
+
This function is needed to perform a validation on a graph schema. The validateSchema function compares the output against the JSON schema.
|
|
14
|
+
|
|
11
15
|
```js
|
|
12
16
|
import { validateSchema } from "@neo4j/graph-schema-utils";
|
|
13
17
|
|
|
14
|
-
validateSchema(
|
|
18
|
+
validateSchema(jsonSchema, graphSchema);
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Model
|
|
22
|
+
|
|
23
|
+
You can also create a schema model programatically.
|
|
24
|
+
Example:
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { model } from "@neo4j/graph-schema-utils";
|
|
28
|
+
|
|
29
|
+
const labels = [
|
|
30
|
+
new model.NodeLabel("l1", "Person"),
|
|
31
|
+
new model.NodeLabel("l1", "Movie"),
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
const relationshipTypes = [new model.RelationshipType("rt1", "ACTED_IN")];
|
|
35
|
+
|
|
36
|
+
const properties = [
|
|
37
|
+
new model.Property("name", new model.PropertyBaseType("string"), true),
|
|
38
|
+
new model.Property("title", new model.PropertyBaseType("string"), true),
|
|
39
|
+
new model.Property(
|
|
40
|
+
"roles",
|
|
41
|
+
new model.PropertyArrayType(new model.PropertyBaseType("string")),
|
|
42
|
+
false
|
|
43
|
+
),
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const nodeObjectTypes = [
|
|
47
|
+
new model.NodeObjectType("n1", [labels[0]], [properties[0]]), // (:Person {name}) node type
|
|
48
|
+
new model.NodeObjectType("n2", [labels[1]], [properties[1]]), // (:Movie {title}) node type
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
const relationshipObjectTypes = [
|
|
52
|
+
// (:Person {name})-[:ACTED_IN {roles}]->(:Movie {title})
|
|
53
|
+
new model.RelationshipObjectType(
|
|
54
|
+
"r1",
|
|
55
|
+
relationshipTypes[0],
|
|
56
|
+
nodeObjectTypes[0],
|
|
57
|
+
nodeObjectTypes[1],
|
|
58
|
+
[properties[2]]
|
|
59
|
+
),
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
const graphSchema = new model.GraphSchema(
|
|
63
|
+
nodeObjectTypes,
|
|
64
|
+
relationshipObjectTypes
|
|
65
|
+
);
|
|
15
66
|
```
|
|
16
67
|
|
|
17
68
|
# Develop / Contribute
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { GraphSchema, LookupIndex, NodeLabel, NodeLabelConstraint, NodeLabelIndex, NodeObjectType, Property, PropertyArrayType, PropertyBaseType, RelationshipObjectType, RelationshipType, RelationshipTypeConstraint, RelationshipTypeIndex, isLookupIndex, isNodeLabelConstraint, isNodeLabelIndex, isRelationshipTypeConstraint, isRelationshipTypeIndex, } from "../../model/index.js";
|
|
2
|
+
import { isLookupIndexJsonStruct, isNodeLabelConstraintJsonStruct, isNodeLabelIndexJsonStruct, isRelationshipTypeConstraintJsonStruct, isRelationshipTypeIndexJsonStruct, } from "./types.js";
|
|
3
|
+
export const VERSION = "0.0.1";
|
|
4
|
+
export function toJson(schema, space = undefined) {
|
|
5
|
+
const labels = schema.nodeLabels
|
|
6
|
+
.sort((a, b) => (a.$id < b.$id ? -1 : 1))
|
|
7
|
+
.map(nodeLabel.extract);
|
|
8
|
+
const relationshipTypes = schema.relationshipTypes
|
|
9
|
+
.sort((a, b) => (a.$id < b.$id ? -1 : 1))
|
|
10
|
+
.map(relationshipType.extract);
|
|
11
|
+
const nodeObjectTypes = schema.nodeObjectTypes.map(nodeObjectType.extract);
|
|
12
|
+
const relationshipObjectTypes = schema.relationshipObjectTypes.map(relationshipObjectType.extract);
|
|
13
|
+
const constraints = schema.constraints.map((constraint) => {
|
|
14
|
+
if (isNodeLabelConstraint(constraint)) {
|
|
15
|
+
return nodeLabelConstraint.extract(constraint);
|
|
16
|
+
}
|
|
17
|
+
else if (isRelationshipTypeConstraint(constraint)) {
|
|
18
|
+
return relationshipConstraint.extract(constraint);
|
|
19
|
+
}
|
|
20
|
+
throw new Error(`Unknown constraint type ${constraint}`);
|
|
21
|
+
});
|
|
22
|
+
const indexes = schema.indexes.map((index) => {
|
|
23
|
+
if (isNodeLabelIndex(index)) {
|
|
24
|
+
return nodeLabelIndex.extract(index);
|
|
25
|
+
}
|
|
26
|
+
else if (isRelationshipTypeIndex(index)) {
|
|
27
|
+
return relationshipTypeIndex.extract(index);
|
|
28
|
+
}
|
|
29
|
+
else if (isLookupIndex(index)) {
|
|
30
|
+
return lookupIndex.extract(index);
|
|
31
|
+
}
|
|
32
|
+
throw new Error(`Unknown index type ${index}`);
|
|
33
|
+
});
|
|
34
|
+
const out = {
|
|
35
|
+
graphSchemaRepresentation: {
|
|
36
|
+
version: VERSION,
|
|
37
|
+
graphSchema: {
|
|
38
|
+
nodeLabels: labels,
|
|
39
|
+
relationshipTypes,
|
|
40
|
+
nodeObjectTypes,
|
|
41
|
+
relationshipObjectTypes,
|
|
42
|
+
constraints,
|
|
43
|
+
indexes,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
return JSON.stringify(out, null, space);
|
|
48
|
+
}
|
|
49
|
+
export function fromJson(schema) {
|
|
50
|
+
const schemaJson = JSON.parse(schema);
|
|
51
|
+
const { graphSchema } = schemaJson.graphSchemaRepresentation;
|
|
52
|
+
const labels = graphSchema.nodeLabels.map(nodeLabel.create);
|
|
53
|
+
const relationshipTypes = graphSchema.relationshipTypes.map(relationshipType.create);
|
|
54
|
+
const nodeObjectTypes = graphSchema.nodeObjectTypes.map((nodeObjectTypeJson) => nodeObjectType.create(nodeObjectTypeJson, (ref) => {
|
|
55
|
+
const found = labels.find((label) => label.$id === ref.slice(1));
|
|
56
|
+
if (!found) {
|
|
57
|
+
throw new Error(`Not all label references are defined`);
|
|
58
|
+
}
|
|
59
|
+
return found;
|
|
60
|
+
}));
|
|
61
|
+
const relationshipObjectTypes = graphSchema.relationshipObjectTypes.map((relationshipObjectTypeJson) => relationshipObjectType.create(relationshipObjectTypeJson, (ref) => {
|
|
62
|
+
const found = relationshipTypes.find((relType) => relType.$id === ref.slice(1));
|
|
63
|
+
if (!found) {
|
|
64
|
+
throw new Error(`Not all relationship type references are defined`);
|
|
65
|
+
}
|
|
66
|
+
return found;
|
|
67
|
+
}, (ref, fieldName) => {
|
|
68
|
+
const found = nodeObjectTypes.find((nodeObjectType) => nodeObjectType.$id === ref.slice(1));
|
|
69
|
+
if (!found) {
|
|
70
|
+
throw new Error(`Not all node object type references in ${fieldName} are defined`);
|
|
71
|
+
}
|
|
72
|
+
return found;
|
|
73
|
+
}));
|
|
74
|
+
const constraints = graphSchema.constraints.map((constraintJson) => {
|
|
75
|
+
if (isNodeLabelConstraintJsonStruct(constraintJson)) {
|
|
76
|
+
return nodeLabelConstraint.create(constraintJson, (ref) => {
|
|
77
|
+
const found = labels.find((label) => label.$id === ref.slice(1));
|
|
78
|
+
if (!found) {
|
|
79
|
+
throw new Error(`Not all label references are defined`);
|
|
80
|
+
}
|
|
81
|
+
return found;
|
|
82
|
+
}, (propertyRef, labelRef) => {
|
|
83
|
+
const label = labels.find((label) => label.$id === labelRef.slice(1));
|
|
84
|
+
const labelProperties = label ? label.properties : [];
|
|
85
|
+
const found = labelProperties.find((p) => p.$id === propertyRef.slice(1));
|
|
86
|
+
if (!found) {
|
|
87
|
+
throw new Error(`Not all constraint property references are defined`);
|
|
88
|
+
}
|
|
89
|
+
return found;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
else if (isRelationshipTypeConstraintJsonStruct(constraintJson)) {
|
|
93
|
+
return relationshipConstraint.create(constraintJson, (ref) => {
|
|
94
|
+
const found = relationshipTypes.find((relType) => relType.$id === ref.slice(1));
|
|
95
|
+
if (!found) {
|
|
96
|
+
throw new Error(`Not all relationship type references are defined`);
|
|
97
|
+
}
|
|
98
|
+
return found;
|
|
99
|
+
}, (propertyRef, relationshipTypeRef) => {
|
|
100
|
+
const relType = relationshipTypes.find((relType) => relType.$id === relationshipTypeRef.slice(1));
|
|
101
|
+
const relTypeProperties = relType ? relType.properties : [];
|
|
102
|
+
const found = relTypeProperties.find((p) => p.$id === propertyRef.slice(1));
|
|
103
|
+
if (!found) {
|
|
104
|
+
throw new Error(`Not all constraint property references are defined`);
|
|
105
|
+
}
|
|
106
|
+
return found;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
throw new Error(`Unknown constraint type ${constraintJson}`);
|
|
110
|
+
});
|
|
111
|
+
const indexes = graphSchema.indexes.map((indexJson) => {
|
|
112
|
+
if (isNodeLabelIndexJsonStruct(indexJson)) {
|
|
113
|
+
return nodeLabelIndex.create(indexJson, (ref) => {
|
|
114
|
+
const found = labels.find((label) => label.$id === ref.slice(1));
|
|
115
|
+
if (!found) {
|
|
116
|
+
throw new Error(`Not all label references are defined`);
|
|
117
|
+
}
|
|
118
|
+
return found;
|
|
119
|
+
}, (propertyRef, labelRef) => {
|
|
120
|
+
const label = labels.find((label) => label.$id === labelRef.slice(1));
|
|
121
|
+
const labelProperties = label ? label.properties : [];
|
|
122
|
+
const found = labelProperties.find((p) => p.$id === propertyRef.slice(1));
|
|
123
|
+
if (!found) {
|
|
124
|
+
throw new Error(`Not all index property references are defined`);
|
|
125
|
+
}
|
|
126
|
+
return found;
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
else if (isRelationshipTypeIndexJsonStruct(indexJson)) {
|
|
130
|
+
return relationshipTypeIndex.create(indexJson, (ref) => {
|
|
131
|
+
const found = relationshipTypes.find((relType) => relType.$id === ref.slice(1));
|
|
132
|
+
if (!found) {
|
|
133
|
+
throw new Error(`Not all relationship type references are defined`);
|
|
134
|
+
}
|
|
135
|
+
return found;
|
|
136
|
+
}, (propertyRef, relTypeRef) => {
|
|
137
|
+
const relType = relationshipTypes.find((relType) => relType.$id === relTypeRef.slice(1));
|
|
138
|
+
const relTypeProperties = relType ? relType.properties : [];
|
|
139
|
+
const found = relTypeProperties.find((p) => p.$id === propertyRef.slice(1));
|
|
140
|
+
if (!found) {
|
|
141
|
+
throw new Error(`Not all index property references are defined`);
|
|
142
|
+
}
|
|
143
|
+
return found;
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
else if (isLookupIndexJsonStruct(indexJson)) {
|
|
147
|
+
return lookupIndex.create(indexJson);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
throw new Error(`Unknown index type ${indexJson}`);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
return new GraphSchema(nodeObjectTypes, relationshipObjectTypes, constraints, indexes);
|
|
154
|
+
}
|
|
155
|
+
const nodeLabel = {
|
|
156
|
+
extract: (node) => ({
|
|
157
|
+
$id: node.$id,
|
|
158
|
+
token: node.token,
|
|
159
|
+
properties: node.properties.map(property.extract),
|
|
160
|
+
}),
|
|
161
|
+
create: (node) => new NodeLabel(node.$id, node.token, node.properties.map(property.create)),
|
|
162
|
+
toRef: (node) => {
|
|
163
|
+
if (!node || !node.$id) {
|
|
164
|
+
throw new Error(`Not all labels are defined`);
|
|
165
|
+
}
|
|
166
|
+
return { $ref: `#${node.$id}` };
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
const relationshipType = {
|
|
170
|
+
extract: (relType) => ({
|
|
171
|
+
$id: relType.$id,
|
|
172
|
+
token: relType.token,
|
|
173
|
+
properties: relType.properties.map(property.extract),
|
|
174
|
+
}),
|
|
175
|
+
create: (relType) => new RelationshipType(relType.$id, relType.token, relType.properties.map(property.create)),
|
|
176
|
+
toRef: (relType) => {
|
|
177
|
+
if (!relType || !relType.$id) {
|
|
178
|
+
throw new Error(`RelationshipObjectType.type is not defined`);
|
|
179
|
+
}
|
|
180
|
+
return { $ref: `#${relType.$id}` };
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
const nodeLabelConstraint = {
|
|
184
|
+
extract: (constraint) => ({
|
|
185
|
+
$id: constraint.$id,
|
|
186
|
+
name: constraint.name,
|
|
187
|
+
constraintType: constraint.constraintType,
|
|
188
|
+
entityType: constraint.entityType,
|
|
189
|
+
nodeLabel: nodeLabel.toRef(constraint.nodeLabel),
|
|
190
|
+
properties: constraint.properties.map(property.toRef),
|
|
191
|
+
}),
|
|
192
|
+
create: (constraint, nodeLabelLookup, propertyLookup) => {
|
|
193
|
+
return new NodeLabelConstraint(constraint.$id, constraint.name, constraint.constraintType, nodeLabelLookup(constraint.nodeLabel.$ref), constraint.properties.map((p) => propertyLookup(p.$ref, constraint.nodeLabel.$ref)));
|
|
194
|
+
},
|
|
195
|
+
toRef: (constraint) => {
|
|
196
|
+
if (!constraint || !constraint.$id) {
|
|
197
|
+
throw new Error(`Constraint is not defined`);
|
|
198
|
+
}
|
|
199
|
+
return { $ref: `#${constraint.$id}` };
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
const relationshipConstraint = {
|
|
203
|
+
extract: (constraint) => ({
|
|
204
|
+
$id: constraint.$id,
|
|
205
|
+
name: constraint.name,
|
|
206
|
+
constraintType: constraint.constraintType,
|
|
207
|
+
entityType: constraint.entityType,
|
|
208
|
+
relationshipType: relationshipType.toRef(constraint.relationshipType),
|
|
209
|
+
properties: constraint.properties.map(property.toRef),
|
|
210
|
+
}),
|
|
211
|
+
create: (constraint, relationshipTypeLookup, propertyLookup) => {
|
|
212
|
+
return new RelationshipTypeConstraint(constraint.$id, constraint.name, constraint.constraintType, relationshipTypeLookup(constraint.relationshipType.$ref), constraint.properties.map((p) => propertyLookup(p.$ref, constraint.relationshipType.$ref)));
|
|
213
|
+
},
|
|
214
|
+
toRef: (constraint) => {
|
|
215
|
+
if (!constraint || !constraint.$id) {
|
|
216
|
+
throw new Error(`Constraint is not defined`);
|
|
217
|
+
}
|
|
218
|
+
return { $ref: `#${constraint.$id}` };
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
const lookupIndex = {
|
|
222
|
+
extract: (index) => ({
|
|
223
|
+
$id: index.$id,
|
|
224
|
+
name: index.name,
|
|
225
|
+
indexType: index.indexType,
|
|
226
|
+
entityType: index.entityType,
|
|
227
|
+
}),
|
|
228
|
+
create: (index) => {
|
|
229
|
+
return new LookupIndex(index.$id, index.name, index.entityType);
|
|
230
|
+
},
|
|
231
|
+
toRef: (index) => {
|
|
232
|
+
if (!index || !index.$id) {
|
|
233
|
+
throw new Error(`Index is not defined`);
|
|
234
|
+
}
|
|
235
|
+
return { $ref: `#${index.$id}` };
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
const nodeLabelIndex = {
|
|
239
|
+
extract: (index) => ({
|
|
240
|
+
$id: index.$id,
|
|
241
|
+
name: index.name,
|
|
242
|
+
indexType: index.indexType,
|
|
243
|
+
entityType: index.entityType,
|
|
244
|
+
nodeLabel: nodeLabel.toRef(index.nodeLabel),
|
|
245
|
+
properties: index.properties.map(property.toRef),
|
|
246
|
+
}),
|
|
247
|
+
create: (index, nodeLabelLookup, propertyLookup) => {
|
|
248
|
+
return new NodeLabelIndex(index.$id, index.name, index.indexType, nodeLabelLookup(index.nodeLabel.$ref), index.properties.map((p) => propertyLookup(p.$ref, index.nodeLabel.$ref)));
|
|
249
|
+
},
|
|
250
|
+
toRef: (index) => {
|
|
251
|
+
if (!index || !index.$id) {
|
|
252
|
+
throw new Error(`Index is not defined`);
|
|
253
|
+
}
|
|
254
|
+
return { $ref: `#${index.$id}` };
|
|
255
|
+
},
|
|
256
|
+
};
|
|
257
|
+
const relationshipTypeIndex = {
|
|
258
|
+
extract: (index) => ({
|
|
259
|
+
$id: index.$id,
|
|
260
|
+
name: index.name,
|
|
261
|
+
indexType: index.indexType,
|
|
262
|
+
entityType: index.entityType,
|
|
263
|
+
relationshipType: relationshipType.toRef(index.relationshipType),
|
|
264
|
+
properties: index.properties.map(property.toRef),
|
|
265
|
+
}),
|
|
266
|
+
create: (index, relationshipTypeLookup, propertyLookup) => {
|
|
267
|
+
return new RelationshipTypeIndex(index.$id, index.name, index.indexType, relationshipTypeLookup(index.relationshipType.$ref), index.properties.map((p) => propertyLookup(p.$ref, index.relationshipType.$ref)));
|
|
268
|
+
},
|
|
269
|
+
toRef: (index) => {
|
|
270
|
+
if (!index || !index.$id) {
|
|
271
|
+
throw new Error(`Index is not defined`);
|
|
272
|
+
}
|
|
273
|
+
return { $ref: `#${index.$id}` };
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
const property = {
|
|
277
|
+
extract: (property) => ({
|
|
278
|
+
$id: property.$id,
|
|
279
|
+
token: property.token,
|
|
280
|
+
type: propertyType.extract(property.type),
|
|
281
|
+
nullable: property.nullable,
|
|
282
|
+
}),
|
|
283
|
+
create: (property) => new Property(property.$id, property.token, propertyType.create(property.type), property.nullable),
|
|
284
|
+
toRef: (property) => {
|
|
285
|
+
if (!property || !property.$id) {
|
|
286
|
+
throw new Error(`Property is not defined`);
|
|
287
|
+
}
|
|
288
|
+
return {
|
|
289
|
+
$ref: `#${property.$id}`,
|
|
290
|
+
};
|
|
291
|
+
},
|
|
292
|
+
};
|
|
293
|
+
const propertyType = {
|
|
294
|
+
extract: (pt) => {
|
|
295
|
+
if (Array.isArray(pt)) {
|
|
296
|
+
return pt.map(propertyType.extract);
|
|
297
|
+
}
|
|
298
|
+
if (pt instanceof PropertyBaseType) {
|
|
299
|
+
return propertyBaseType.extract(pt);
|
|
300
|
+
}
|
|
301
|
+
else if (pt instanceof PropertyArrayType) {
|
|
302
|
+
return propertyArrayType.extract(pt);
|
|
303
|
+
}
|
|
304
|
+
throw new Error(`Unknown property type ${pt}`);
|
|
305
|
+
},
|
|
306
|
+
create: (propertyTypeJson) => {
|
|
307
|
+
if (Array.isArray(propertyTypeJson)) {
|
|
308
|
+
return propertyTypeJson.map((pt) => propertyType.create(pt));
|
|
309
|
+
}
|
|
310
|
+
if (propertyTypeJson.type === "array") {
|
|
311
|
+
return propertyArrayType.create(propertyTypeJson.items.type);
|
|
312
|
+
}
|
|
313
|
+
return propertyBaseType.create(propertyTypeJson);
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
const propertyBaseType = {
|
|
317
|
+
extract: (propertyBaseType) => ({
|
|
318
|
+
type: propertyBaseType.type,
|
|
319
|
+
}),
|
|
320
|
+
create: (btype) => new PropertyBaseType(btype.type),
|
|
321
|
+
};
|
|
322
|
+
const propertyArrayType = {
|
|
323
|
+
extract: (propertyArrayType) => ({
|
|
324
|
+
type: "array",
|
|
325
|
+
items: propertyBaseType.extract(propertyArrayType.items),
|
|
326
|
+
}),
|
|
327
|
+
create: (type) => new PropertyArrayType(propertyBaseType.create({ type })),
|
|
328
|
+
};
|
|
329
|
+
const nodeObjectType = {
|
|
330
|
+
extract: (nodeObjectType) => ({
|
|
331
|
+
$id: nodeObjectType.$id,
|
|
332
|
+
labels: nodeObjectType.labels.map(nodeLabel.toRef),
|
|
333
|
+
}),
|
|
334
|
+
create: (nodeObjectType, labelLookup) => {
|
|
335
|
+
return new NodeObjectType(nodeObjectType.$id, nodeObjectType.labels.map(({ $ref }) => labelLookup($ref)));
|
|
336
|
+
},
|
|
337
|
+
toRef: (nodeObjectType) => {
|
|
338
|
+
if (!nodeObjectType || !nodeObjectType.$id) {
|
|
339
|
+
throw new Error(`NodeObjectType is not defined`);
|
|
340
|
+
}
|
|
341
|
+
return {
|
|
342
|
+
$ref: `#${nodeObjectType.$id}`,
|
|
343
|
+
};
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
const relationshipObjectType = {
|
|
347
|
+
extract: (relationshipObjectType) => ({
|
|
348
|
+
$id: relationshipObjectType.$id,
|
|
349
|
+
type: relationshipType.toRef(relationshipObjectType.type),
|
|
350
|
+
from: nodeObjectType.toRef(relationshipObjectType.from),
|
|
351
|
+
to: nodeObjectType.toRef(relationshipObjectType.to),
|
|
352
|
+
}),
|
|
353
|
+
create: (relationshipObjectType, relTypeLookup, nodeObjectTypeLookup) => {
|
|
354
|
+
return new RelationshipObjectType(relationshipObjectType.$id, relTypeLookup(relationshipObjectType.type.$ref), nodeObjectTypeLookup(relationshipObjectType.from.$ref, "from"), nodeObjectTypeLookup(relationshipObjectType.to.$ref, "to"));
|
|
355
|
+
},
|
|
356
|
+
toRef: (relationshipObjectType) => ({
|
|
357
|
+
$ref: `#${relationshipObjectType.$id}`,
|
|
358
|
+
}),
|
|
359
|
+
};
|
|
360
|
+
//# sourceMappingURL=extensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.js","sourceRoot":"","sources":["../../../src/formatters/json/extensions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,WAAW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AI,CAAC,IAAI,EAAE,MAAM,CAAC,EAC9D,oBAAoB,CAAC,sBAAsB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAC3D,CAAC;IACJ,CAAC;IACD,KAAK,EAAE,CAAC,sBAA8C,EAAE,EAAE,CAAC,CAAC;QAC1D,IAAI,EAAE,IAAI,sBAAsB,CAAC,GAAG,EAAE;KACvC,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { toJson, fromJson, VERSION } from "./extensions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/formatters/json/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { ConstraintType, EntityType, IndexType, PrimitivePropertyTypes } from "../../model/index.js";
|
|
2
|
+
export type RootSchemaJsonStruct = {
|
|
3
|
+
graphSchemaRepresentation: GraphSchemaRepresentationJsonStruct;
|
|
4
|
+
};
|
|
5
|
+
export type GraphSchemaRepresentationJsonStruct = {
|
|
6
|
+
version: string;
|
|
7
|
+
graphSchema: GraphSchemaJsonStruct;
|
|
8
|
+
};
|
|
9
|
+
export type GraphSchemaJsonStruct = {
|
|
10
|
+
nodeLabels: NodeLabelJsonStruct[];
|
|
11
|
+
relationshipTypes: RelationshipTypeJsonStruct[];
|
|
12
|
+
nodeObjectTypes: NodeObjectTypeJsonStruct[];
|
|
13
|
+
relationshipObjectTypes: RelationshipObjectTypeJsonStruct[];
|
|
14
|
+
constraints: ConstraintJsonStruct[];
|
|
15
|
+
indexes: IndexJsonStruct[];
|
|
16
|
+
};
|
|
17
|
+
export type NodeLabelJsonStruct = {
|
|
18
|
+
$id: string;
|
|
19
|
+
token: string;
|
|
20
|
+
properties: PropertyJsonStruct[];
|
|
21
|
+
};
|
|
22
|
+
export type RelationshipTypeJsonStruct = {
|
|
23
|
+
$id: string;
|
|
24
|
+
token: string;
|
|
25
|
+
properties: PropertyJsonStruct[];
|
|
26
|
+
};
|
|
27
|
+
export type NodeObjectTypeJsonStruct = {
|
|
28
|
+
$id: string;
|
|
29
|
+
labels: {
|
|
30
|
+
$ref: string;
|
|
31
|
+
}[];
|
|
32
|
+
};
|
|
33
|
+
export type RelationshipObjectTypeJsonStruct = {
|
|
34
|
+
$id: string;
|
|
35
|
+
type: {
|
|
36
|
+
$ref: string;
|
|
37
|
+
};
|
|
38
|
+
from: {
|
|
39
|
+
$ref: string;
|
|
40
|
+
};
|
|
41
|
+
to: {
|
|
42
|
+
$ref: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export type ConstraintJsonStruct = {
|
|
46
|
+
$id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
constraintType: ConstraintType;
|
|
49
|
+
entityType: EntityType;
|
|
50
|
+
nodeLabel?: {
|
|
51
|
+
$ref: string;
|
|
52
|
+
};
|
|
53
|
+
relationshipType?: {
|
|
54
|
+
$ref: string;
|
|
55
|
+
};
|
|
56
|
+
properties: {
|
|
57
|
+
$ref: string;
|
|
58
|
+
}[];
|
|
59
|
+
};
|
|
60
|
+
export type NodeLabelConstraintJsonStruct = ConstraintJsonStruct & {
|
|
61
|
+
entityType: "node";
|
|
62
|
+
nodeLabel: {
|
|
63
|
+
$ref: string;
|
|
64
|
+
};
|
|
65
|
+
relationshipType: undefined;
|
|
66
|
+
};
|
|
67
|
+
export declare const isNodeLabelConstraintJsonStruct: (constraint: ConstraintJsonStruct) => constraint is NodeLabelConstraintJsonStruct;
|
|
68
|
+
export type RelationshipTypeConstraintJsonStruct = ConstraintJsonStruct & {
|
|
69
|
+
entityType: "relationship";
|
|
70
|
+
nodeLabel: undefined;
|
|
71
|
+
relationshipType: {
|
|
72
|
+
$ref: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export declare const isRelationshipTypeConstraintJsonStruct: (constraint: ConstraintJsonStruct) => constraint is RelationshipTypeConstraintJsonStruct;
|
|
76
|
+
export type IndexJsonStruct = {
|
|
77
|
+
$id: string;
|
|
78
|
+
name: string;
|
|
79
|
+
indexType: IndexType;
|
|
80
|
+
entityType: EntityType;
|
|
81
|
+
nodeLabel?: {
|
|
82
|
+
$ref: string;
|
|
83
|
+
};
|
|
84
|
+
relationshipType?: {
|
|
85
|
+
$ref: string;
|
|
86
|
+
};
|
|
87
|
+
properties?: {
|
|
88
|
+
$ref: string;
|
|
89
|
+
}[];
|
|
90
|
+
};
|
|
91
|
+
export type NodeLabelIndexJsonStruct = IndexJsonStruct & {
|
|
92
|
+
indexType: Exclude<IndexType, "lookup">;
|
|
93
|
+
entityType: "node";
|
|
94
|
+
nodeLabel: {
|
|
95
|
+
$ref: string;
|
|
96
|
+
};
|
|
97
|
+
relationshipType: undefined;
|
|
98
|
+
properties: {
|
|
99
|
+
$ref: string;
|
|
100
|
+
}[];
|
|
101
|
+
};
|
|
102
|
+
export type RelationshipTypeIndexJsonStruct = IndexJsonStruct & {
|
|
103
|
+
indexType: Exclude<IndexType, "lookup">;
|
|
104
|
+
entityType: "relationship";
|
|
105
|
+
nodeLabel: undefined;
|
|
106
|
+
relationshipType: {
|
|
107
|
+
$ref: string;
|
|
108
|
+
};
|
|
109
|
+
properties: {
|
|
110
|
+
$ref: string;
|
|
111
|
+
}[];
|
|
112
|
+
};
|
|
113
|
+
export type LookupIndexJsonStruct = IndexJsonStruct & {
|
|
114
|
+
indexType: "lookup";
|
|
115
|
+
nodeLabel: undefined;
|
|
116
|
+
relationshipType: undefined;
|
|
117
|
+
properties: undefined;
|
|
118
|
+
};
|
|
119
|
+
export declare const isNodeLabelIndexJsonStruct: (index: IndexJsonStruct) => index is NodeLabelIndexJsonStruct;
|
|
120
|
+
export declare const isRelationshipTypeIndexJsonStruct: (index: IndexJsonStruct) => index is RelationshipTypeIndexJsonStruct;
|
|
121
|
+
export declare const isLookupIndexJsonStruct: (index: IndexJsonStruct) => index is LookupIndexJsonStruct;
|
|
122
|
+
export type PropertyJsonStruct = {
|
|
123
|
+
$id: string;
|
|
124
|
+
token: string;
|
|
125
|
+
type: PropertyTypeJsonStructRecrsive;
|
|
126
|
+
nullable: boolean;
|
|
127
|
+
};
|
|
128
|
+
export type PrimitivePropertyTypesType = {
|
|
129
|
+
type: PrimitivePropertyTypes;
|
|
130
|
+
};
|
|
131
|
+
export type PrimitivePropertyTypesArrayType = {
|
|
132
|
+
type: "array";
|
|
133
|
+
items: {
|
|
134
|
+
type: PrimitivePropertyTypes;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
export type PropertyTypeJsonStruct = PrimitivePropertyTypesArrayType | PrimitivePropertyTypesType | (PrimitivePropertyTypesType | PrimitivePropertyTypesArrayType)[];
|
|
138
|
+
export type PropertyTypeJsonStructRecrsive = PropertyTypeJsonStruct | Array<PropertyTypeJsonStruct | PropertyTypeJsonStructRecrsive[]>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const isNodeLabelConstraintJsonStruct = (constraint) => {
|
|
2
|
+
return constraint.entityType === "node" && constraint.nodeLabel !== undefined;
|
|
3
|
+
};
|
|
4
|
+
export const isRelationshipTypeConstraintJsonStruct = (constraint) => {
|
|
5
|
+
return (constraint.entityType === "relationship" &&
|
|
6
|
+
constraint.relationshipType !== undefined);
|
|
7
|
+
};
|
|
8
|
+
export const isNodeLabelIndexJsonStruct = (index) => {
|
|
9
|
+
return index.nodeLabel !== undefined && index.indexType !== "lookup";
|
|
10
|
+
};
|
|
11
|
+
export const isRelationshipTypeIndexJsonStruct = (index) => {
|
|
12
|
+
return index.relationshipType !== undefined && index.indexType !== "lookup";
|
|
13
|
+
};
|
|
14
|
+
export const isLookupIndexJsonStruct = (index) => {
|
|
15
|
+
return index.indexType === "lookup";
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/formatters/json/types.ts"],"names":[],"mappings":"AAkEA,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,UAAgC,EACa,EAAE;IAC/C,OAAO,UAAU,CAAC,UAAU,KAAK,MAAM,IAAI,UAAU,CAAC,SAAS,KAAK,SAAS,CAAC;AAChF,CAAC,CAAC;AAQF,MAAM,CAAC,MAAM,sCAAsC,GAAG,CACpD,UAAgC,EACoB,EAAE;IACtD,OAAO,CACL,UAAU,CAAC,UAAU,KAAK,cAAc;QACxC,UAAU,CAAC,gBAAgB,KAAK,SAAS,CAC1C,CAAC;AACJ,CAAC,CAAC;AAmCF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,KAAsB,EACa,EAAE;IACrC,OAAO,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,KAAK,CAAC,SAAS,KAAK,QAAQ,CAAC;AACvE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAC/C,KAAsB,EACoB,EAAE;IAC5C,OAAO,KAAK,CAAC,gBAAgB,KAAK,SAAS,IAAI,KAAK,CAAC,SAAS,KAAK,QAAQ,CAAC;AAC9E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,KAAsB,EACU,EAAE;IAClC,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,CAAC;AACtC,CAAC,CAAC"}
|