|
22 | 22 | import org.immutables.builder.Builder; |
23 | 23 | import org.jetbrains.annotations.NotNull; |
24 | 24 | import org.neo4j.gds.NodeLabel; |
25 | | -import org.neo4j.gds.PropertyMapping; |
26 | 25 | import org.neo4j.gds.RelationshipType; |
27 | 26 | import org.neo4j.gds.api.CSRGraphStoreFactory; |
28 | 27 | import org.neo4j.gds.api.DatabaseId; |
|
31 | 30 | import org.neo4j.gds.api.IdMap; |
32 | 31 | import org.neo4j.gds.api.PropertyState; |
33 | 32 | import org.neo4j.gds.api.nodeproperties.ValueType; |
34 | | -import org.neo4j.gds.api.properties.nodes.NodePropertyValues; |
35 | 33 | import org.neo4j.gds.api.schema.Direction; |
36 | 34 | import org.neo4j.gds.api.schema.GraphSchema; |
37 | 35 | import org.neo4j.gds.api.schema.RelationshipSchema; |
|
49 | 47 | import org.neo4j.gds.core.loading.construction.NodeLabelTokens; |
50 | 48 | import org.neo4j.gds.core.loading.construction.PropertyValues; |
51 | 49 | import org.neo4j.gds.core.loading.construction.RelationshipsBuilder; |
52 | | -import org.neo4j.gds.core.loading.nodeproperties.NodePropertiesFromStoreBuilder; |
53 | 50 | import org.neo4j.gds.core.utils.mem.MemoryEstimation; |
54 | 51 | import org.neo4j.gds.core.utils.mem.MemoryEstimations; |
55 | 52 | import org.neo4j.gds.core.utils.progress.tasks.ProgressTracker; |
@@ -165,34 +162,6 @@ protected ProgressTracker initProgressTracker() { |
165 | 162 |
|
166 | 163 | @Override |
167 | 164 | protected GraphSchema computeGraphSchema(Nodes nodes, RelationshipImportResult relationshipImportResult) { |
168 | | -// var nodeProperties = nodes.properties(); |
169 | | -// var nodeSchema = NodeSchema.empty(); |
170 | | -// gdlHandler |
171 | | -// .getVertices() |
172 | | -// .forEach(vertex -> { |
173 | | -// var labels = vertex.getLabels().stream().map(NodeLabel::of).collect(Collectors.toList()); |
174 | | -// if (labels.isEmpty()) { |
175 | | -// labels = List.of(NodeLabel.ALL_NODES); |
176 | | -// } |
177 | | -// |
178 | | -// labels.forEach(label -> vertex |
179 | | -// .getProperties() |
180 | | -// .forEach((propertyKey, propertyValue) -> nodeSchema |
181 | | -// .getOrCreateLabel(label) |
182 | | -// .addProperty( |
183 | | -// propertyKey, |
184 | | -// PropertySchema.of( |
185 | | -// propertyKey, |
186 | | -// nodeProperties.get(propertyKey).valueType(), |
187 | | -// nodeProperties.get(propertyKey).defaultValue(), |
188 | | -// nodeProperties.get(propertyKey).propertyState() |
189 | | -// ) |
190 | | -// ) |
191 | | -// )); |
192 | | -// }); |
193 | | -// // in case there were no properties add all labels |
194 | | -// nodes.idMap().availableNodeLabels().forEach(nodeSchema::getOrCreateLabel); |
195 | | - |
196 | 165 | var relationshipSchema = relationshipImportResult.importResults().entrySet().stream().reduce( |
197 | 166 | RelationshipSchema.empty(), |
198 | 167 | (unionSchema, entry) -> { |
@@ -259,31 +228,7 @@ private Nodes loadNodes() { |
259 | 228 | ); |
260 | 229 | }); |
261 | 230 |
|
262 | | - var nodes = nodesBuilder.build(); |
263 | | - return Nodes.of(nodes.schema(), nodes.idMap(), loadNodeProperties(nodes.idMap()), graphProjectConfig.propertyState()); |
264 | | - } |
265 | | - |
266 | | - private Map<PropertyMapping, NodePropertyValues> loadNodeProperties(IdMap idMap) { |
267 | | - var propertyBuilders = new HashMap<PropertyMapping, NodePropertiesFromStoreBuilder>(); |
268 | | - |
269 | | - gdlHandler.getVertices().forEach(vertex -> vertex |
270 | | - .getProperties() |
271 | | - .forEach((propertyKey, propertyValue) -> { |
272 | | - if (propertyValue instanceof List) { |
273 | | - propertyValue = convertListProperty((List<?>) propertyValue); |
274 | | - } |
275 | | - |
276 | | - propertyBuilders.computeIfAbsent(PropertyMapping.of(propertyKey), (key) -> |
277 | | - NodePropertiesFromStoreBuilder.of( |
278 | | - DefaultValue.DEFAULT, |
279 | | - 1 |
280 | | - )).set(vertex.getId(), Values.of(propertyValue)); |
281 | | - })); |
282 | | - |
283 | | - return propertyBuilders |
284 | | - .entrySet() |
285 | | - .stream() |
286 | | - .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().build(idMap))); |
| 231 | + return nodesBuilder.build(); |
287 | 232 | } |
288 | 233 |
|
289 | 234 | @NotNull |
|
0 commit comments