OrientDB

OrientDB ETL Edge transformer 2 joinFieldName(s)

南笙酒味 提交于 2019-12-08 00:08:42
问题 with one joinFieldName and lookup the Edge transformer works perfect. However, now two keys is required, i.e. compound index in the lookup. How can two joinFieldNames be specified? This is the scripted(post processing) version: Create edge Expands from (select from MC where sample=1 and mkey=6) to (select from Event where sample=1 and mcl=6) . This works, but is not suitable for production. Can anyone help? 回答1: you can simply add 2 joinFieldName(s) like { "edge": { "class": "Conn",

OrientDB GraphED - SQL insert edge between two (select vertex RID)s? Or alternative approach for very large import

醉酒当歌 提交于 2019-12-07 17:42:41
问题 For example, two simple vertices in an OrientDB Graph: orientdb> CREATE DATABASE local:/databases/test admin admin local graph; Creating database [local:/databases/test] using the storage type [local]... Database created successfully. Current database is: local:/graph1/databases/test orientdb> INSERT INTO V (label,in,out) VALUES ('vertexOne',[],[]); Inserted record 'V#6:0{label:vertexOne,in:[0],out:[0]} v0' in 0.001000 sec(s). orientdb> INSERT INTO V (label,in,out) VALUES ('vertexTwo',[],[]);

OrientDB group by query using graph

你。 提交于 2019-12-07 16:58:25
I need to perform an grouped aggregate on a property of vertices of a certain class, the group by field is however a vertex two steps away from my current node and I can't make it work. My case : The vertex A contains the property I want to aggregate on and have n number of vertices with label references . The vertex I want to group on is any of those vertices (B, C or D) if that vertex has a defined by edge to vertex F . A ----references--> B --defined by--> E \---references--> C --defined by--> F \--references--> D --defined by--> G ... The query I thought would work is: select sum(property)

How do you make in Orientdb the edge to be unique

孤者浪人 提交于 2019-12-07 06:36:44
问题 How do I make a Edge unique in Orientdb. The solution that I came up with: delete the edge create it again but it's not nice. Edge is without any properties. Example: create edge is_friend from #12:0 to #12:3 and if I call it again, there should be an error like when you make a unique index. Thank you 回答1: Create a constraint on Edge out and in fields. For more information: http://www.orientechnologies.com/docs/last/orientdb.wiki/Graph-Schema.html#constraints In your case try this: CREATE

OrientDB geolocation

落花浮王杯 提交于 2019-12-07 05:59:49
问题 I´m using the OrientDB for NoSQL database, and i dont know how to query in geolocation exactly. I´ve read the specific documentation: OrientDB Functions but does not understand the significance of the values. The distance function: distance() - Computes the distance between two points in the globe using the Haversine algorithm. Coordinates must be as degrees Example: where distance(x, y,52.20472, 0.14056) <= 30 Two questions: What is the X, Y, and the 30 values? Are the values (52.20472, 0

Check if class exists or not in orientdb

社会主义新天地 提交于 2019-12-07 04:37:25
问题 How to check if a class exists or not in orient db if it is not exiting in the database i need to create it and insert a record if exists i need to insert the record . I need to do the same using JAVA 回答1: You can retrieve schema information via SQL with the following statement: select expand(classes) from metadata:schema In particular, to retrieve a single class: select from ( select expand(classes) from metadata:schema ) where name = 'YourClassName' From Java: ODatabaseDocumentTx db = ...

Showing node labels in OrientDB Studio

ぐ巨炮叔叔 提交于 2019-12-06 16:46:17
问题 I'm trying to make OrientDB Studio display a string as a label for each node, like in this screenshot from Susheel Kumar But when I run Susheel's code (posted below for posterity), the nodes all appear labelled by their @rid fields instead, like this screenshot: Question: Is there an automated way to display all these labels? I can tell an individual node to display its "name" field as a label by clicking (1) the node, (2) the "eye" symbol, (3) the settings symbol, and selecting "name" from

How to print or log on function javascript Orientdb

萝らか妹 提交于 2019-12-06 15:55:16
I trying to use print("Hello world") function Orientdb for debugging. After click on excute() there is no any result appear. The best way to do this is using OrientDB standard logger: com.orientechnologies.common.log.OLogManager.instance().info(this, "This is a log!") To see the print you have to open the 'Server.bat' or 'Server.sh' window and you'll see your result. Server.bat Server.sh 来源: https://stackoverflow.com/questions/35206122/how-to-print-or-log-on-function-javascript-orientdb

Create schema for graph database with Java in OrientDB

六眼飞鱼酱① 提交于 2019-12-06 13:36:08
问题 I'm trying to create schema for graph database in OrientDB with Java but I have two problems I can't solve. I'm using this example http://orientdb.com/docs/last/Graph-Schema.html When I use this code OServerAdmin serverAdmin = new OServerAdmin("remote:localhost").connect("root", "1234"); serverAdmin.createDatabase("mydb", "graph", "plocal"); serverAdmin.close(); I get the following error: java.lang.NoSuchMethodError: com.orientechnologies.common.concur.resource.OResourcePool.getAllResources(

Infinite recursion when serializing OrientDB RecordID

落爺英雄遲暮 提交于 2019-12-06 11:12:28
In my schema I have an abstract class like this: @JsonAutoDetect(JsonMethod.NONE) public abstract class AbstractEntity { @Id private Object id; @Version private Integer version; public AbstractEntity() {} @JsonProperty // this annotation causes infinite recursion public Object getId() { return id; } } This class is used as superclass for every entity, for example: @JsonAutoDetect(JsonMethod.NONE) public class Usuario extends AbstractEntity { private Cadastro cadastro; protected Usuario() {} public Usuario(Cadastro cadastro) { setCadastro(cadastro); } @JsonProperty public Cadastro getCadastro()