How to create custom classes in orientdb using Gremlin

有些话、适合烂在心里 提交于 2019-12-10 16:13:39

问题


I want the equivalant of this syntax in SQL:

create class Person extends V

in Gremlin


回答1:


I'm not sure it is possible to manipulate OrientDB schema through Gremlin. Gremlin is independent on OrientDB and is not adapted on schemas because not all of graph databases support schemas.

For adding vertex of particular class in OrientDB you can use Graph API (see doc). If you prepend string class: before the name of the class, you will create a vertex of this class.

graph.addVertex("class:User");

This snippet will create vertex of class User. I hope it will help you.



来源:https://stackoverflow.com/questions/29677280/how-to-create-custom-classes-in-orientdb-using-gremlin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!