match( node( "john" ).out( "friend" ).node().out( "friend" ).node( "fof" ) ).
returns( as( identifier( "john" ).property( "name" ), "name" ), as( identifier( "fof" ).property(
"name" ), "friend" ), identifier( "john" ), as( count(), "count" ) )
.toString();
try (Transaction tx = graphdb.beginTx()) {
String json = serializer.toJSON( engine.execute( query ) ).toString();
System.out.println( json );
tx.success();
}
}