graph-databases

Comparison of Relational Databases and Graph Databases

南笙酒味 提交于 2019-12-17 10:11:58
问题 Can someone explain to me the advantages and disadvantages for a relation database such as MySQL compared to a graph database such as Neo4j? In SQL you have multiple tables with various ids linking them. Then you have to join to connect the tables. From the perspective of a newbie why would you design the database to require a join rather than having the connections explicit as edges from the start as with a graph database. Conceptually it would make no sense to a newbie. Presumably there is

Graph DB: Sort product based on likes

独自空忆成欢 提交于 2019-12-14 04:14:38
问题 I have a product vertex which has incomming like edge. User ------- likes ----------->products In my search result I want to sort the products based on likes. How this can be done ? 回答1: Just use groupCount : gremlin> g = new TinkerGraph() ==>tinkergraph[vertices:0 edges:0] gremlin> user1 = g.addVertex('u1') ==>v[u1] gremlin> user2 = g.addVertex('u2') ==>v[u2] gremlin> product1 = g.addVertex('p1') ==>v[p1] gremlin> product2 = g.addVertex('p2') ==>v[p2] gremlin> product3 = g.addVertex('p3') ==

Does Cosmos DB support Gremlin.net c# GLV?

房东的猫 提交于 2019-12-13 20:12:43
问题 I cannot find this information, and also I cannot find examples on how to use Gremlin.net c# GLV with a remote Cosmos DB graph. Someone knows anything about this? Thanks! 回答1: Currently CosmosDB does not support GLV's as they do not yet have Bytecode support. They have told me that they are working on it and expect it to be available soon. 来源: https://stackoverflow.com/questions/49512146/does-cosmos-db-support-gremlin-net-c-sharp-glv

Optimize Neo4j Cypher path finding with limited paths in an undirected graph

一世执手 提交于 2019-12-13 17:23:31
问题 As a follow-up from the question "Neo4j Cypher path finding slow in undirected graph". Michael Hunger and Wes Freeman kindly helped but I failed to adapt the techniques learned to path finding queries that should return the paths. The issue: The below query takes roughly 3s and returns 13 rows (the paths found) from a database. I find it slow and would like to have it execute faster but don't know how to optimize it. (This is an example of course but I find similar other queries slow too.)

Is neo4j suitable for searching for paths of specific length

时间秒杀一切 提交于 2019-12-13 17:14:45
问题 I am a total newcommer in the world of graph databases. But let's put that on a side. I have a task to find a cicular path of certain length (or of any other measure) from start point and back. So for example, I need to find a path from one node and back which is 10 "nodes" long and at the same time has around 15 weights of some kind. This is just an example. Is this somehow possible with neo4j, or is it even the right thing to use? Hope I clarified it enough, and thank you for your answers.

Graphdb/Neo4j relationship to another relationship, or relationship with 3 nodes

扶醉桌前 提交于 2019-12-13 16:09:54
问题 I want to make IMDB's characters/roles structure in Neo4j. I'll need labels Person , Movie and Character . Character , because a character can be in multiple movies, played by different people. Without Character , it's easy: (Person)-[:PLAYS_IN]->(Movie) But PLAYS_IN is a Character , so it would be something like: (Person)-[:PLAYS_AS]->(Character)-[:PLAYS_IN]->(Movie) but that doesn't work, because it doesn't have a direct Person-Movie relationship. Without that, everyone who ever played

Multiple relationships of the same type but with different properties between the same two nodes

回眸只為那壹抹淺笑 提交于 2019-12-13 15:24:46
问题 Can I create multiple relationships of the same type between the same two nodes? I am trying to discover patterns in nodes connected with the same relationship type. For e.g., relation PERFORMED_BY could have a property to record Person1 as the performer with a timestamp for the transition from node A to node B and a second relation PERFORMED_BY could have Person2 as the performer at a different time between the same two nodes. 回答1: Yes, you can have multiple relationships of the same type

quickest sparse matrix access, when disk is involved

强颜欢笑 提交于 2019-12-13 03:59:06
问题 Imagine you have a table 'users' with 10 Mio records and a table 'groups' with 1 mio records. In average you have 50 users per group which I would store at least in an rdbms in a table called users2groups. users2groups is in fact a sparse matrix. Only 80% of the full dataset of users and groups fit into available memory. The data for the group membership (users2groups) comes on top, so that if memory is needed to cache group memberships this has to be deallocated from either the users or the

Neo4jPhp too slow

☆樱花仙子☆ 提交于 2019-12-13 03:58:09
问题 Today i have written first basic program for Neo4j from PHP. This was basically done to check out if we could use Neo4j in our new project from PHP by using Neo4jPhp. https://github.com/jadell/neo4jphp here is my code <!DOCTYPE html> <html> <body> <h1>My first PHP page</h1> <?php include 'neo4jphp.phar'; echo "Hello World!"; // Connecting to the default port 7474 on localhost $client = new Everyman\Neo4j\Client(); $queryString = "MATCH (n)". "RETURN n"; $query = new Everyman\Neo4j\Cypher

How to delete a node and its connected nodes with Neo4j cypher query?

我是研究僧i 提交于 2019-12-13 03:36:12
问题 For example, I want to delete Actor node with id = "005A" and its connected Movie nodes. The relationship between Actor and Movie node is ACTED_IN . I have tried this cypher query: MATCH (a:Actor {id: "005A"}) OPTIONAL MATCH (a)-[r:ACTED_IN]->(m) DELETE a, r, m; but it didn't work, I got TransactionFailureException: Unable to commit transaction error. Anyone can give a solution? UPDATE: I found out that there is relationship from other node ( Agency ) to Actor node which labeled as OWNED . So