OrientDB

Closing a “local” OrientDB when using connection pools

非 Y 不嫁゛ 提交于 2019-12-19 03:36:09
问题 So I basically do this. OObjectDatabaseTx result = OObjectDatabasePool.global().acquire( "local:orientdb", "admin", "admin"); //dostuff result.close; The problem is that when I redeploy my webapp (without restarting the Java EE container) I get the folling error: com.orientechnologies.orient.core.exception.OStorageException: Cannot open local storage 'orientdb' with mode=rw which I interpret to mean "Tomcat still has a filelock from the last app". So my question is how do I cleanly exit in

Query in OrientDB

百般思念 提交于 2019-12-13 09:12:51
问题 I try to print a query through the java console but nothing comes out. this is my code someone could help me. I'm new to OrientDB and I'm just learning. The query I need is to know the shortest path between two nodes and print this query on the Java console. It does not give me any errors but nothing comes out. public class Graph { private static final String DB_PATH = "C:/OrientDataBase/shortest_path"; static OrientGraphNoTx DBGraph; static OrientGraphFactory factory; public static void main

Orientdb upsert using java

别等时光非礼了梦想. 提交于 2019-12-13 08:09:19
问题 i have a document in orient db like {"a":"1","b":"2","c":"3"} how can i update the value of b if c is 3 using java i need to execute the below query using java UPDATE <document name >Merge {"a":25"} where c=3 please help me 回答1: ODatabaseDocumentTx db = new ODatabaseDocumentTx(path); db.open("root","root"); db.command(new OCommandSQL("update <document name > set a=30 where c=3")).execute(); 来源: https://stackoverflow.com/questions/33328695/orientdb-upsert-using-java

Select and insert by keeping references to original data in OrientDB

寵の児 提交于 2019-12-13 06:38:14
问题 I am exploring graphDB query languages. At the moment looking at OrientDB query language. I would like to see how a transaction would look like in OrientDB with the following structure: Suppose, I have two vertices, A and QA : CREATE CLASS A EXTENDS V CREATE CLASS QA EXTENDS V Class A has a property called p1 of Integer: CREATE PROPERTY A.p1 integer Assume that A has three records called a1,a2,a3 with their corresponding values for p1 are a1.p1=2; a2.p1=5; a3.p1=10; : INSERT INTO A SET p1 = 2

Can I access Cluster/s name for objects during a query on OrientDB?

一曲冷凌霜 提交于 2019-12-13 05:55:02
问题 Maybe this could be due a poor design, so any advice will be appreciated. I got a graph database that helps me model associations of objects based on Inheritance, for example class:Element <----- class:Car So if I get a new car, I just insert it into car class Later I added the requirement, to keep a "metamodel", or a vision of all the data that stars getting into the model, while mantaining data separation for users, to achieve this, I decided that the data for each user, should go to

How to drop a remote graph using Java in OrientDB

限于喜欢 提交于 2019-12-13 04:59:53
问题 I am trying to setup a remote OrientDB Server and I am trying to enter vertices into it from local Java code. When I try the following code: private static final void dropDb() { OrientGraphNoTx graph = new OrientGraphNoTx(ORIENT_URL); graph.drop(); } I get an Exception saying: Exception in thread "main" com.orientechnologies.orient.core.exception.ODatabaseException: Cannot delete database ... Caused by: java.lang.UnsupportedOperationException: Cannot delete a database in a remote server.

How to verify if a graph obeys a power law?

[亡魂溺海] 提交于 2019-12-13 04:46:55
问题 I am using the GraphStream to generate syntethic graphs. What is the formula to verify if the graph obeys the power law? (I have only the number of nodes and edges) Thanks. 回答1: So we have a graph with an edge collection named relations . We can gather the required data using a full table scan on this edge collection using AQL in ArangoDB. We need to unify _from and _to so we can count them. We use the collect statement to evaluate the diameter for each vertex: FOR oneEdge IN relations FOR

What is the best practice to update a Vertex after is detached from DB with Tinkerpop Frames?

走远了吗. 提交于 2019-12-13 04:43:37
问题 Let's exemplify I receive a Vertex with Tinkerpop Blueprint, then I use Frames to convert it in an entity. I close the database (so from now the node is detached from the DB) and I show the node on a web page to let the user modify it. The user makes some modifications, then I shoud persist the changes. The problem is that the Instance of the database is already closed, so the entity is detached from the database: What is the best practice (considering performance and memory usage too) to

How to export/import OrientDB dumps and retain IDs

喜你入骨 提交于 2019-12-13 03:57:38
问题 When I export and re-import my OrientDB database, the IDs aren't retained (the import command seems to just assign new IDs), which makes the snapshotting kind of useless. How do I ensure that the IDs are kept consistent? 回答1: Use: -preserveClusterIDs = true https://orientdb.com/docs/last/Console-Command-Import.html 来源: https://stackoverflow.com/questions/49010303/how-to-export-import-orientdb-dumps-and-retain-ids

What is the correctly way to delete edges with orientdb OGM in django rest framework?

橙三吉。 提交于 2019-12-13 02:44:30
问题 I don't know how to create a method to delete edges in django rest framework, using orientdb OGM. I'm using pyorient==1.5.5 and OrientDB 3.0.18 version. I have two vertex Classes: ousers, ocompany. Also I have two relationships (edges) Classes: ofriends, oworksat. So for example: To make a ofriends relationship I need two ousers. And to make a oworksat relationship I need one ouser and one ocompany. Every relationship has it own cluster id. I know that I can access to these functions: (Pdb)