【问题标题】:How to create custom classes in orientdb using Gremlin如何使用 Gremlin 在 orientdb 中创建自定义类
【发布时间】:2015-04-16 14:09:42
【问题描述】:

我想在 SQL 中使用这种语法的等价物:

create class Person extends V

在小鬼里

【问题讨论】:

  • 我不确定是否可以通过 Gremlin 操作 OrientDB 架构。 Gremlin 独立于 OrientDB,不适应模式。
  • 是的,我想这就是答案。你不知道有什么方法可以在特定的类中添加一个顶点

标签: orientdb gremlin


【解决方案1】:

我不确定是否可以通过 Gremlin 操作 OrientDB 架构。 Gremlin 独立于 OrientDB,不适应模式,因为并非所有图数据库都支持模式。

要在 OrientDB 中添加特定类的顶点,您可以使用 Graph API(请参阅doc)。如果在类名前添加字符串class:,您将创建该类的一个顶点。

graph.addVertex("class:User");

这个 sn-p 将创建类User 的顶点。希望对你有帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-18
    • 1970-01-01
    • 2018-04-11
    • 1970-01-01
    • 1970-01-01
    • 2019-11-28
    • 1970-01-01
    相关资源
    最近更新 更多