public static void main( String[] args )
{
String path = args[0];
String indexName = "myIndex";
GraphDatabaseService db = new EmbeddedGraphDatabase( path );
Index<Relationship> index = db.index().forRelationships( indexName );
Transaction tx = db.beginTx();
Node node = db.createNode();
Relationship relationship = db.getReferenceNode().createRelationshipTo( node, DynamicRelationshipType.withName( "KNOWS" ) );
index.add( relationship, "key", "value" );
tx.success();