在OrientDB Studio中显示节点标签

在OrientDB Studio中显示节点标签,orientdb,Orientdb,我试图让OrientDB Studio为每个节点显示一个字符串作为标签,就像Susheel Kumar的屏幕截图一样 但当我为后代运行Susheel下面发布的代码时,所有节点都显示为以@rid字段标记,如下图所示: 问题:是否有一种自动方式显示所有这些标签 通过单击1节点、2眼睛符号、3设置符号并从下拉菜单中选择名称,我可以告诉单个节点将其名称字段显示为标签,但当我有大量节点时,这是不可能做到的。这似乎是定义Person节点类时要做的事情,但我在下面发布的Susheel代码中没有看到这方面的

我试图让OrientDB Studio为每个节点显示一个字符串作为标签,就像Susheel Kumar的屏幕截图一样

但当我为后代运行Susheel下面发布的代码时,所有节点都显示为以@rid字段标记,如下图所示:

问题:是否有一种自动方式显示所有这些标签

通过单击1节点、2眼睛符号、3设置符号并从下拉菜单中选择名称,我可以告诉单个节点将其名称字段显示为标签,但当我有大量节点时,这是不可能做到的。这似乎是定义Person节点类时要做的事情,但我在下面发布的Susheel代码中没有看到这方面的迹象,我一直未能联系到他

对于我的应用程序来说,如果我不能可视化节点标签,那么可视化基本上是无用的,因此非常感谢您的帮助:

下面是我从Susheel对OrientDB的介绍中获取的代码,用于生成上面的屏幕截图:

-- Create a class Person and add two properties lastName & firstName using below commands create class Person extends V; create property Person.lastName string; create property Person.firstName string; -- Create a class Employee which extends from Person & add few properties to it create class Employee extends Person; create property Employee.empno integer; create property Employee.sal integer; -- Create a class Department extends from V create class Department extends V; create property Department.deptno integer; create property Department.name string; -- If you noticed we used Inheritance above when creating Employee class by extending it from Person. That's a cool feature!!! Now we have classes to represent vertex (a document) & let's create a class to represent Edge to establish the relationship. create class WorksAt extends E; -- So now we are all set to add/create data to graph model we create above. -- Let's create some employees (vertex or document) create vertex Employee set empno=101,firstName='John',lastName='Jacob',sal=5000; create vertex Employee set empno=102,firstName='Adam',lastName='Bill',sal=7000; create vertex Employee set empno=103,firstName='David',lastName='Manon',sal=4000; -- Similarly lets create some departments create vertex Department set deptno=10,name='Accounts'; create vertex Department set deptno=20,name='HR'; create vertex Department set deptno=20,name='IT'; -- Now time to establish relationship. Create some Edges create Edge WorksAt from #12:0 to #13:1; create Edge WorksAt from #12:1 to #13:0; create Edge WorksAt from #12:2 to #13:2; -- Show all employees select * from Employee;
对于每个类,这是一个易于更改的首选项设置。通过在“浏览”选项卡中发出以下查询,可以显示当前显示设置:

select * from _studio
如果没有记录,只需按照您在单击节点之前描述的步骤,单击眼睛符号,然后更改显示属性。完成后,只需单击保存配置


现在,前面的查询应该显示一个可以编辑的GraphConfig类型的JSON对象。您可以更改许多参数,例如节点宽度、颜色、图标、半径和显示,这是您要查找的选项。

您可以通过运行@cheseaux从\u studio提供的select*查询来验证配置是否已保存 另外,确保在更改标签时在“顶点”视图中以及在OrientDB studio的主图形视图中单击“保存配置”

例如,当我在更改标签display:hash后在我的db上运行它时,我得到的结果如下:

{"width":1770,"height":500,"classes":{"psswd":{"fill":"#d62728","stroke":"#951b1c","icon":null,"display":"hash"}},"node":{"r":30},"linkDistance":140,"charge":-1000,"friction":0.9,"gravity":0.1} 

我很想知道是否有答案,因为前几天我也尝试过这样做。我认为像select label from Employee这样的查询可能会工作,因为它只返回1个属性,但它也一直显示RID。我确实发现,更改您在问题中提到的节点的显示实际上会更改所有该类型节点的显示。因此,在您的图片中,如果您将1个员工更改为红色,则其他2个员工也将更改,同样,3个部门也将更改为粉红色。要显示的属性以及颜色适用于每个类。因此,如果更改Person类型的节点,则所有Person节点都将具有该配置。