如何从 iOS App 查询 Titan Graph Database
How to query Titan Graph Database from iOS App
如果我使用 Titan 插件设置一个带有 AWS DynamoDB 后端的图形数据库,我该如何实际向数据库发送查询和 return 值?从这个 Diagram that I found here 看来,TinkerPop API 似乎可以用来发送这些查询。但是我在 iOS 设备上找不到任何关于 运行 TinkerPop 的信息。那么如何从应用程序与数据库交互?
谢谢。
TinkerPop 和 Titan 是 Java 库,因此如果您正在编写 IOS 应用程序,您应该通过 TinkerPop Gremlin 服务器。如TinkerPop documentation、
中所述
[Gremlin Server] Provides a method for Non-JVM languages (e.g. Python, Javascript, etc.) to communicate with the TinkerPop stack.... By default, communication with Gremlin Server occurs over WebSockets and exposes a custom sub-protocol for interacting with the server.
在您的 IOS 应用中,您可以使用 WebSockets 客户端库连接到 Gremlin 服务器,例如 SocketRocket (Objective-C) or Starscream (Swift). Then you would need to send a RequestMessage
to the Gremlin Server following the format described in the TinkerPop documentation. An initial approach to create a Gremlin Driver in Swift has been attempted (gist)。
尽管 WebSockets 是默认的连接协议,您可以选择 configure HTTP on the Gremlin Server instead, then make HTTP requests 到服务器。
如果我使用 Titan 插件设置一个带有 AWS DynamoDB 后端的图形数据库,我该如何实际向数据库发送查询和 return 值?从这个 Diagram that I found here 看来,TinkerPop API 似乎可以用来发送这些查询。但是我在 iOS 设备上找不到任何关于 运行 TinkerPop 的信息。那么如何从应用程序与数据库交互?
谢谢。
TinkerPop 和 Titan 是 Java 库,因此如果您正在编写 IOS 应用程序,您应该通过 TinkerPop Gremlin 服务器。如TinkerPop documentation、
中所述[Gremlin Server] Provides a method for Non-JVM languages (e.g. Python, Javascript, etc.) to communicate with the TinkerPop stack.... By default, communication with Gremlin Server occurs over WebSockets and exposes a custom sub-protocol for interacting with the server.
在您的 IOS 应用中,您可以使用 WebSockets 客户端库连接到 Gremlin 服务器,例如 SocketRocket (Objective-C) or Starscream (Swift). Then you would need to send a RequestMessage
to the Gremlin Server following the format described in the TinkerPop documentation. An initial approach to create a Gremlin Driver in Swift has been attempted (gist)。
尽管 WebSockets 是默认的连接协议,您可以选择 configure HTTP on the Gremlin Server instead, then make HTTP requests 到服务器。