【发布时间】:2015-06-13 19:19:10
【问题描述】:
我正在根据新网站的需求文档为我们的 SQLServer 指定一个新数据库。为了学习 Titan,我认为用它来记录架构会很有趣。
我的顶点代表一个表格;边缘将是记录表之间的关系并显示满足要求所需的用户权限。最终,这可能会增加为各种网页和边缘添加顶点以显示使用了哪些表。
我的问题是:我的环境设置是否正常,因为我在尝试创建自己的架构时不断出错?还是我做错了?
我下载了 TitanDB(下载了 0.5.4),能够导入 GraphOfTheGods 并使用它。
现在我正在尝试构建自己的图表,但在尝试添加顶点时遇到了异常。
gremlin> g = TitanFactory.build();
==>com.thinkaurelius.titan.core.TitanFactory$Builder@1950e8ac
gremlin> g.set("storage.backend","cassandra");
==>com.thinkaurelius.titan.core.TitanFactory$Builder@1950e8ac
gremlin> g.set("storage.hostname", IP.ADD.RESS.HERE);
==>com.thinkaurelius.titan.core.TitanFactory$Builder@1950e8ac
gremlin> g.open();
==>titangraph[Cassandra:[IP.ADD.RESS.HERE]]
gremlin> g.addVertex()
No signature of method: com.thinkaurelius.titan.core.TitanFactory$Builder.addVertex() is applicable for arguments types: () values: []
gremlin> g.addVertex(null)
No signature of method: com.thinkaurelius.titan.core.TitanFactory$Builder.addVertex() is applicable for arguments types: (null) values: [null]
在.open(); 之后,我在存储引擎中看到了一个名为“titan”的新键空间。
所以我找到了这个(认为我需要定义类型):How to Define Data Type for Titan Graph DB Vertex?。
当我尝试这个时:
gremlin> graph.makeType().name("name").dataType(String.class).functional().makePropertyKey()
我明白了:groovysh_parse: 83: expecting anything but ''\n''; got it anyway @ line 83, column 79.
functional().makePropertyKey()
感谢有关创建自己的图形结构的教程的任何帮助或指导。
【问题讨论】:
标签: groovy schema graph-databases titan gremlin