I just started using Titan over Cassandra. I am new to Titan and also new to Graph database concept. Just follow the instructions on github and wiki.
Configuration conf = new BaseConfiguration(); conf.setProperty("storage.backend", "cassandra"); conf.setProperty("storage.hostname", "127.0.0.1"); TitanGraph g = TitanFactory.open(conf);
This is how I opened the chart.
I understand that the default titan is titan . I created some nodes and relationships in the default key space. I did indexing on the top and requested nodes and was able to iterate the results.
Now my questions are
1) How to set a new keyspace?
I tried to use the property
conf.setProperty("storage.keyspace ", "newkeyspace");
Unfortunately, when I checked the cassandra key areas, I could only find titan . There was no key space named newkeyspace . What could be the reason?
2) How to save the schedule?
eg,
g.createKeyIndex("name", Vertex.class); Vertex juno = g.addVertex(null); juno.setProperty("name", "juno"); juno.setProperty("type", "node"); Vertex juno1 = g.addVertex(null); juno1.setProperty("name", "juno"); juno1.setProperty("type", "node1");
This is one sample graph. As soon as I issue a form request
Iterator<Vertex> junoIterator = g.getVertices("name", "juno") .iterator(); while (junoIterator.hasNext()) { Vertex vertex = (Vertex) junoIterator.next(); System.out.println(vertex.getProperty("type")); }
Expected Result
node node1
The same query should work fine as soon as I comment on the next segment -
/*g.createKeyIndex("name", Vertex.class); Vertex juno = g.addVertex(null); juno.setProperty("name", "juno"); juno.setProperty("type", "node"); Vertex juno1 = g.addVertex(null); juno1.setProperty("name", "juno"); juno1.setProperty("type", "node1");*/
Here, I believe that the nodes, relationships, and index are already created and stored in some kind of data warehouse. Am I mistaken?
I ask for advice.