有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何识别JanusGraph的名称?

我想将一个社交网络应用程序从sql移植到JanusGraph。我将使用Java构建后端,因为它在janusgraph的官方网站上有惊人的文档。我有一些初学者的问题

    JanusGraph graph = JanusGraphFactory.open("my_setup.properties");
  • 是。属性文件,访问图形的唯一标识符?还是这样 文件路径?(在sql中,我们有一个数据库名称。是否有类似于图形名称的名称?)
  • 如果我有相同的属性文件副本 并将其重命名为my_setup_2。属性,它会访问吗 同一个图形还是将创建一个新图形
  • 有什么方法可以确定这些顶点属于这个图吗 从我的存储后端还是搜索后端
  • 对于使用哪种类型的查询存储后端,以及对于哪种类型的查询 是否使用查询搜索后端
  • 是否有任何方法可以转储我的数据库?(用于从一个 服务器到另一个服务器(就像sql转储一样)
  • 我只找到了Janusgraph 0.1.1的托管服务提供商 (已经过时。最新版本是支持最新elasticsearch的0.2.1)如果我使用janusgraph 0.1.1版本进行生产,如果我使用elasticsearch作为搜索后端,它会对我造成多大影响

共 (1) 个答案

  1. # 1 楼答案

    Is .properties file, the only identifier to access a graph? or is it the file path? (In sql we have a name for database. Is there anything like a graph name?)

    JanusGraph有一个可插拔的存储和索引后端。.properties文件只告诉JanusGraph要使用哪个后端以及如何配置它们。不同的图形实例只会指向不同的存储文件夹、索引等。通过查看config file的文档,似乎可以指定一个graphname,它可以与ConfiguredGraphFactory一起使用,以这种方式打开图形ConfiguredGraphFactory.open("graphName")

    If I have the copy of properties file with same preferences and rename it to my_setup_2.properties, will it access the same graph or it'll create a new graph?

    是的,它将访问相同的数据,从而访问相同的图形

    Is there any way I can identify these vertices belongs to this graph from my storage backend or search backend?

    我不知道每个存储后端的具体情况,但在Elasticsearch中,JanusGraph创建的索引都以janusgraph作为前缀。我认为其他后端也有类似的机制

    For what kind of queries storage backend is used and for what kind of queries search backend is used?

    每当在使用^{}索引的属性上添加has步骤时,都会使用索引后端。我认为所有其他查询,包括对配置了composite index的属性执行has步骤,都将使用存储后端。对于OLAP工作负载,您甚至可以在存储后端插入Spark或Giraph来完成繁重的工作

    Is there anyway to dump my database? (for porting the graph from one server to another just like sql dump)

    图形可以导出和导入为GraphML等图形文件格式。它允许您与其他图形工具(例如Gephi)交互。但是,您将无法从sql数据库中转储sql并直接将其导入JanusGraph。如果您一次考虑加载大量节点和边,请查阅有关bulk loading的文档。

    I have only found hosting service providers for Janusgraph 0.1.1 (which is outdated. Latest one is 0.2.1 which supports latest elasticsearch) If I go to production with janusgraph 0.1.1 version how bad will it affect me if I use elasticsearch for search backend?

    我不知道JanusGraph 2有没有主机提供商。x、 使用JanusGraph 2,您将很容易找到可插拔存储后端compatible的托管服务。x