graph-databases

How to merge nodes that have the same value for name property in Neo4j

拟墨画扇 提交于 2019-12-07 03:45:01
问题 I just push text corpus into Neo4j database. When I execute MATCH (n) RETURN n Cypher query, it returns multiple nodes with the same name. how can I merge these nodes as one? nodes having same name 回答1: Your name values have different values because of upper and lower case letters ("Java" and "java" are different). I reproduced your scenario creating a sample data set: CREATE (n1:Node {name : "Java"}), (n2:Node {name : "Java"}), (n3:Node {name : "java"}), (n1)-[:TYPE]->(), (n1)-[:TYPE]->(),

Why do I get a “Cartesian Product” warning?

此生再无相见时 提交于 2019-12-07 02:05:22
问题 I am still trying to understand why I get a cartesian product warning for a certain format for a query in neo4j and not for another. This is how I set up my database: CREATE (q:Form {version: "1.0"}) CREATE (q:Question {text: "Sector de la empresa", active: true}) I then tried the following query: MATCH (f:Form {version: "1.0"}), (q:Question {text: "Sector de la empresa"}) CREATE (f)-[:asks]->(q) RETURN f, q However, I get the following warning: This query builds a cartesian product between

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

GAS API implementation and usage

橙三吉。 提交于 2019-12-06 10:16:44
I'm trying to learn and use the GAS API to implement a Random Walk over my database, associating every visited vertex to the starting vertex. I'm having some issues understanding how I can manage to do this; I've been reviewing the PATHS, BFS, PR, and other GAS classes as examples, but I'm not quite sure how to start. I think my implementation should extend BaseGASProgram and implement the needed methods. Also, as iterative, the frontier contains all the vertexes of the current iteration. The concept of predecessor is also clear to me. But I don't think that I understand very well the Gather,

Understanding of Neo4j object cache

限于喜欢 提交于 2019-12-06 09:14:23
I'm trying to understand Neo4j object cache by some investigation into it. My first impression of Object cache come from the slides in this link: http://www.slideshare.net/thobe/an-overview-of-neo4j-internals Specifically the Node/Relationship object in cache should look like slide 9 or 15/42. To verify this, I wrote a simple server script using existing graph database contents. The way I do it is trying to look into the starting virtual address of the node/relationship object using sun.misc.Unsafe. The program for obtaining virtual address is from the following link: How can I get the memory

Neo4j can I make relations between relations?

孤街醉人 提交于 2019-12-06 06:01:53
I'am using graph database (Neo4j) , and I need to make relations between relations , for example : (user1)-[:FOLLOWED]->(user2) I want to allow other users to like this activity (that user1 followed user2) , what's the best implementation for this ? Short answer: You can't create a relation to a relation. How to do? You have to create an activity node in the middle of your relation: (user1)-[:FOLLOWED]->(activity{date:..., blabla:...})-[:ACTIVITY_FOR]->(user2) Then you'll be able to make another user LIKE this activity by creating a relation from user to activity node. Relation names are

Neo4j - Order by relevance

醉酒当歌 提交于 2019-12-06 05:36:01
I'd like to order returned data by relevance in Neo4j. For my purpose, relevance can be simplified to "Index of the word I'm searching for", where the lower index the higher relevance. Example I have these three nodes: node : { Label: PROD properties : { name: "Bearing replacement Skateboard" } } node : { Label: PROD properties : { name: "Skateboard" } } node : { Label: PROD properties : { name: "L7 Skateboard" } } I want them to be returned with this order: node : { Label: PROD properties : { name: "Skateboard" // name.indexOf("Skateboard") = 0 } } node : { Label: PROD properties : { name:

Programmatically creating edges in ArangoDB

微笑、不失礼 提交于 2019-12-06 05:11:34
What is the simplest way to quickly create edges in ArangoDB programmatically? I would like to create relationships between documents based on a common attribute. I'd like to be able to select an attribute, and for every document in collection A, create an edge to every document in collection B that has the same value in an equivalent attribute. For example, if I've imported email messages into a collection and people into another collection, I would like to generate edges between the emails and collections. An email's schema might look like this: { "_key": "subject": "body": "from": "to": }

How to realize a nested tree in Neo4j?

天大地大妈咪最大 提交于 2019-12-06 04:13:25
问题 I am just getting started with Neo4j and Graph Databases and was wondering if nested hierarchical trees are a good use case for Neo4j. A common example would be a nested set of comments. For example: - Article - Comment 1 on Article - Comment 2 on Comment 1 - Comment 3 on Comment 1 - Comment 4 on Comment 3 - Comment 5 on Article As I understand it, the article and the comments would each be nodes. And each comment would have a parent-child relationship. Getting all direct comments on the

Using both graph db and document db

半城伤御伤魂 提交于 2019-12-06 03:31:08
问题 I'm considering a setup where I have entities stored both in a document db (e.g. CouchDB) and a graph db (e.g. Neo4j). The rationale is storing each entity information (data, blobs, values, complex internal structure) in the document db while storing the entity relations (parents, children, associated entities) in the graph db. Has anyone done / seen / been bitten by a setup like this? What kind of issues should I expect? First thing that come to mindaka the 2-phase commit. But backups are