设置 Titan 的未解决参考

Unresolved references setting up Titan

我想使用 Cassandra 和 Java 设置 Titan。

我使用以下方法将库导入到我的项目中:

compile group: 'com.thinkaurelius.titan', name: 'titan-cassandra', version: '1.0.0'

并且我从以下位置复制了源示例:

https://github.com/thinkaurelius/titan/blob/master/titan-core/src/main/java/com/thinkaurelius/titan/example/GraphOfTheGodsFactory.java

但以下情况不起作用:

import com.thinkaurelius.titan.core.TitanKey;
import com.thinkaurelius.titan.core.attribute.Geoshape;
import static com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.INDEX_BACKEND_KEY;
import static com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.STORAGE_DIRECTORY_KEY;

不存在

以及以下抛出错误,因为他无法解析引用:

Configuration storage = config.subset(GraphDatabaseConfiguration.STORAGE_NAME_SPACE);
    storage.setProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, "local");
    storage.setProperty(GraphDatabaseConfiguration.STORAGE_DIRECTORY_KEY, directory);

  Configuration index = storage.subset(GraphDatabaseConfiguration.INDEX_NAMESPACE).subset(INDEX_NAME);
    index.setProperty(INDEX_BACKEND_KEY, "elasticsearch");


  index.setProperty(STORAGE_DIRECTORY_KEY, directory + File.separator + "es");

您的 GraphOfTheGodsFactory.java 版本不匹配。您应该参考标签 1.0.0 而不是 master.

https://github.com/thinkaurelius/titan/blob/1.0.0/titan-core/src/main/java/com/thinkaurelius/titan/example/GraphOfTheGodsFactory.java