0
votes

I'm using a Neo4j Java application with the APOC procedures: xml import and mergeNodes. The xml import is fine, but I can't tell the same for mergeNodes function.

I know how to register APOC procedure, so here the code:

private static void registerApocProcedure(GraphDatabaseService graphDB) throws IllegalArgumentException {
    //Register APOC procedures
    Procedures procedures = ((GraphDatabaseAPI) graphDB).getDependencyResolver().resolveDependency(Procedures.class);
    List<Class<?>> apocProcedures = Arrays.asList(Xml.class, Merge.class, RefactorConfig.class, RefactorResult.class, RelationshipRefactorResult.class, NodeRefactorResult.class);
    apocProcedures.forEach((proc) -> {
        try {
            procedures.registerProcedure(proc);
        } catch (KernelException e) {
            throw new RuntimeException("Error registering "+proc,e);
        }
    });
}

As you can see, I also included some APOC procedures that have similar name to apoc.refactor.mergeNodes, but nothing happens. Probably I'm typing the wrong name, becuase this APOC procedures is built-in so I'm sure it's already present in the library, also because it is documented here

So, how can I call this function?

1
To avoid somebody could lose the head doing this, the solution is: GraphRefactoring.classWall
If you have solved your own problem, and you think it is generally helpful, then you can just create an Answer (with sufficiently useful detail) and even accept your own Answer.cybersam

1 Answers

0
votes

SOLUTION: GraphRefactoring.class