Skip to content

Commit d20f00b

Browse files
Add hdbscan to business facade
1 parent 886da1f commit d20f00b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

algorithms-compute-business-facade/src/main/java/org/neo4j/gds/community/CommunityComputeBusinessFacade.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import org.neo4j.gds.core.loading.GraphStoreCatalogService;
3535
import org.neo4j.gds.core.loading.validation.NodePropertyAnyExistsGraphStoreValidation;
3636
import org.neo4j.gds.core.loading.validation.UndirectedOnlyGraphStoreValidation;
37+
import org.neo4j.gds.hdbscan.HDBScanParameters;
38+
import org.neo4j.gds.hdbscan.Labels;
3739
import org.neo4j.gds.result.TimedAlgorithmResult;
3840
import org.neo4j.gds.results.ResultTransformerBuilder;
3941

@@ -152,4 +154,34 @@ public <TR> CompletableFuture<TR> conductance(
152154
).thenApply(resultTransformerBuilder.build(graphResources));
153155
}
154156

157+
public <TR> CompletableFuture<TR> hdbscan(
158+
GraphName graphName,
159+
GraphParameters graphParameters,
160+
Optional<String> relationshipProperty,
161+
HDBScanParameters parameters,
162+
JobId jobId,
163+
boolean logProgress,
164+
ResultTransformerBuilder<TimedAlgorithmResult<Labels>, TR> resultTransformerBuilder
165+
) {
166+
// Fetch the Graph the algorithm will operate on
167+
var graphResources = graphStoreCatalogService.fetchGraphResources(
168+
graphName,
169+
graphParameters,
170+
relationshipProperty,
171+
new NodePropertyAnyExistsGraphStoreValidation("nodeProperty"),
172+
Optional.empty(),
173+
user,
174+
databaseId
175+
);
176+
var graph = graphResources.graph();
177+
178+
return computeFacade.hdbscan(
179+
graph,
180+
parameters,
181+
jobId,
182+
logProgress
183+
184+
).thenApply(resultTransformerBuilder.build(graphResources));
185+
}
186+
155187
}

0 commit comments

Comments
 (0)