@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public Object call(final OrientBaseGraph g)
{
OrientVertexType v = g.getVertexBaseType();
if(!v.existsProperty(NODE_ID)) {
v.createProperty(NODE_ID, OType.INTEGER);
g.createKeyIndex(NODE_ID, Vertex.class, new Parameter("type", "UNIQUE_HASH_INDEX"), new Parameter(
"keytype", "INTEGER"));
v.createEdgeProperty(Direction.OUT, SIMILAR, OType.LINKBAG);
v.createEdgeProperty(Direction.IN, SIMILAR, OType.LINKBAG);
OrientEdgeType similar = g.createEdgeType(SIMILAR);
similar.createProperty("out", OType.LINK, v);
similar.createProperty("in", OType.LINK, v);
g.createKeyIndex(COMMUNITY, Vertex.class, new Parameter("type", "NOTUNIQUE_HASH_INDEX"),
new Parameter("keytype", "INTEGER"));
g.createKeyIndex(NODE_COMMUNITY, Vertex.class, new Parameter("type", "NOTUNIQUE_HASH_INDEX"),
new Parameter("keytype", "INTEGER"));
}
return null;
}
});