diff --git a/alpha/alpha-proc/build.gradle b/alpha/alpha-proc/build.gradle index 624dddffbf4..43c8b3dd924 100644 --- a/alpha/alpha-proc/build.gradle +++ b/alpha/alpha-proc/build.gradle @@ -29,6 +29,7 @@ dependencies { implementation project(':core') implementation project(':core-utils') implementation project(':core-write') + implementation project(':legacy-cypher-projection') implementation project(':executor') implementation project(':memory-usage') implementation project(':neo4j-api') diff --git a/alpha/alpha-proc/src/main/java/org/neo4j/gds/linkprediction/LinkPredictionFunc.java b/alpha/alpha-proc/src/main/java/org/neo4j/gds/linkprediction/LinkPredictionFunc.java index 51afdc08971..518f236055e 100644 --- a/alpha/alpha-proc/src/main/java/org/neo4j/gds/linkprediction/LinkPredictionFunc.java +++ b/alpha/alpha-proc/src/main/java/org/neo4j/gds/linkprediction/LinkPredictionFunc.java @@ -31,7 +31,7 @@ import java.util.Map; import java.util.Set; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.RELATIONSHIP_QUERY_KEY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.RELATIONSHIP_QUERY_KEY; import static org.neo4j.gds.core.ProcedureConstants.DIRECTION_KEY; public class LinkPredictionFunc extends BaseProc { diff --git a/applications/graph-store-catalog/build.gradle b/applications/graph-store-catalog/build.gradle index 08589128471..3b5ba8313fa 100644 --- a/applications/graph-store-catalog/build.gradle +++ b/applications/graph-store-catalog/build.gradle @@ -32,6 +32,7 @@ dependencies { implementation project(':config-api') implementation project(':core') implementation project(':core-write') + implementation project(':legacy-cypher-projection') implementation project(':executor') implementation project(':graph-projection-api') implementation project(':graph-sampling') diff --git a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CatalogBusinessFacade.java b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CatalogBusinessFacade.java index c8881063b60..7029f859a3c 100644 --- a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CatalogBusinessFacade.java +++ b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CatalogBusinessFacade.java @@ -25,7 +25,6 @@ import org.neo4j.gds.core.loading.GraphDropNodePropertiesResult; import org.neo4j.gds.core.loading.GraphDropRelationshipResult; import org.neo4j.gds.core.loading.GraphFilterResult; -import org.neo4j.gds.core.loading.GraphProjectCypherResult; import org.neo4j.gds.core.loading.GraphStoreWithConfig; import org.neo4j.gds.core.utils.TerminationFlag; import org.neo4j.gds.core.utils.progress.TaskRegistryFactory; @@ -34,6 +33,7 @@ import org.neo4j.gds.core.write.NodePropertyExporterBuilder; import org.neo4j.gds.core.write.RelationshipExporterBuilder; import org.neo4j.gds.core.write.RelationshipPropertiesExporterBuilder; +import org.neo4j.gds.legacycypherprojection.GraphProjectCypherResult; import org.neo4j.gds.projection.GraphProjectNativeResult; import org.neo4j.gds.results.MemoryEstimateResult; import org.neo4j.gds.transaction.TransactionContext; diff --git a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CatalogConfigurationService.java b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CatalogConfigurationService.java index e58342d5b17..95ea902c94c 100644 --- a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CatalogConfigurationService.java +++ b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CatalogConfigurationService.java @@ -25,7 +25,6 @@ import org.neo4j.gds.config.BaseConfig; import org.neo4j.gds.config.GraphDropNodePropertiesConfig; import org.neo4j.gds.config.GraphProjectConfig; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; import org.neo4j.gds.config.GraphProjectFromGraphConfig; import org.neo4j.gds.config.GraphRemoveGraphPropertiesConfig; import org.neo4j.gds.config.GraphStreamGraphPropertiesConfig; @@ -36,6 +35,7 @@ import org.neo4j.gds.core.CypherMapAccess; import org.neo4j.gds.core.CypherMapWrapper; import org.neo4j.gds.core.loading.GraphStoreWithConfig; +import org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig; import org.neo4j.gds.graphsampling.config.CommonNeighbourAwareRandomWalkConfig; import org.neo4j.gds.projection.GraphProjectFromStoreConfig; diff --git a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CypherProjectApplication.java b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CypherProjectApplication.java index 4e6c05768cc..8b4d69f57a8 100644 --- a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CypherProjectApplication.java +++ b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/CypherProjectApplication.java @@ -21,11 +21,11 @@ import org.neo4j.gds.api.DatabaseId; import org.neo4j.gds.config.GraphProjectConfig; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; -import org.neo4j.gds.core.loading.GraphProjectCypherResult; import org.neo4j.gds.core.utils.TerminationFlag; import org.neo4j.gds.core.utils.progress.TaskRegistryFactory; import org.neo4j.gds.core.utils.warnings.UserLogRegistryFactory; +import org.neo4j.gds.legacycypherprojection.GraphProjectCypherResult; +import org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig; import org.neo4j.gds.results.MemoryEstimateResult; import org.neo4j.gds.transaction.TransactionContext; import org.neo4j.graphdb.GraphDatabaseService; diff --git a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/DefaultCatalogBusinessFacade.java b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/DefaultCatalogBusinessFacade.java index baf0ff01831..003a790cdfd 100644 --- a/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/DefaultCatalogBusinessFacade.java +++ b/applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/DefaultCatalogBusinessFacade.java @@ -30,7 +30,6 @@ import org.neo4j.gds.core.loading.GraphDropNodePropertiesResult; import org.neo4j.gds.core.loading.GraphDropRelationshipResult; import org.neo4j.gds.core.loading.GraphFilterResult; -import org.neo4j.gds.core.loading.GraphProjectCypherResult; import org.neo4j.gds.core.loading.GraphStoreCatalogService; import org.neo4j.gds.core.loading.GraphStoreWithConfig; import org.neo4j.gds.core.utils.TerminationFlag; @@ -40,6 +39,7 @@ import org.neo4j.gds.core.write.NodePropertyExporterBuilder; import org.neo4j.gds.core.write.RelationshipExporterBuilder; import org.neo4j.gds.core.write.RelationshipPropertiesExporterBuilder; +import org.neo4j.gds.legacycypherprojection.GraphProjectCypherResult; import org.neo4j.gds.graphsampling.RandomWalkBasedNodesSampler; import org.neo4j.gds.graphsampling.config.RandomWalkWithRestartsConfig; import org.neo4j.gds.logging.Log; diff --git a/core/build.gradle b/core/build.gradle index 32ee6091d4f..1d63df0951a 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -61,10 +61,11 @@ dependencies { testAnnotationProcessor project(':config-generator') testAnnotationProcessor group: 'org.immutables', name: 'value', version: ver.'immutables' + testImplementation project(':legacy-cypher-projection') + testImplementation project(':edition-api') testImplementation project(':progress-tracking') testImplementation project(':test-graph-loaders') testImplementation project(':test-utils') - testImplementation project(':edition-api') testImplementation group: 'net.jqwik', name: 'jqwik', version: ver.'jqwik' testImplementation group: 'io.qala.datagen', name: 'qala-datagen-junit5', version: ver.'qala-datagen' diff --git a/core/src/main/java/org/neo4j/gds/config/GraphProjectConfig.java b/core/src/main/java/org/neo4j/gds/config/GraphProjectConfig.java index b29bf4f0ce3..1d3dcad82bd 100644 --- a/core/src/main/java/org/neo4j/gds/config/GraphProjectConfig.java +++ b/core/src/main/java/org/neo4j/gds/config/GraphProjectConfig.java @@ -118,8 +118,6 @@ default void validateReadConcurrency() { interface Cases { - R cypher(GraphProjectFromCypherConfig cypherConfig); - R graph(GraphProjectFromGraphConfig graphConfig); R random(RandomGraphGeneratorConfig randomGraphConfig); @@ -131,12 +129,6 @@ interface Cases { interface Visitor extends Cases { - @Override - default Void cypher(GraphProjectFromCypherConfig cypherConfig) { - visit(cypherConfig); - return null; - } - @Override default Void graph(GraphProjectFromGraphConfig graphConfig) { visit(graphConfig); @@ -161,8 +153,6 @@ default Void catalog(GraphCatalogConfig graphCatalogConfig) { return null; } - default void visit(GraphProjectFromCypherConfig cypherConfig) {} - default void visit(GraphProjectFromGraphConfig graphConfig) {} default void visit(RandomGraphGeneratorConfig randomGraphConfig) {} diff --git a/core/src/test/java/org/neo4j/gds/core/GraphLoaderDirectionalityTest.java b/core/src/test/java/org/neo4j/gds/core/GraphLoaderDirectionalityTest.java index fe823732db3..93f9d74b607 100644 --- a/core/src/test/java/org/neo4j/gds/core/GraphLoaderDirectionalityTest.java +++ b/core/src/test/java/org/neo4j/gds/core/GraphLoaderDirectionalityTest.java @@ -24,7 +24,7 @@ import org.neo4j.gds.Orientation; import org.neo4j.gds.StoreLoaderBuilder; import org.neo4j.gds.api.Graph; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; +import org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.neo4j.gds.GraphFactoryTestSupport.AllGraphStoreFactoryTypesTest; diff --git a/graph-construction/build.gradle b/graph-construction/build.gradle new file mode 100644 index 00000000000..e08ec630ca6 --- /dev/null +++ b/graph-construction/build.gradle @@ -0,0 +1,38 @@ +apply plugin: 'java-library' + +description = 'Neo4j Graph Data Science :: Graph Construction' +group = 'org.neo4j.gds' + +dependencies { + annotationProcessor project(':annotations') + annotationProcessor group: 'org.immutables', name: 'builder', version: ver.'immutables' + annotationProcessor group: 'org.immutables', name: 'value', version: ver.'immutables' + annotationProcessor group: 'org.neo4j', name: 'annotations', version: ver.'neo4j' + + compileOnly group: 'org.immutables', name: 'builder', version: ver.'immutables' + compileOnly group: 'org.immutables', name: 'value-annotations', version: ver.'immutables' + compileOnly group: 'org.jetbrains', name: 'annotations', version: ver.'jetbrains-annotations' + + implementation project(':annotations') +// implementation project(':config-api') + implementation project(':core') +// implementation project(':core-utils') + implementation project(':graph-schema-api') +// implementation project(':memory-usage') +// implementation project(':progress-tracking') +// implementation project(':string-formatting') +// implementation project(':transaction') + +// implementation group: 'org.openjdk.jol', name: 'jol-core', version: ver.'jol' +// implementation group: 'org.opencypher', name: 'cypher-javacc-parser-9.0', version: ver.'opencypher-front-end', transitive: false +// implementation group: 'org.hdrhistogram', name: 'HdrHistogram', version: ver.'HdrHistogram' + + testAnnotationProcessor project(':annotations') + + testCompileOnly group: 'org.immutables', name: 'value-annotations', version: ver.'immutables' + testCompileOnly group: 'org.immutables', name: 'builder', version: ver.'immutables' + testCompileOnly group: 'org.jetbrains', name: 'annotations', version: ver.'jetbrains-annotations' + testCompileOnly group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: ver.'spotbugsToolVersion' + + testImplementation project(':test-utils') +} diff --git a/legacy-cypher-projection/build.gradle b/legacy-cypher-projection/build.gradle new file mode 100644 index 00000000000..9f9646c99c0 --- /dev/null +++ b/legacy-cypher-projection/build.gradle @@ -0,0 +1,52 @@ +apply plugin: 'java-library' + +description = 'Neo4j Graph Data Science :: Cypher Projection' +group = 'org.neo4j.gds' + +dependencies { + annotationProcessor project(':annotations') + annotationProcessor project(':config-generator') + annotationProcessor group: 'org.immutables', name: 'builder', version: ver.'immutables' + annotationProcessor group: 'org.immutables', name: 'value', version: ver.'immutables' + annotationProcessor group: 'org.neo4j', name: 'annotations', version: ver.'neo4j' + + compileOnly group: 'org.immutables', name: 'value-annotations', version: ver.'immutables' + compileOnly group: 'org.jetbrains', name: 'annotations', version: ver.'jetbrains-annotations' + + neodeps().each { + compileOnly(group: 'org.neo4j', name: it, version: ver.'neo4j') { + transitive = false + } + } + + implementation project(':annotations') + implementation project(':config-api') + implementation project(':core') + implementation project(':graph-schema-api') + implementation project(':memory-usage') + implementation project(':progress-tracking') + implementation project(':string-formatting') + implementation project(':transaction') + + + implementation group: 'org.openjdk.jol', name: 'jol-core', version: ver.'jol' + implementation group: 'org.opencypher', name: 'cypher-javacc-parser-9.0', version: ver.'opencypher-front-end', transitive: false + implementation group: 'org.hdrhistogram', name: 'HdrHistogram', version: ver.'HdrHistogram' + + testAnnotationProcessor project(':annotations') + + testCompileOnly group: 'org.immutables', name: 'value-annotations', version: ver.'immutables' + testCompileOnly group: 'org.immutables', name: 'builder', version: ver.'immutables' + testCompileOnly group: 'org.jetbrains', name: 'annotations', version: ver.'jetbrains-annotations' + testCompileOnly group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: ver.'spotbugsToolVersion' + + testImplementation project(':executor') + testImplementation project(':test-utils') + testImplementation project(':proc-catalog') + testImplementation project(':proc-community') + testImplementation project(':test-graph-loaders') + + testImplementation group: 'org.neo4j', name: 'neo4j-cypher-dsl', version: ver.'cypher-dsl' + + testImplementation project(':opengds-extension') +} diff --git a/core/src/main/java/org/neo4j/gds/core/loading/BatchLoadResult.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/BatchLoadResult.java similarity index 95% rename from core/src/main/java/org/neo4j/gds/core/loading/BatchLoadResult.java rename to legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/BatchLoadResult.java index c8d3e423358..dc36329beaf 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/BatchLoadResult.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/BatchLoadResult.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; class BatchLoadResult { diff --git a/core/src/main/java/org/neo4j/gds/core/loading/CountingCypherRecordLoader.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CountingCypherRecordLoader.java similarity index 96% rename from core/src/main/java/org/neo4j/gds/core/loading/CountingCypherRecordLoader.java rename to legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CountingCypherRecordLoader.java index 3755610730c..24dcf8442dc 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/CountingCypherRecordLoader.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CountingCypherRecordLoader.java @@ -17,10 +17,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; import org.neo4j.gds.api.GraphLoaderContext; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; import org.neo4j.graphdb.security.AuthorizationViolationException; import org.neo4j.kernel.impl.coreapi.InternalTransaction; diff --git a/core/src/main/java/org/neo4j/gds/core/loading/CypherFactory.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherFactory.java similarity index 97% rename from core/src/main/java/org/neo4j/gds/core/loading/CypherFactory.java rename to legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherFactory.java index 8071761186a..fa3e6465753 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/CypherFactory.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherFactory.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; import org.neo4j.gds.ElementProjection; import org.neo4j.gds.NodeLabel; @@ -30,7 +30,9 @@ import org.neo4j.gds.api.CSRGraphStoreFactory; import org.neo4j.gds.api.DefaultValue; import org.neo4j.gds.api.GraphLoaderContext; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; +import org.neo4j.gds.core.loading.CSRGraphStore; +import org.neo4j.gds.core.loading.Capabilities; +import org.neo4j.gds.core.loading.ImmutableStaticCapabilities; import org.neo4j.gds.core.GraphDimensions; import org.neo4j.gds.core.ImmutableGraphDimensions; import org.neo4j.gds.core.utils.mem.MemoryEstimation; @@ -46,7 +48,7 @@ import java.util.stream.Collectors; import java.util.stream.LongStream; -import static org.neo4j.gds.core.loading.CypherQueryEstimator.EstimationResult; +import static org.neo4j.gds.legacycypherprojection.CypherQueryEstimator.EstimationResult; import static org.neo4j.internal.kernel.api.security.AccessMode.Static.READ; public final class CypherFactory extends CSRGraphStoreFactory { diff --git a/core/src/main/java/org/neo4j/gds/core/loading/CypherLoadingUtils.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherLoadingUtils.java similarity index 96% rename from core/src/main/java/org/neo4j/gds/core/loading/CypherLoadingUtils.java rename to legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherLoadingUtils.java index 70201d44fb8..e63c79644f0 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/CypherLoadingUtils.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherLoadingUtils.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; import org.neo4j.kernel.impl.query.QueryExecutionKernelException; import org.neo4j.kernel.impl.query.QuerySubscription; diff --git a/core/src/main/java/org/neo4j/gds/core/loading/CypherNodeLoader.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherNodeLoader.java similarity index 97% rename from core/src/main/java/org/neo4j/gds/core/loading/CypherNodeLoader.java rename to legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherNodeLoader.java index f6b85b0a2ca..8c3621d4cf1 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/CypherNodeLoader.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherNodeLoader.java @@ -17,12 +17,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; import org.immutables.value.Value; import org.neo4j.gds.api.GraphLoaderContext; import org.neo4j.gds.api.PropertyState; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; +import org.neo4j.gds.core.loading.Nodes; import org.neo4j.gds.core.loading.construction.GraphFactory; import org.neo4j.gds.core.loading.construction.NodesBuilder; import org.neo4j.gds.core.utils.progress.tasks.ProgressTracker; diff --git a/core/src/main/java/org/neo4j/gds/core/loading/CypherQueryEstimator.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherQueryEstimator.java similarity index 98% rename from core/src/main/java/org/neo4j/gds/core/loading/CypherQueryEstimator.java rename to legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherQueryEstimator.java index 5d11e1a105f..6260aed2089 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/CypherQueryEstimator.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherQueryEstimator.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; import org.neo4j.gds.PropertyMapping; import org.neo4j.gds.annotation.ValueClass; diff --git a/core/src/main/java/org/neo4j/gds/core/loading/CypherRecordLoader.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherRecordLoader.java similarity index 98% rename from core/src/main/java/org/neo4j/gds/core/loading/CypherRecordLoader.java rename to legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherRecordLoader.java index 672b1e2ca04..84c9de17233 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/CypherRecordLoader.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherRecordLoader.java @@ -17,11 +17,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; import org.neo4j.gds.api.GraphLoaderContext; import org.neo4j.gds.compat.Neo4jProxy; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; +import org.neo4j.gds.core.loading.RecordsBatchBuffer; import org.neo4j.gds.utils.StringJoining; import org.neo4j.graphdb.security.AuthorizationViolationException; import org.neo4j.kernel.GraphDatabaseQueryService; diff --git a/core/src/main/java/org/neo4j/gds/core/loading/CypherRelationshipLoader.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherRelationshipLoader.java similarity index 98% rename from core/src/main/java/org/neo4j/gds/core/loading/CypherRelationshipLoader.java rename to legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherRelationshipLoader.java index 0a9c007fdc7..1e548cff9fd 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/CypherRelationshipLoader.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherRelationshipLoader.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; import org.eclipse.collections.impl.map.mutable.primitive.ObjectDoubleHashMap; import org.immutables.value.Value; @@ -29,8 +29,8 @@ import org.neo4j.gds.api.DefaultValue; import org.neo4j.gds.api.GraphLoaderContext; import org.neo4j.gds.api.IdMap; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; import org.neo4j.gds.core.Aggregation; +import org.neo4j.gds.core.loading.RelationshipImportResult; import org.neo4j.gds.core.loading.construction.GraphFactory; import org.neo4j.gds.core.loading.construction.RelationshipsBuilder; import org.neo4j.gds.core.utils.progress.tasks.ProgressTracker; diff --git a/core/src/main/java/org/neo4j/gds/core/loading/GraphProjectCypherResult.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/GraphProjectCypherResult.java similarity index 95% rename from core/src/main/java/org/neo4j/gds/core/loading/GraphProjectCypherResult.java rename to legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/GraphProjectCypherResult.java index d9192002f17..1a33b99c292 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/GraphProjectCypherResult.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/GraphProjectCypherResult.java @@ -17,9 +17,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; +import org.neo4j.gds.core.loading.GraphProjectResult; public final class GraphProjectCypherResult extends GraphProjectResult { public final String nodeQuery; diff --git a/core/src/main/java/org/neo4j/gds/config/GraphProjectFromCypherConfig.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/GraphProjectFromCypherConfig.java similarity index 85% rename from core/src/main/java/org/neo4j/gds/config/GraphProjectFromCypherConfig.java rename to legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/GraphProjectFromCypherConfig.java index 9a32bb09672..91a096284e9 100644 --- a/core/src/main/java/org/neo4j/gds/config/GraphProjectFromCypherConfig.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/GraphProjectFromCypherConfig.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.config; +package org.neo4j.gds.legacycypherprojection; import org.immutables.value.Value; import org.neo4j.gds.annotation.Configuration; @@ -25,9 +25,9 @@ import org.neo4j.gds.api.GraphLoaderContext; import org.neo4j.gds.api.GraphStore; import org.neo4j.gds.api.GraphStoreFactory; +import org.neo4j.gds.config.GraphProjectConfig; import org.neo4j.gds.core.CypherMapWrapper; import org.neo4j.gds.core.GraphDimensions; -import org.neo4j.gds.core.loading.CypherFactory; import java.util.Arrays; import java.util.Collection; @@ -66,7 +66,7 @@ public interface GraphProjectFromCypherConfig extends GraphProjectConfig { String relationshipQuery(); @Value.Default - @Configuration.ToMapValue("org.neo4j.gds.config.GraphProjectFromCypherConfig#listParameterKeys") + @Configuration.ToMapValue("org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig#listParameterKeys") default Map parameters() { return Collections.emptyMap(); } @@ -105,8 +105,11 @@ default boolean sudo() { @Override @Configuration.Ignore - default R accept(Cases visitor) { - return visitor.cypher(this); + default R accept(GraphProjectConfig.Cases cases) { + if (cases instanceof Cases) { + return ((Cases) cases).cypher(this); + } + return null; } @Value.Derived @@ -157,4 +160,20 @@ static void assertNoProjectionsOrExplicitProperties(CypherMapWrapper config) { static Collection listParameterKeys(Map parameters) { return parameters.keySet(); } + + interface Cases extends GraphProjectConfig.Cases { + + R cypher(GraphProjectFromCypherConfig graphProjectFromCypherConfig); + } + + interface Visitor extends Cases, GraphProjectConfig.Visitor { + + @Override + default Void cypher(GraphProjectFromCypherConfig graphProjectFromCypherConfig) { + visit(graphProjectFromCypherConfig); + return null; + } + + default void visit(GraphProjectFromCypherConfig graphProjectFromCypherConfig) {} + } } diff --git a/core/src/main/java/org/neo4j/gds/core/loading/NodeSubscriber.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/NodeSubscriber.java similarity index 97% rename from core/src/main/java/org/neo4j/gds/core/loading/NodeSubscriber.java rename to legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/NodeSubscriber.java index 67970c753bb..507248f791b 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/NodeSubscriber.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/NodeSubscriber.java @@ -17,8 +17,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; +import org.neo4j.gds.core.loading.ValueConverter; import org.neo4j.gds.core.loading.construction.NodeLabelTokens; import org.neo4j.gds.core.loading.construction.NodesBuilder; import org.neo4j.gds.core.utils.ErrorCachingQuerySubscriber; diff --git a/core/src/main/java/org/neo4j/gds/core/loading/RelationshipSubscriber.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/RelationshipSubscriber.java similarity index 99% rename from core/src/main/java/org/neo4j/gds/core/loading/RelationshipSubscriber.java rename to legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/RelationshipSubscriber.java index 883bb69e4ba..561851f89af 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/RelationshipSubscriber.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/RelationshipSubscriber.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; import org.eclipse.collections.api.map.primitive.ObjectDoubleMap; import org.neo4j.gds.RelationshipType; diff --git a/core/src/main/java/org/neo4j/gds/core/loading/ResultCountingSubscriber.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/ResultCountingSubscriber.java similarity index 96% rename from core/src/main/java/org/neo4j/gds/core/loading/ResultCountingSubscriber.java rename to legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/ResultCountingSubscriber.java index 12b2feb59ae..f4e5b1f0f63 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/ResultCountingSubscriber.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/ResultCountingSubscriber.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; import org.neo4j.gds.core.utils.ErrorCachingQuerySubscriber; import org.neo4j.graphdb.QueryStatistics; diff --git a/core/src/test/java/org/neo4j/gds/core/loading/CypherFactoryTest.java b/legacy-cypher-projection/src/test/java/org/neo4j/gds/legacycypherprojection/CypherFactoryTest.java similarity index 99% rename from core/src/test/java/org/neo4j/gds/core/loading/CypherFactoryTest.java rename to legacy-cypher-projection/src/test/java/org/neo4j/gds/legacycypherprojection/CypherFactoryTest.java index 716e2f36c77..ff79a851d4c 100644 --- a/core/src/test/java/org/neo4j/gds/core/loading/CypherFactoryTest.java +++ b/legacy-cypher-projection/src/test/java/org/neo4j/gds/legacycypherprojection/CypherFactoryTest.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; import org.apache.commons.lang3.tuple.Pair; import org.eclipse.collections.api.block.function.Function; @@ -29,6 +29,7 @@ import org.junit.jupiter.params.provider.MethodSource; import org.neo4j.gds.BaseTest; import org.neo4j.gds.CypherLoaderBuilder; +import org.neo4j.gds.GraphFactoryTestSupport.FactoryType; import org.neo4j.gds.NodeLabel; import org.neo4j.gds.PropertyMapping; import org.neo4j.gds.PropertyMappings; @@ -55,7 +56,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.neo4j.gds.GraphFactoryTestSupport.FactoryType.CYPHER; import static org.neo4j.gds.RelationshipType.ALL_RELATIONSHIPS; import static org.neo4j.gds.TestSupport.assertGraphEquals; import static org.neo4j.gds.TestSupport.fromGdl; @@ -281,7 +281,7 @@ void testMultipleNodeProperties() { PropertyMapping prop2 = PropertyMapping.of("prop2", 0); PropertyMapping prop3 = PropertyMapping.of("prop3", 0); - Graph graph = TestGraphLoaderFactory.graphLoader(db, CYPHER) + Graph graph = TestGraphLoaderFactory.graphLoader(db, FactoryType.CYPHER) .withNodeProperties(PropertyMappings.of(prop1, prop2, prop3)) .graph(); @@ -307,7 +307,7 @@ void testMultipleRelationshipProperties() { PropertyMapping prop2 = PropertyMapping.of("prop2", 0D); PropertyMapping prop3 = PropertyMapping.of("prop3", 42D); - GraphStore graphs = TestGraphLoaderFactory.graphLoader(db, CYPHER) + GraphStore graphs = TestGraphLoaderFactory.graphLoader(db, FactoryType.CYPHER) .withRelationshipProperties(PropertyMappings.of(prop1, prop2, prop3), false) .withDefaultAggregation(Aggregation.DEFAULT) .graphStore(); diff --git a/core/src/test/java/org/neo4j/gds/core/loading/CypherQueryEstimatorTest.java b/legacy-cypher-projection/src/test/java/org/neo4j/gds/legacycypherprojection/CypherQueryEstimatorTest.java similarity index 98% rename from core/src/test/java/org/neo4j/gds/core/loading/CypherQueryEstimatorTest.java rename to legacy-cypher-projection/src/test/java/org/neo4j/gds/legacycypherprojection/CypherQueryEstimatorTest.java index cd6d8eb6256..32e07e54082 100644 --- a/core/src/test/java/org/neo4j/gds/core/loading/CypherQueryEstimatorTest.java +++ b/legacy-cypher-projection/src/test/java/org/neo4j/gds/legacycypherprojection/CypherQueryEstimatorTest.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.core.loading; +package org.neo4j.gds.legacycypherprojection; import org.junit.jupiter.api.Test; import org.neo4j.gds.BaseTest; diff --git a/core/src/test/java/org/neo4j/gds/config/GraphProjectFromCypherConfigTest.java b/legacy-cypher-projection/src/test/java/org/neo4j/gds/legacycypherprojection/GraphProjectFromCypherConfigTest.java similarity index 83% rename from core/src/test/java/org/neo4j/gds/config/GraphProjectFromCypherConfigTest.java rename to legacy-cypher-projection/src/test/java/org/neo4j/gds/legacycypherprojection/GraphProjectFromCypherConfigTest.java index be9b6afb687..8ba3325dfe0 100644 --- a/core/src/test/java/org/neo4j/gds/config/GraphProjectFromCypherConfigTest.java +++ b/legacy-cypher-projection/src/test/java/org/neo4j/gds/legacycypherprojection/GraphProjectFromCypherConfigTest.java @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.config; +package org.neo4j.gds.legacycypherprojection; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -35,11 +35,11 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.ALL_NODES_QUERY; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.ALL_RELATIONSHIPS_QUERY; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.NODE_QUERY_KEY; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.RELATIONSHIP_QUERY_KEY; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.fromProcedureConfig; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.ALL_NODES_QUERY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.ALL_RELATIONSHIPS_QUERY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.NODE_QUERY_KEY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.RELATIONSHIP_QUERY_KEY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.fromProcedureConfig; class GraphProjectFromCypherConfigTest { diff --git a/memory-estimation/build.gradle b/memory-estimation/build.gradle index a486a528b4d..9dfed8da364 100644 --- a/memory-estimation/build.gradle +++ b/memory-estimation/build.gradle @@ -13,6 +13,7 @@ dependencies { implementation project(':annotations') implementation project(':config-api') implementation project(':core') + implementation project(':legacy-cypher-projection') implementation project(':native-projection') implementation project(':memory-usage') implementation project(':progress-tracking') diff --git a/memory-estimation/src/main/java/org/neo4j/gds/memest/MemoryEstimationGraphConfigParser.java b/memory-estimation/src/main/java/org/neo4j/gds/memest/MemoryEstimationGraphConfigParser.java index d9687f865fb..d6b1b274503 100644 --- a/memory-estimation/src/main/java/org/neo4j/gds/memest/MemoryEstimationGraphConfigParser.java +++ b/memory-estimation/src/main/java/org/neo4j/gds/memest/MemoryEstimationGraphConfigParser.java @@ -20,15 +20,15 @@ package org.neo4j.gds.memest; import org.neo4j.gds.config.GraphProjectConfig; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; import org.neo4j.gds.core.CypherMapWrapper; +import org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig; import org.neo4j.gds.projection.GraphProjectFromStoreConfig; import org.neo4j.gds.utils.StringFormatting; import java.util.Map; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.NODE_QUERY_KEY; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.RELATIONSHIP_QUERY_KEY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.NODE_QUERY_KEY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.RELATIONSHIP_QUERY_KEY; import static org.neo4j.gds.projection.GraphProjectFromStoreConfig.NODE_PROJECTION_KEY; import static org.neo4j.gds.projection.GraphProjectFromStoreConfig.RELATIONSHIP_PROJECTION_KEY; diff --git a/proc/build.gradle b/proc/build.gradle index 0137bb5e3b8..bb0c28052ec 100644 --- a/proc/build.gradle +++ b/proc/build.gradle @@ -48,6 +48,7 @@ dependencies { testCompileOnly group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: ver.'spotbugsToolVersion' testImplementation project(':executor') + testImplementation project(':legacy-cypher-projection') testImplementation project(':open-model-catalog') testImplementation project(':proc-test') diff --git a/proc/catalog/build.gradle b/proc/catalog/build.gradle index 1f9842717c1..a4f771e4823 100644 --- a/proc/catalog/build.gradle +++ b/proc/catalog/build.gradle @@ -20,6 +20,7 @@ dependencies { implementation project(':core-utils') implementation project(':core-write') implementation project(':cypher-aggregation') + implementation project(':legacy-cypher-projection') implementation project(':csv') implementation project(':executor') implementation project(':graph-store-catalog-applications') diff --git a/proc/catalog/src/main/java/org/neo4j/gds/catalog/GraphProjectProc.java b/proc/catalog/src/main/java/org/neo4j/gds/catalog/GraphProjectProc.java index 06b17392b6f..9d83095e096 100644 --- a/proc/catalog/src/main/java/org/neo4j/gds/catalog/GraphProjectProc.java +++ b/proc/catalog/src/main/java/org/neo4j/gds/catalog/GraphProjectProc.java @@ -21,7 +21,7 @@ import org.jetbrains.annotations.Nullable; import org.neo4j.gds.core.loading.GraphFilterResult; -import org.neo4j.gds.core.loading.GraphProjectCypherResult; +import org.neo4j.gds.legacycypherprojection.GraphProjectCypherResult; import org.neo4j.gds.procedures.GraphDataScience; import org.neo4j.gds.projection.GraphProjectNativeResult; import org.neo4j.gds.results.MemoryEstimateResult; diff --git a/proc/catalog/src/test/java/org/neo4j/gds/catalog/GraphProjectProcTest.java b/proc/catalog/src/test/java/org/neo4j/gds/catalog/GraphProjectProcTest.java index fa905e48b08..ce1668527be 100644 --- a/proc/catalog/src/test/java/org/neo4j/gds/catalog/GraphProjectProcTest.java +++ b/proc/catalog/src/test/java/org/neo4j/gds/catalog/GraphProjectProcTest.java @@ -80,10 +80,10 @@ import static org.neo4j.gds.TestSupport.assertGraphEquals; import static org.neo4j.gds.TestSupport.fromGdl; import static org.neo4j.gds.TestSupport.getCypherAggregation; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.ALL_NODES_QUERY; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.ALL_RELATIONSHIPS_QUERY; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.NODE_QUERY_KEY; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.RELATIONSHIP_QUERY_KEY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.ALL_NODES_QUERY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.ALL_RELATIONSHIPS_QUERY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.NODE_QUERY_KEY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.RELATIONSHIP_QUERY_KEY; import static org.neo4j.gds.projection.GraphProjectFromStoreConfig.NODE_PROJECTION_KEY; import static org.neo4j.gds.projection.GraphProjectFromStoreConfig.RELATIONSHIP_PROJECTION_KEY; import static org.neo4j.gds.utils.StringFormatting.formatWithLocale; diff --git a/proc/src/test/java/org/neo4j/gds/catalog/FilterOnCypherGraphIntegrationTest.java b/proc/src/test/java/org/neo4j/gds/catalog/FilterOnCypherGraphIntegrationTest.java index 8e7b8628125..741dc30c41f 100644 --- a/proc/src/test/java/org/neo4j/gds/catalog/FilterOnCypherGraphIntegrationTest.java +++ b/proc/src/test/java/org/neo4j/gds/catalog/FilterOnCypherGraphIntegrationTest.java @@ -31,7 +31,7 @@ import java.util.Map; import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.ALL_RELATIONSHIPS_QUERY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.ALL_RELATIONSHIPS_QUERY; class FilterOnCypherGraphIntegrationTest extends BaseProcTest { diff --git a/procedures/facade/build.gradle b/procedures/facade/build.gradle index ba837c4f6cc..0a32bfc4596 100644 --- a/procedures/facade/build.gradle +++ b/procedures/facade/build.gradle @@ -24,6 +24,7 @@ dependencies { implementation project(':core') implementation project(':core-write') implementation project(':cypher-aggregation') + implementation project(':legacy-cypher-projection') implementation project(':defaults-and-limits-configuration') implementation project(':executor') implementation project(':graph-schema-api') diff --git a/procedures/facade/src/main/java/org/neo4j/gds/procedures/catalog/CatalogFacade.java b/procedures/facade/src/main/java/org/neo4j/gds/procedures/catalog/CatalogFacade.java index ab8fe3d07f3..e49a3a8311b 100644 --- a/procedures/facade/src/main/java/org/neo4j/gds/procedures/catalog/CatalogFacade.java +++ b/procedures/facade/src/main/java/org/neo4j/gds/procedures/catalog/CatalogFacade.java @@ -42,7 +42,6 @@ import org.neo4j.gds.core.loading.GraphDropNodePropertiesResult; import org.neo4j.gds.core.loading.GraphDropRelationshipResult; import org.neo4j.gds.core.loading.GraphFilterResult; -import org.neo4j.gds.core.loading.GraphProjectCypherResult; import org.neo4j.gds.core.utils.TerminationFlag; import org.neo4j.gds.core.utils.progress.TaskRegistryFactory; import org.neo4j.gds.core.utils.warnings.UserLogEntry; @@ -52,6 +51,7 @@ import org.neo4j.gds.core.write.NodePropertyExporterBuilder; import org.neo4j.gds.core.write.RelationshipExporterBuilder; import org.neo4j.gds.core.write.RelationshipPropertiesExporterBuilder; +import org.neo4j.gds.legacycypherprojection.GraphProjectCypherResult; import org.neo4j.gds.projection.GraphProjectNativeResult; import org.neo4j.gds.results.MemoryEstimateResult; import org.neo4j.gds.transaction.TransactionContext; diff --git a/procedures/facade/src/main/java/org/neo4j/gds/procedures/catalog/GraphInfo.java b/procedures/facade/src/main/java/org/neo4j/gds/procedures/catalog/GraphInfo.java index 146d04e8577..c076c15747e 100644 --- a/procedures/facade/src/main/java/org/neo4j/gds/procedures/catalog/GraphInfo.java +++ b/procedures/facade/src/main/java/org/neo4j/gds/procedures/catalog/GraphInfo.java @@ -22,11 +22,11 @@ import org.neo4j.gds.api.GraphStore; import org.neo4j.gds.config.GraphCatalogConfig; import org.neo4j.gds.config.GraphProjectConfig; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; import org.neo4j.gds.config.GraphProjectFromGraphConfig; import org.neo4j.gds.config.GraphSampleProcConfig; import org.neo4j.gds.config.RandomGraphGeneratorConfig; import org.neo4j.gds.core.loading.DegreeDistribution; +import org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig; import org.neo4j.gds.mem.MemoryUsage; import org.neo4j.gds.projection.GraphProjectFromCypherAggregationConfig; import org.neo4j.gds.projection.GraphProjectFromStoreConfig; @@ -142,7 +142,8 @@ private static GraphInfo create( static final class Visitor implements GraphProjectConfig.Visitor, GraphProjectFromCypherAggregationConfig.Visitor, - GraphProjectFromStoreConfig.Visitor { + GraphProjectFromStoreConfig.Visitor, + GraphProjectFromCypherConfig.Visitor { Map configuration = null; diff --git a/procedures/integration/build.gradle b/procedures/integration/build.gradle index fa589f7e204..90a82a5171b 100644 --- a/procedures/integration/build.gradle +++ b/procedures/integration/build.gradle @@ -16,6 +16,7 @@ dependencies { implementation project(':config-api') implementation project(':core') implementation project(':core-write') + implementation project(':legacy-cypher-projection') implementation project(':defaults-and-limits-configuration') implementation project(':executor') implementation project(':graph-store-catalog-applications') diff --git a/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CatalogFacadeProviderFactory.java b/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CatalogFacadeProviderFactory.java index 20b7dbcff22..cd74d63d1cf 100644 --- a/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CatalogFacadeProviderFactory.java +++ b/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CatalogFacadeProviderFactory.java @@ -44,8 +44,8 @@ import org.neo4j.gds.applications.graphstorecatalog.WriteRelationshipPropertiesApplication; import org.neo4j.gds.applications.graphstorecatalog.WriteRelationshipsApplication; import org.neo4j.gds.beta.filter.GraphStoreFilterService; -import org.neo4j.gds.core.loading.GraphProjectCypherResult; import org.neo4j.gds.core.loading.GraphStoreCatalogService; +import org.neo4j.gds.legacycypherprojection.GraphProjectCypherResult; import org.neo4j.gds.logging.Log; import org.neo4j.gds.procedures.KernelTransactionAccessor; import org.neo4j.gds.procedures.ProcedureTransactionAccessor; diff --git a/settings.gradle b/settings.gradle index a13a280bb0d..9db2e137e4b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -61,6 +61,9 @@ project(':csv').projectDir = file('io/csv') include('cypher-aggregation') project(':cypher-aggregation').projectDir = file('cypher-aggregation') +include('legacy-cypher-projection') +project(':legacy-cypher-projection').projectDir = file('legacy-cypher-projection') + include('cypher-core') project(':cypher-core').projectDir = file('cypher/cypher-core') diff --git a/test-utils/build.gradle b/test-utils/build.gradle index a0e96068f68..744a5027424 100644 --- a/test-utils/build.gradle +++ b/test-utils/build.gradle @@ -21,6 +21,7 @@ dependencies { implementation project(':config-api') implementation project(':core') implementation project(':core-utils') + implementation project(':legacy-cypher-projection') implementation project(':native-projection') implementation project(':graph-schema-api') implementation project(':memory-usage') diff --git a/test-utils/src/main/java/org/neo4j/gds/GraphLoaderBuilders.java b/test-utils/src/main/java/org/neo4j/gds/GraphLoaderBuilders.java index 136dd505b0e..57189cc29fc 100644 --- a/test-utils/src/main/java/org/neo4j/gds/GraphLoaderBuilders.java +++ b/test-utils/src/main/java/org/neo4j/gds/GraphLoaderBuilders.java @@ -26,7 +26,6 @@ import org.neo4j.gds.api.ImmutableGraphLoaderContext; import org.neo4j.gds.compat.GraphDatabaseApiProxy; import org.neo4j.gds.config.GraphProjectConfig; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; import org.neo4j.gds.core.Aggregation; import org.neo4j.gds.core.GraphLoader; import org.neo4j.gds.core.ImmutableGraphLoader; @@ -35,6 +34,7 @@ import org.neo4j.gds.core.utils.progress.EmptyTaskRegistryFactory; import org.neo4j.gds.core.utils.progress.JobId; import org.neo4j.gds.core.utils.warnings.EmptyUserLogRegistryFactory; +import org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig; import org.neo4j.gds.projection.GraphProjectFromStoreConfig; import org.neo4j.gds.transaction.TransactionContext; import org.neo4j.graphdb.GraphDatabaseService; @@ -137,7 +137,7 @@ static GraphLoader storeLoaderWithConfig( /** * Factory method that defines the generation of a {@link GraphLoader} - * using a {@link org.neo4j.gds.config.GraphProjectFromCypherConfig}. Use {@link CypherLoaderBuilder} + * using a {@link org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig}. Use {@link CypherLoaderBuilder} * to create the input for that method in a convenient way. */ @Builder.Factory diff --git a/test-utils/src/main/java/org/neo4j/gds/GraphProjectConfigBuilders.java b/test-utils/src/main/java/org/neo4j/gds/GraphProjectConfigBuilders.java index 792a6b15c32..06171d79f73 100644 --- a/test-utils/src/main/java/org/neo4j/gds/GraphProjectConfigBuilders.java +++ b/test-utils/src/main/java/org/neo4j/gds/GraphProjectConfigBuilders.java @@ -22,10 +22,10 @@ import org.immutables.builder.Builder; import org.immutables.value.Value; import org.neo4j.gds.config.ConcurrencyConfig; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; -import org.neo4j.gds.config.ImmutableGraphProjectFromCypherConfig; import org.neo4j.gds.core.Aggregation; import org.neo4j.gds.core.utils.progress.JobId; +import org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig; +import org.neo4j.gds.legacycypherprojection.ImmutableGraphProjectFromCypherConfig; import org.neo4j.gds.projection.GraphProjectFromStoreConfig; import org.neo4j.gds.projection.ImmutableGraphProjectFromStoreConfig; @@ -38,8 +38,8 @@ import static org.neo4j.gds.NodeLabel.ALL_NODES; import static org.neo4j.gds.RelationshipType.ALL_RELATIONSHIPS; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.ALL_NODES_QUERY; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.ALL_RELATIONSHIPS_QUERY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.ALL_NODES_QUERY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.ALL_RELATIONSHIPS_QUERY; @Value.Style(builderVisibility = Value.Style.BuilderVisibility.PUBLIC, depluralize = true, deepImmutablesDetection = true) public final class GraphProjectConfigBuilders { diff --git a/test-utils/src/test/java/org/neo4j/gds/GraphProjectConfigBuildersTest.java b/test-utils/src/test/java/org/neo4j/gds/GraphProjectConfigBuildersTest.java index f3622a03023..4f030c4c2b6 100644 --- a/test-utils/src/test/java/org/neo4j/gds/GraphProjectConfigBuildersTest.java +++ b/test-utils/src/test/java/org/neo4j/gds/GraphProjectConfigBuildersTest.java @@ -23,8 +23,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.neo4j.gds.api.DefaultValue; -import org.neo4j.gds.config.GraphProjectFromCypherConfig; -import org.neo4j.gds.config.ImmutableGraphProjectFromCypherConfig; +import org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig; +import org.neo4j.gds.legacycypherprojection.ImmutableGraphProjectFromCypherConfig; import org.neo4j.gds.core.Aggregation; import org.neo4j.gds.core.utils.progress.JobId; import org.neo4j.gds.projection.GraphProjectFromStoreConfig; @@ -36,8 +36,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.neo4j.gds.NodeLabel.ALL_NODES; import static org.neo4j.gds.RelationshipType.ALL_RELATIONSHIPS; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.ALL_NODES_QUERY; -import static org.neo4j.gds.config.GraphProjectFromCypherConfig.ALL_RELATIONSHIPS_QUERY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.ALL_NODES_QUERY; +import static org.neo4j.gds.legacycypherprojection.GraphProjectFromCypherConfig.ALL_RELATIONSHIPS_QUERY; class GraphProjectConfigBuildersTest {