gpt4 book ai didi

java - 如何识别 JanusGraph 的名称?

转载 作者:行者123 更新时间:2023-11-30 02:05:17 25 4
gpt4 key购买 nike

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

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

最佳答案

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 的文档,似乎您可以指定一个可与 ConfiguredGraphFactory 一起使用的 graphname以这种方式打开图形 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?

每当您在使用 mixed index 索引的属性上添加 has 步骤时,都会使用索引后端。我认为所有其他查询,包括配置有复合索引的属性上的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 的托管提供商。您将轻松找到可插拔存储后端的托管服务 compatible使用 JanusGraph 2.x。

关于java - 如何识别 JanusGraph 的名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51541041/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com