【问题标题】:Unresolved references setting up Titan未解决的参考设置 Titan
【发布时间】:2016-10-12 12:06:18
【问题描述】:

我想使用 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");

【问题讨论】:

    标签: java gradle titan


    【解决方案1】:

    您的 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

    【讨论】:

    • 另外,master 分支已经过时了。 GitHub上的默认分支其实是titan10,最新开发在titan11分支上。
    • 我应该使用 gradle 检查哪个版本? Titan10 已经稳定了吗?
    • 您的 gradle 导入看起来不错。 titan101.0.0 之外有一些变化。如果您使用的是titan-1.0.0.zip,我建议保留1.0.0 标签,因为那是匹配的源代码。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-05
    • 1970-01-01
    • 2021-08-17
    • 2016-12-14
    • 2020-05-27
    • 2019-11-16
    相关资源
    最近更新 更多