FAQ Database Discussion Community


Model with multiple Edges using Sails.js and OrientDB

node.js,sails.js,graph-databases,orient-db,waterline
I am new to Sails.js and OrientDB. I am trying to figure out how to create a model that has multiple edges using the sails-orientDB adapter. I have a vehicle model that stores basic vehicle information and a vehicle color: module.exports = { schema: true, tableName: 'Vehicle', attributes: { id:...

How to run a SQL Script that builds my DB and schema in OrientDB?

orient-db
I'm using OrientDB 2.0.2. I'm writing a SQL script that will create a new DB, construct the schema, and then populate the DB with static initial data. I know that the database will be automatically created if I simply start loading data, and that classes will automatically be created if...

OrientDB - Result from 2 different tables

sql,database,select,orient-db
I have a database that has 2 V's classes ('User' that has 2 strings named Name and Surname ,'Cinema') and 2 E's classes ('isGoing' that has an Integer property named Day, 'Friend'). This select returns all the 'Cinema' that the 'Friend' of the initial Vertex are going on a specific...

Best NoSQL for filtering on multiple indexes/fields

mongodb,elasticsearch,nosql,orient-db,aerospike
Because of the size of the data that needs to be queried and ability to scale as needed on multiple nodes, I am considering using some type of NoSQL db. I have been researching numerous NoSQL offerings but can't yet decide on what would be the best option which would...

How to import mongo dump file into OrientDB?

mongodb,orient-db
I have MongoDB dump file in .bson extension. That i want to import in OrientDB. Should any one know that. Any other way to import DB in OrientDB from MongoDB.

Cannot establish a connection to orientdb using jdbc driver?

netbeans,jdbc,nosql,orient-db
I'm newbie to the orientdb, I'm using netbeans's (add new connection wizard) to add a connection to the orientdb, I used orientdb-jdbc-2.0.2-all.jar as a jdbc driver, but I got the following error after clicking on test connection Snapshot of the error I made sure that the database is connected and...

NoSQL statistics type query with BaasBox - OrientDB 1.7.10

nosql,orient-db,baasbox
I'm trying out BaasBox v0.9.2 which ships with OrientDB 1.7.10 for a proof of concept web app I want to build. Premise is fairly simple and adding/querying is very straight forward and simple for single collections. What I'm having difficulty trying to visualize is how to get statistics type information...

OrientDB — is there a way to find out which edge was traversed?

orient-db
I've been researching/looking around high and low for this, but, could not find any leads. I'm thinking this is a limitation, but, I would like to be sure. Scenario (1): In this scenario, I've explicitly informed which edge I'd like to traverse through. Thus, I know who is attending the...

which data type in orient db for @rid?

java,spring,orient-db
i tried to fetch all data from orientdb using java. my code is public static ArrayList<dbentity.DoctorEntity> viewAllDoctor(){ graph = factory.getTx(); ArrayList<dbentity.DoctorEntity> al=new ArrayList<dbentity.DoctorEntity>(); for (Vertex v : graph.getVerticesOfClass("DoctorA")) { System.out.println(v.getProperty("@rid")); dbentity.DoctorEntity disent=new DoctorEntity(v.getProperty("@rid"), v.getProperty("NAME"),v.getProperty("specialization")); al.add(disent); } graph.shutdown(); return al; } i want add @rid to...

list OrientDb databases using HTTP protocol and golang

go,orient-db
I am trying to get a list of OrientDb databases using HTTP protocol. But I cannot get expected response, which I can get in a browser. If I input in a browser address line http://localhost:2480/listDatabases then I have response: {"@type":"d","@version":0,"databases":["MaximDB","GratefulDeadConcerts"],"@fieldTypes":"databases=e"} How can I get the same using golang? My code:...

$parent and $ current in orientDB query

orient-db
I read it on orientDB documentation but can't get a hold of it. It would be great if someone could explain the use of $parent and $current in detail. In a few examples I tried $parent.$parent.$current and $parent.$current, both give the same results which I feel should not happen. Below...

Querying OrientDB for latitude-longitude pairs in a circle of a given radius and center

orient-db
I have collection of nodes of latitude-longitude pairs. How do I query OrientDB to find all the nodes (latitude-longitude pairs) in a circle of given radius with center in given coordinates? ...

Select query to get fields within JSON in orientdb

json,database,select,orient-db
In what way can I get fields within a JSON that is stored as a OrientDB Class field? For example, I have a class FILE having a field named 'data'. orientdb {db=baasbox}> select data from FILE ----+---------------------- # | data ----+---------------------- 0 | {"email":"[email protected]"} ----+---------------------- The field 'data' is a...

Waterline-OrientDB - Bi-Directional Edge

node.js,sails.js,orient-db,waterline,sails-orientdb
I have two models declared in Sails and I'm using the Waterline-Orientdb adapter and don't know how to connect them via a bi-directional edge Questions Model var Waterline = require('waterline'); module.exports = Waterline.Collection.extend({ tableName: 'questionsTable', identity: 'questions', connection: 'associations', attributes: { id: { type: 'string', primaryKey: true, columnName: '@rid'}, question...

Check class creation in OrientDB

python,python-2.7,orient-db
I'm trying to create classes with pyorient driver but sometime if class exists I got class exists message. Is there a way to check whether class is exists or not in OrientDB python driver? Here is part of my sample code for class creation... @classmethod def create(cls): cls._cluster_id = OrientEngine.client.command("CREATE...

Orient-db working with Dates

orient-db
I'm trying to query record filtering on the date (documentation for date) select * from InstallationFee where infinite OR (date() >= dateFrom and date() <= dateTo) The query returns the following error in the studio: java.lang.ClassCastException: com.orientechnologies.orient.core.sql.filter.OSQLFilterItemField cannot be cast to com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition Here is the stack trace in the JAVA...

OrientDB average over collection

sql,aggregate,average,orient-db
Im trying orientdb with some simple apps. In this app I have People (persona) and places to eat (sitio), people go to those places (I store how many times they do) and score them. Using this query: SELECT *, inE('puntua').comida as comida, inE('puntua').servicio as servicio, inE('puntua').extras as extras from Sitio...

Refining a query by Edge metadata

sql,database,graph,orient-db,edge
I currently have two Vertex classes, VersionSet and Version, with one non-lightweight Edge class, VersionSetToVersion. The VersionSetToVersion edge class also has a property called status which can have the value 'latest'. If I have some @rid of a VersionSet vertex (i.e. #14:1), how would I construct an orient-db style SQL...

Different results for select and traverse?

orient-db
I'm experimenting with OrientDb with the sample vehicle history database and have executed these two SQL queries, which I (would have thought) would be identical. I am trying to find all of the females who sold a vehicle to a male. SELECT expand(out('Bought').in('Sold')[gender="Female"]) FROM Person WHERE gender = "Male" LIMIT...

How to apply Distinct Query in OrientDB?

orient-db,oriento
I want use Distinct Query in OrientDb. Any one have idea about that how to apply that but i want Distinct Query Builder. Oriento Query I know that : SELECT DISTINCT(name) FROM City but I want something like that Query Builder : db.select().distinct(name).from(City) //Right Select Query Builder db.select().from('City').where({status: 'true'}).all() AND...

How can I get the latest 10 posts those are written by people in my network (2 level) with gremlin query?

graph,orient-db,gremlin
I have friends, my friends have friends also. How can I get the latest 10 posts those are written by people in my network (2 level) with gremlin query?

Representation of python dictionaries with unicode in database queries

python,unicode,orient-db
I have a problem that I would like to know how to efficiently tackle. I have data that is JSON-formatted (used with dumps / loads) and contains unicode. This is part of a protocol implemented with JSON to send messages. So messages will be sent as strings and then loaded...

How to connect orientdb database using java?

java,database,orient-db
I tried to connect using orientdb database with java. like this OrientGraph odb = new OrientGraph("plocal:C:/Users/USER/Desktop/orientdb/databases/testJ", "admin", "admin"); Its showing an error HTTP Status 500 - Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/orientechnologies/orient/core/db/record/ODatabaseRecord My dependencies.. <dependency> <groupId>com.orientechnologies</groupId> <artifactId>orientdb-core</artifactId> <version>2.0.8</version>...

In a OrientDB query, how can the where clause reference a column in the select

orient-db
I want to write a query in OrientDB performs WHERE filtering on some columns/fields on the SELECTed vertex. Here is the equivalent query implemented with nested SELECT's- SELECT FROM (SELECT EXPAND(OUT('Foo')) FROM #13:1 ) WHERE prop = 'bar' How I can write this query with a single SELECT?...

Create a vertex with Label in Gremlin

orient-db,gremlin
This seems like a must have feature for graph query language, but I cannot find a command that let me create a vertex with label, nor add a label after a vertex has been created. I tried the solution here, but it does not work because the property T.label is...

How to group all sibling nodes from different parents by common sibling in a graph using Gremlin/OrientDB

graph,graph-databases,orient-db,gremlin
It is difficult for me to describe. The Gremlin query I am trying to write has one node as an input. Then I am searching all the nodes with class Group of input. Then in each group there is only one Text class node and a number of Elem nodes....

OrientDB import CSV is modifying my property name

csv,properties,import,character,orient-db
I'm no expert in OrientDB, and I'm having a problem with an odd character showing up in the command line. Oddly enough, it's in the name of my property. Because the name of the property is different, my queries are breaking. For example, I can't execute SELECT * FROM Class...

OrientDB - Edge Property in Expand

database,select,orient-db,edge
I have 2 'V' classes in my database that are: "User" and "Cinema" and 2 'E' classes that are: "Friend" and "isGoing". My "Friend" edge is lightweight and is working fine, but whenever I try to select anything using the property inside "isGoing" (Datetime date), the select returns empty. Examples:...

Import from RDBMS DB2 To Document DB OrientDB

import,orient-db
In my database CU242176 DBMS OrientDB version 2.0.7 is a table M_PERM: PERM_DESC:string; PERM_ID:integer not null; PERM_NAME:string. In my database CU242176 DBMS DB2 version 9.1 is a table M_PERM of the same structure. In this table 14 rows. With module Orientdb-ETL I did import the data. No errors, but there...

OrientDB: How to update column using select query

sql,orient-db
I need to update a column in table using following: update Table1 set name = (select productName from Table2 where @rid=$parent.$current.productid) Query works fine but instead of name query stores value in "[productname]" format. I have read orientdb documentation, I guess select query returns result in collection format. so I...

Saving to new cluster returns error

orient-db
I'm creating cluster dynamically in xtend/Java for (int i : 0 ..< DistributorClusters.length) { val clusterName = classnames.get(i) + clusterSuffix; database.command( new OCommandSQL('''ALTER CLASS «classnames.get(i)» ADDCLUSTER «clusterName»''')).execute(); } Then I create I add the oRole and Grant the security to the new oRole val queryOroleCreation = '''INSERT INTO orole SET...

Lucene acting up on OrientDB when confronted with fuzzy queries

indexing,lucene,orient-db,fuzzy-search
I have indexed a property on OrientDB using Lucene's keyword analyzer: CREATE INDEX Snippet.ssdeep ON Snippet (ssdeep) FULLTEXT ENGINE LUCENE METADATA {"analyzer":"org.apache.lucene.analysis.core.KeywordAnalyzer"} The filed contains simhashes that I have indexed for test. Now when I search using Lucene, I get a response for the exact queries, but not for the...

OrientDB - How To - Record Level Security with ODocument

java,orient-db
I'm trying to get Record Level Security working using the Document database (Java) API for OrientDB. I like the idea of restricting access for certain records in the database to particular roles; however, I could not find how to do this in the documentation. I'm new to OrientDB so I'm...

OrientDB ETL importing date field

orient-db
I have imported a large table containing demographic information and my ETL JSON looks like this { "config": { "log": "debug" }, "extractor" : { "jdbc": { "driver": "com.mysql.jdbc.Driver", "url": "jdbc:mysql://localhost/avicenna", "userName": "xxxxxx", "userPassword": "xxxxxxxxxxxx", "query": "select * from patients", "fetchSize": 1000 } }, "transformers" : [ { "vertex": {...

orientDB list of map keys

sql,orient-db
I created an embedded map trough Java in the following way: Map<String,Object> mapObjectToInsert = new HashMap<String, Object>(); mapObjectToInsert.put("attr1",1); mapObjectToInsert.put("attr2","bla"); ODocument doc = new ODocument("testClass"); doc.field("postUrl","11"); doc.field("jsonData",mapObjectToInsert); doc.save(); and now I have the following embedded map: { "result": [ { "@type": "d", "@rid": "#14:0", "@version": 1, "@class": "testClass", "postUrl": "11", "postCategory":...

OrientDB doesn't save edge in/out and properties

distributed,orient-db
I've installed orientdb in distributed mode but I have a problem during creation of the edges (lightweightmode is disabled). When I create an edge everything seems to work fine but actually orientdb doesn't save the properties and even the link between out-in objects! I run the server executing dserver.sh. If...

How to authenticate a HTTP request to an OrientDB function on AngularJS?

angularjs,httprequest,orient-db
I have the following OrientDB function: http://cmdrafernando:2480/function/ApplicationVtaf/getPassFailCount/9:600 And it returns the following JSON result: {"result":[{"@type":"d","@version":0,"pass":16.0,"fail":2.0,"@fieldTypes":"pass=d,fail=d"}]} What I need to do is to get the values of "pass" and "fail" to use in my web page. So far I have done this with AngularJS: $http.get('http://cmdrafernando:2480/function/ApplicationVtaf/getPassFailCount/9:600'). success(function(data) { $scope.data = data.result; //...

What does the exclusive lock on storage for OrientDB entail exactly?

concurrency,transactions,locking,orient-db
Having read the following statement from the official documentation of OrientDB: In order to guarantee atomicity and consistency, OrientDB acquire an exclusive lock on the storage during transaction commit. I am wondering if my understanding of the situation is correct. Here is how I assume this will work: Thread 1...

How do I add to a spatial index in OrientDB?

lucene,orient-db
I'm using OrientDB 2.0 from the studio. I created a Lucene spatial index successfully, using the code from the documentation: CREATE class Place extends V CREATE property Place.name string CREATE property Place.latitude double CREATE property Place.longitude double CREATE INDEX Place.l_lon ON Place(latitude,longitude) SPATIAL ENGINE LUCENE I then created some Place...

Distinct function somehow not giving back all types

distinct,orient-db,result
Feel free to check it on my latest project: http://arda-maps.org:2480 arda arda as login. Now check select distinct(type) from Location Here you get 8 records (River,Lake,Region,City,Island,House,Mountain,Hill). But actually there are way more... To show you that the distinct somehow is not giving back all distinct we search for one specific...

Graph Databases vs Triple Stores - when to use which?

neo4j,sparql,graph-databases,orient-db,triplestore
I know that there are similar questions around on Stackoverflow but I don't feel they answer the following. Graph Databases to my understanding store data following mostly this schema: Table/Collection 1: store nodes with UID Table/Collection 2: store relations referencing nodes via UID This allows storing arbitrary types of graphs....

What factors to consider when choosing a Multi-model DBMS? (OrientDB vs ArangoDB)

database,orient-db,arangodb,foundationdb,multi-model-database
I am looking to dip my hands into the world of Multi-Model DBMS, I have no particular use cases, just want to start learning. I find that there are two prominent ones - OrientDB vs ArangoDB, but was unable to find any meaningful comparison, unopinionated between them. Can someone shed...

Find “friends of friends” with OrientDB SQL

orient-db
Although one of the most common use cases for demonstrating the capabilities of a graph database, I cannot seem to find a good example or best practice for obtaining "friends of friends" with OrientDB SQL. Lets assume a social network and try to model it with "user" vertices and "is_friend_with"...

orientdb property constraints like MANDATORY not failing on improper java api insertions

java,graph,orient-db
I have an orientdb setup with a class called MessageLog with a property messageId that has a constraint MANADATORY and NOT NULL. If i try to insert a record from the console with a null messageId it raises an exception telling that the property cannot be null. But when i...

Understand orient-db logic

sql,orient-db
I'm new in OrientDB/grahps and I'm trying to understand it's logic clearly. Let's say there are vertexes Movies 1:n Genres with SortOf edge. I would like to know other genres that have movies that are 'Comedy'. After reading docs I'd thought that it should be something like that: SELECT expand(in('SortOf').out('SortOf')[name<>'Comedy'])...

When to use expand() and/or sub-selects

orient-db
I would be grateful if someone could explain to me the difference between the following three queries and why only the last one works. select out() from #1:0 where @class instanceof 'BaseClass' select expand(out()) from #1:0 where @class instanceof 'BaseClass' select from (select expand(out()) from #1:0) where @class instanceof 'BaseClass'...

OrientDB - Creating an edge using rid's from index queries

orient-db
I'm trying to create edges between existing vertices queried by their indexed IDs, similar to the first answer here, but using this index lookup query instead of the label query: CREATE EDGE cite FROM (SELECT FROM index:<className>.<indexName> WHERE key = "<keyString>") TO (SELECT FROM index:<className>.<indexName> WHERE key = "<keyString>") This...

how to add conditions in OrientDB ETL

orient-db
I have a CSV file contains addresses for restaurants and other places, and at one colomun I have 'N' for neighborhood and 'S' (and not both) for street. If a line have the letter 'N' I want to link it to a vertex named neighborhood, and if it had 'S'...

Create schema for graph database with Java in OrientDB

java,orient-db
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 I get the following error: java.lang.NoSuchMethodError: com.orientechnologies.common.concur.resource.OResourcePool.getAllResources()Ljava/util/Collection; at com.orientechnologies.orient.client.r OServerAdmin serverAdmin = new OServerAdmin("remote:localhost").connect("root", "1234"); serverAdmin.createDatabase("mydb", "graph", "plocal");...

How to insert a large record into Orient DB using pyOrient?

python,pandas,orient-db
I have an orientDB database with a vertex type 'node'. The node vertex has a string property called 'data'. I am trying to insert roughly 5 to 10mb into the node's data property, however, the database seems to become non responsive when doing so. I am using pyOrient as a...

Fetching all the paths between two nodes using gremlin in java

java,graph-databases,orient-db,gremlin,tinkerpop
Hi I am kinda new to gremlin and trying to achieve some solve by finding all the paths between two nodes. In simple query on gremlin console I was able to do that using this query : (Name of the first Node).loop(1){it.loops<100}{true}.has('name', (Name of the second node)).path{it.name} But while I...

According to the list to receive a string RID class MARKS

orient-db
In my database IM_0609 OrientDB version 2.0.8 is a class MARKS: CALIBRATION_DATE:date. DEVICE_MARK:string DEVICE_NAME:string END_MARK_NUM:decimal MARK_NUM:decimal PERIOD:decimal SERIAL_NUM:string In the class MARKS I have created the index as follows: CREATE INDEX IDX_MARK_NUM on MARKS(MARK_NUM) NOTUNIQUE I run the following query quickly: select rid from index:IDX_MARK_NUM where key>=74118499 and key<=74118501 Results...

OrientDB query for hierarchical data

orient-db
OrientDB Server v2.0.10 , I am trying to come up with a query for the following scenario. I have 2 hierarchies: A->B->C and D->E->F The number of nodes in the hierarchy can change. The node in 1st hierarchy can be connected to the other hierarchy using some relation say 'Assigned'....

Waterline orientdb database connections timing out

node.js,sails.js,orient-db,waterline,sails-orientdb
With SailsJS/Waterline I am using the waterline-orientdb adapter to connect to and commit my domain objects to OrientDB. Everything with that is fairly straightforward except for the frequent connection timeouts that I'm getting from the database. orientdb: { adapter: 'waterline-orientdb', host: 'somehost', port: 2424, user: 'someuser', password: 'somepassword', database: 'somedatabasename'...

OrientDB: Accessing query result data in Server side function

javascript,orient-db
OrientDB allowes to create server side javascript functions. Is there any way to access intermediate query results inside server side javascript function. Eg. If I return query results, I get json response array as expected. But if I try to access query result inbetween function like: var comps = db.query("SELECT...

OrientDB SELECT and subqueries

orient-db
I'm really puzzled about this. Why does this works: SELECT out('Posted').out('IsFromCategory') FROM #18:1 And this does not: SELECT out('IsFromCategory') FROM (SELECT out('Posted') FROM #18:1) That's not me real logic, but is something I came up doing some tests......

OrientDB - LET variable in where

where,orient-db,let
I have a query very similar to this: SELECT FROM Post LET $category = (SELECT EXPAND(out('PartOf')) FROM $current), $poster = (SELECT EXPAND(in('Posted')) FROM $current) WHERE $poster <> #18:1 AND $poster IN (SELECT EXPAND(out('IsUser')) FROM (SELECT EXPAND(out('Related')) FROM #18:1) WHERE out('RelatedIn') IN ($category)) LIMIT 10000 And a graph like this: CREATE...

orient db unable to open any kind of graph

orient-db
I am new to orient-db and have run into a major block even trying to open a simple in memory database. Here is my two lines of code (in java) OrientGraphFactory factory = new OrientGraphFactory("memory:test").setupPool(1,10); // EVERY TIME YOU NEED A GRAPH INSTANCE OrientGraph g = factory.getTx(); try { }...

Writting SQL command to traverse Vertex on Edges conditions

java,orient-db
Imagine the following schema Let's say each edge is of type "manage" with an attribute "permissions" set to "rw" or "r-" or "--" and each vertex is of type Account. Here, Account 3 is not able to write in Account 5, but since Account 1 is able to write in...

OrientDB ETL edge lookup from query - how to access $input?

graph,etl,orient-db
I'm trying my darnedest to do an ETL import from a large dataset that I've been keeping in MongoDB. I've successfully imported the vertices, and I feel like I'm one little syntax misunderstanding away from importing the edges too. I am pretty sure that the error is in this transformer:...

Add typed Vertex with Frames in transactional graph in OrientDB

java,orient-db,vertex,transactional,tinkerpop
Good morning, I'm trying to use orientDB graph in transactional mode and i don't know why, but all my Verteces are not saved with type of a proxy class I set at the moment of the creation. Here is my code : FramedGraphFactory framedFactory = new FramedGraphFactory(); OrientGraph instance =...

Accessing Connected Vertices in OrientDB Javascript Functions

javascript,graph-databases,orient-db
I'm attempting to use the build in Functions in OrientDB studio to group Workstations that aren't in use by a Person. The query to get these vertices works fine but I'm trying to avoid Traverse as it is very slow - too slow to be used in production. Instead of...