I'm working on my first Titan Graph implementation, but ran into an issue with enforcing the schema. Here's my set up:
Configuration conf = new BaseConfiguration();
conf.setProperty("storage.backend", "cassandra");
conf.setProperty("storage.hostname", "127.0.0.1");
conf.setProperty("index.search.backend", "elasticsearch");
conf.setProperty("index.search.hostname", "127.0.0.1");
conf.setProperty("index.search.elasticsearch.client-only", "true");
conf.setProperty("schema.default", "none");
TitanGraph g = TitanFactory.open(conf);
TitanManagement mgmt = g.getManagementSystem();
VertexLabel personLabel = mgmt.makeVertexLabel("person").make();
VertexLabel locationLabel = mgmt.makeVertexLabel("location").make();
VertexLabel organizationLabel = mgmt.makeVertexLabel("organization").make();
mgmt.makeEdgeLabel("lives in").multiplicity(Multiplicity.MANY2ONE).make();
mgmt.commit();
g.shutdown();
I want to enforce that a "lives in" edge can ONLY occur from a "person" to a "location", but I can't find the logic to do it.