简体   繁体   English

如何通过cassandra在titan中添加图形

[英]How to add a graph in titan via cassandra

I am running cassandra and titan 1.0.0. 我正在运行cassandra和titan 1.0.0。 I added two table nodes and edges to cassandra. 我向cassandra添加了两个表节点和边缘。 Now I want to make a graph with these two tables and i do not know how to do this. 现在,我想用这两个表制作图形,但我不知道该怎么做。 Sorry I searched the titan's document but i could not find my answer. 抱歉,我搜索了泰坦的文件,但找不到答案。

I don't believe this is officially supported by Titan. 我不认为这是Titan的正式支持。

You can create a Titan Graph which persists into Cassandra but I don't think you can import a Titan Graph from user defined Cassandra tables. 您可以创建一个持久化到Cassandra中的Titan Graph,但我认为您不能从用户定义的Cassandra表中导入Titan Graph。

Titan uses Cassandra as a backend which means that you create the graph through Titan. Titan使用Cassandra作为后端,这意味着您可以通过Titan创建图形。 The graph just happens to be persisted in Cassandra. 该图恰好保留在Cassandra中。

A simple example of creating a Titan graph persisted into Cassandra: 创建Titan图的一个简单示例保留在Cassandra中:

graph = TitanFactory.open("cassandra:localhost");
v1 = graph.addVertex();
v2 = graph.addVertex();
v1.addEdge("edge-label", v2);
graph.commit();

More information on specifying the backend persistence layer (eg Cassandra) can be found here 可在此处找到有关指定后端持久层(例如Cassandra)的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM