Neo4j Java API を使用して、次の簡単な例を試しています。
public void createDB(String datasetRoot) {
GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase("data/Neo4jTest1");
registerShutdownHook(graphDb);
Transaction tx = graphDb.beginTx();
try {
// Database operations go here
Node firstNode = graphDb.createNode();
firstNode.setProperty("nodeId", "1");
Node secondNode = graphDb.createNode();
secondNode.setProperty("nodeId", "2");
Relationship relationship = firstNode.createRelationshipTo(secondNode, RelTypes.SIMILAR);
tx.success();
}
finally {
tx.finish();
}
作成されたすべてのノードを印刷しようとすると、プロパティのない Node[0] が生成されていることに気付きます。なぜこうなった?