OrientDB

Orientdb as a document-graph database

会有一股神秘感。 提交于 2019-12-06 10:30:49
I am using Neo4j and trying to find out the advantages of Orient as document-graph db over Neo4j. How does it work in Orientdb to have features of a document database in a graphbdb? is the database in both mode (graph and document) using the same datasource? if so, then is it possible to edit data in documentdb and show it as a graphdb? I worked with Orientdb and it seems that you can have your database either as graphdb or as documentdb, so I don't get the point of having both databases features in one db. I mean you can choose to have a pure documentdb or pure graphdb, but can't be some

How do I create an auto-incrementing index/a sequence for an OrientDB database using the Java Document API?

牧云@^-^@ 提交于 2019-12-06 10:04:44
I am using OrientDB with Java via its Document API. I have a simple Class called items which has an attribute ID . I explicitly declare the schema like this: OSchema schema = db.getMetadata().getSchema(); OClass itemsClass = schema.createClass("items"); itemsClass.createProperty("ID", OType.LONG); and then create an index on ID : CREATE INDEX items.ID ON items (ID) UNIQUE . Now when I create a new item (something like ODocument doc = new ODocument("items") etc.), I would like the ID for the new item to be generated on the database (something like a sequence in RDBMS). How do I do this with the

Insert records into embedded field of OrientDB class from select

时间秒杀一切 提交于 2019-12-06 08:54:22
问题 I am evaluating OrientDB database. I have two document classes imported from a relational database. class Order with properties (ID: integer, OrderItems: EmbeddedList of OrderItem) and class OrderItem with properties (ID: integer, OrderID: integer, PropA: string) Both classes are filled with data from the database (except field Order.OrderItems). Now I would like to insert data from class OrderItem into class Order based on OrderID. I have tried SQL like update Order set OrderItems = (select

How to extract the result of a query from JSON inside a custom javascript function in OrientDB

强颜欢笑 提交于 2019-12-06 06:48:12
I created a custom javascript function in the OrientDB Studio. The function takes a rid as an argument and performs a select query from that rid. var graph = orient.getGraph(); var res = graph.command( "sql", "select outE('Rel').inV('B').size() as lower_num from " + rid ); So, the result of this query is a number. Depending on the value of this number the function should do different things. I wonder how to extract and use that value from the res variable inside the function. All my attempts have failed so far.. If I return the res variable from the function, the result looks like this: [ { "

Edge properties clobbering vertex properties in OrientDB from ETL

狂风中的少年 提交于 2019-12-06 06:38:11
This is a follow-up to another question I had posted regarding importing a simple database into OrientDB using ETL that had both edge and vertex properties with dates on both. Here's my data: vertices.csv : label,data,date v01,0.1234,2015-01-01 v02,0.5678,2015-01-02 v03,0.9012,2015-01-03 edges.csv : u,v,weight,date v01,v02,12.4,2015-06-17 v02,v03,17.9,2015-09-14 For brevity, I'll add just the updated commonEdges.json file using the edits from the other question. The other JSON files are unchanged. commonEdges.json : { "begin": [ { "let": { "name": "$filePath", "expression": "$fileDirectory

OrientDB ETL Edge transformer 2 joinFieldName(s)

…衆ロ難τιáo~ 提交于 2019-12-06 05:25:18
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? you can simply add 2 joinFieldName(s) like { "edge": { "class": "Conn", "joinFieldName": "b1", "lookup": "A.a1", "joinFieldName": "b2", "lookup": "A.a2", "direction": "out" }} see below my

OrientDB Gremlin - Retrieve Vertex for a class in gremlin not hitting indexes

十年热恋 提交于 2019-12-06 05:08:25
I'm using OrientDB 2.1.11 and rexster 2.6 and gremlin is the main query language. I use via rexpro (and rexster REST). My issue is: how to get the indexes to hit from gremlin (I must use gremlin not orient sql). I have a vertex class zipcode, which has 1 property zip_code defined in schema and indexed as dictionary: zipcode.zip_code DICTIONARY ["zip_code"] SBTREE But when I query it using gremlin, its slow when records are around >25k (haven't tested with lower numbers). To give proper context, I try to find the zipcode first, if it doesn't exist then I create the vertex for later use. Find

Create Edges in OrientDB

吃可爱长大的小学妹 提交于 2019-12-06 04:20:38
I have an Orient database with vertices for servers from different management tools. As a server can be monitored by multiple management tools, I would like to create edges between the vertices for the same server. The connected components would then be the individual servers. The problem I have, is that different systems will have different naming conventions - some use fully qualified domain names, some use internal domain names, and some only use the hostname. My Sample Data: orientdb {db=audit}> select * from V +----+------+-------+----------+----------------------+----------------+ |# |

Building Web App Using OrientDB JavaScript API

纵然是瞬间 提交于 2019-12-06 04:15:41
I'm having a bit of difficulty in figuring out how to get the OrientDB JavaScript API to work in a web app. I tried searching into the source code of the OrientDB Studio web app and was able to notice that they use the orientdb JavaScript API along with some AngularJS, which looks very fascinating, but then I tried on my side by creating a simple web page that imported the orientdb-api.js and the jquery library, and it did not work. Here is the content of my web page: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1

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

杀马特。学长 韩版系。学妹 提交于 2019-12-06 01:37:34
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',[],[]); Inserted record 'V#6:1{label:vertexTwo,in:[0],out:[0]} v0' in 0.000000 sec(s). Is there a way to