私は、最新のspring 1.5リリース、spring-data-neo4j 4.2、ogmドライバを使用してNeo4jをセットアップしました。正常に動作Apocプロシージャを実行するためのNeo4j組み込みの設定方法は?
@Bean
public org.neo4j.ogm.config.Configuration neo4jConfiguration() {
org.neo4j.ogm.config.Configuration configuration = new org.neo4j.ogm.config.Configuration();
configuration.driverConfiguration().setDriverClassName("org.neo4j.ogm.drivers.embedded.driver.EmbeddedDriver");
// don't set the URI for embedded so we get an impermanent database
return configuration;
}
@Bean
public SessionFactory getSessionFactory() {
return new SessionFactory(
neo4jConfiguration(),
"xxx.yyy.springboot.neo4j.domain");
}
@Bean
public Neo4jTransactionManager transactionManager() {
return new Neo4jTransactionManager(getSessionFactory());
}
手順に内蔵実行しようと:
/**
* Test we can call out to standard built-in procedures using cypher
*/
@Test
public void testNeo4jProcedureCalls() {
Session session = sessionFactory.openSession();
Result result = session.query("CALL dbms.procedures()", ImmutableMap.of());
assertThat(result).isNotNull();
List<Map<String, Object>> dataList = StreamSupport.stream(result.spliterator(), false)
.collect(Collectors.toList());
assertThat(dataList).isNotNull();
assertThat(dataList.size()).isGreaterThan(0);
}
構成はURIなし組み込みドライバを使用している(したがって一時的データベースストア)ここ
は、ばね@Configuration豆コンテンツであります今度は、クラスパスに追加したapocプロシージャをインストールして実行したいと考えています。
/**
* Test we can call out to https://neo4j-contrib.github.io/neo4j-apoc-procedures
*/
@Test
public void testNeo4jApocProcedureCalls() {
Session session = sessionFactory.openSession();
Result result = session.query("CALL apoc.help(\"apoc\")", ImmutableMap.of());
assertThat(result).isNotNull();
List<Map<String, Object>> dataList = StreamSupport.stream(result.spliterator(), false)
.collect(Collectors.toList());
assertThat(dataList).isNotNull();
assertThat(dataList.size()).isGreaterThan(0);
}
しかし、上記のエラーで失敗しますDescription: There is no procedure with the name 'apoc.help' registered for this database instance
埋め込みモードで実行するためのapocプロシージャの登録に関するドキュメントは見つかりませんでした。 OGMのドキュメントにプロシージャを登録するための参照が見つかりませんでした。任意のヒントやスニペットをいただければ幸いです。