JanusGraph / janusgraph

JanusGraph: an open-source, distributed graph database
https://janusgraph.org
Other
5.32k stars 1.17k forks source link

ConfiguredGraphFactory doesn't work normally #2203

Closed ChenZhaobin closed 4 years ago

ChenZhaobin commented 4 years ago

there are a lot issues when using ConfiguredGraphFactory. 1.when config following the wesite docs, when I create a graph using ConfiguredGraphFactory.create("testgraph"); it gives me an error" should first create a template",but when I want to create using mapping ,it always return error:"there is no config :storage.backend“, so I finnally solved it by below command:

ConfiguredGraphFactory.createTemplateConfiguration(ConfigurationUtils.cloneConfiguration(new PropertiesConfiguration("/etc/opt/janusgraph/testmap.properties")));
ConfiguredGraphFactory.create("testmap"); 

2.After I create two graph using command:

ConfiguredGraphFactory.create("testgraph1"); 
ConfiguredGraphFactory.create("testgraph2"); 

there is no traveral named testgraph1_trversal() and testgraph2_trversal() at all 3.After I create schema for testgraph1 using below command:

graph=ConfiguredGraphFactory.open("testgraph1"); 
g=graph.traversal();
mgmt = graph.openManagement() ;
mgmt.printSchema();

then the schema is used by all the graphs,meaning that when I assign graph variable to testgraph2,it can also print the same schema with testgraph1,is this normal? It will be very appreciate if guys could help me out ,thanks.

ChenZhaobin commented 4 years ago

4.And when I use below command to insert data

graph1=ConfiguredGraphFactory.open('testgraph1');
g1=graph1.traversal();
g1.addV(‘company').property('name','testname')

everything is fine when using console terminal ,it only insert one item for testgraph1 ,but when it comes to gremlin.net ,these command can insert 3 same record item for every graph( testgraph1,testgraph2,graph)

ChenZhaobin commented 4 years ago

finally,I find out that I have used the same keyspace for all the graphs, remove storage.keyspace configuration,can solve the issue 3 and 4. refer