File tree Expand file tree Collapse file tree 4 files changed +17
-15
lines changed
main/java/org/neo4j/gds/core/loading
test/java/org/neo4j/gds/config
cypher-aggregation/src/main/java/org/neo4j/gds/projection
io/core/src/test/java/org/neo4j/gds/core/io/file Expand file tree Collapse file tree 4 files changed +17
-15
lines changed Original file line number Diff line number Diff line change 2020package org .neo4j .gds .core .loading ;
2121
2222import org .immutables .value .Value ;
23- import org .jetbrains .annotations .TestOnly ;
2423import org .neo4j .gds .annotation .ValueClass ;
2524import org .neo4j .gds .api .IdMap ;
2625import org .neo4j .gds .api .properties .nodes .NodePropertyStore ;
2928@ ValueClass
3029public interface Nodes {
3130
32- @ Value .Default
33- default NodeSchema schema () {
34- return NodeSchema .empty ();
35- }
31+ NodeSchema schema ();
3632
3733 IdMap idMap ();
3834
@@ -41,9 +37,4 @@ default NodePropertyStore properties() {
4137 return NodePropertyStore .empty ();
4238 }
4339
44- @ TestOnly
45- static Nodes of (IdMap idmap ) {
46- return ImmutableNodes .of (NodeSchema .empty (), idmap , NodePropertyStore .empty ());
47- }
48-
4940}
Original file line number Diff line number Diff line change 2424import org .neo4j .gds .annotation .Configuration ;
2525import org .neo4j .gds .api .DatabaseId ;
2626import org .neo4j .gds .api .schema .GraphSchema ;
27+ import org .neo4j .gds .api .schema .NodeSchema ;
2728import org .neo4j .gds .core .CypherMapWrapper ;
2829import org .neo4j .gds .core .huge .DirectIdMap ;
2930import org .neo4j .gds .core .loading .GraphStoreBuilder ;
31+ import org .neo4j .gds .core .loading .ImmutableNodes ;
3032import org .neo4j .gds .core .loading .ImmutableStaticCapabilities ;
31- import org .neo4j .gds .core .loading .Nodes ;
3233import org .neo4j .gds .core .loading .RelationshipImportResult ;
3334
3435import java .util .List ;
@@ -44,11 +45,16 @@ void validateGraphStoreCapabilities(boolean isBackedByDatabase) {
4445 var config = CypherMapWrapper .empty ();
4546 var testConfig = new TestWriteConfigImpl (config );
4647
48+ var nodes = ImmutableNodes .builder ()
49+ .idMap (new DirectIdMap (0 ))
50+ .schema (NodeSchema .empty ())
51+ .build ();
52+
4753 var testGraphStore = new GraphStoreBuilder ()
4854 .databaseId (DatabaseId .from ("neo4j" ))
4955 .capabilities (ImmutableStaticCapabilities .of (isBackedByDatabase ))
5056 .schema (GraphSchema .empty ())
51- .nodes (Nodes . of ( new DirectIdMap ( 0 )) )
57+ .nodes (nodes )
5258 .relationshipImportResult (RelationshipImportResult .of (Map .of ()))
5359 .concurrency (1 )
5460 .build ();
Original file line number Diff line number Diff line change @@ -652,7 +652,7 @@ private AdjacencyCompressor.ValueMapper buildNodesWithProperties(GraphStoreBuild
652652 );
653653 });
654654
655- graphStoreBuilder .nodes (nodesBuilder .build ());
655+ graphStoreBuilder .nodes (nodesBuilder .schema ( nodeSchema ). build ());
656656
657657 // Relationships are added using their intermediate node ids.
658658 // In order to map to the final internal ids, we need to use
Original file line number Diff line number Diff line change 2727import org .neo4j .gds .api .RelationshipPropertyStore ;
2828import org .neo4j .gds .core .io .GraphStoreRelationshipVisitor ;
2929import org .neo4j .gds .core .loading .GraphStoreBuilder ;
30+ import org .neo4j .gds .core .loading .ImmutableNodes ;
3031import org .neo4j .gds .core .loading .ImmutableStaticCapabilities ;
31- import org .neo4j .gds .core .loading .Nodes ;
3232import org .neo4j .gds .core .loading .RelationshipImportResult ;
3333import org .neo4j .gds .core .loading .construction .GraphFactory ;
3434import org .neo4j .gds .core .loading .construction .RelationshipsBuilder ;
@@ -151,11 +151,16 @@ private Graph createGraph(
151151 var actualRelationships = FileToGraphStoreImporter .relationshipTopologyAndProperties (relationshipBuildersByType );
152152 assertThat (actualRelationships .importedRelationships ()).isEqualTo (expectedImportedRelationshipsCount );
153153
154+ var nodes = ImmutableNodes .builder ()
155+ .idMap (expectedGraph )
156+ .schema (expectedGraph .schema ().nodeSchema ())
157+ .build ();
158+
154159 Map <RelationshipType , RelationshipPropertyStore > propertyStores = actualRelationships .properties ();
155160 return new GraphStoreBuilder ()
156161 .schema (expectedGraph .schema ())
157162 .capabilities (ImmutableStaticCapabilities .of (true ))
158- .nodes (Nodes . of ( expectedGraph ) )
163+ .nodes (nodes )
159164 .relationshipImportResult (RelationshipImportResult .of (
160165 actualRelationships .topologies (),
161166 propertyStores ,
You can’t perform that action at this time.
0 commit comments