graph-databases

gremlin syntax to calculate Jaccard similarity metric

只愿长相守 提交于 2019-12-20 06:31:28
问题 I'm interested in calculating the Jaccard similarity metric for all pairs of vertices in a graph that are not directly connected. The Jaccard metric is defined as the norm of the intersection of the neighbors of the two vertices divided by the norm of the union of the same sets. where So far I have been able to get all pairs of nodes not directly connected (only interested in this case for link prediction, if a direct link already exists then I do not need to calculate the Jaccard metric)

Neo4j how to delete nodes recursively from some start node

有些话、适合烂在心里 提交于 2019-12-20 03:23:54
问题 In my Neo4j database I have a following entities: @NodeEntity public class Product { private final static String CONTAINS = "CONTAINS"; private final static String DEFINED_BY = "DEFINED_BY"; private final static String VOTED_FOR = "VOTED_FOR"; private final static String PARENT = "PARENT"; private final static String CREATED_BY = "CREATED_BY"; @GraphId private Long id; @RelatedTo(type = PARENT, direction = Direction.INCOMING) private Product parent; @RelatedTo(type = CONTAINS, direction =

Neo4j / Strategy to keep history of node changes

 ̄綄美尐妖づ 提交于 2019-12-20 02:24:04
问题 Let's assume a graph dealing with cars. Each Car can evolve over time, and I need to keep track of those changes. (in order to be able to track some inconsistency of evolution etc...) I thought about implementing a copy-on-write mechanism (like LinkedIn seems to do), meaning creating a complete new Car node each time one of the Car 's properties changes. I would end up with a graph like this: (Ferrari)-[:CURRENT]->(V3)-[:PREVIOUS]->(V2)-[:PREVIOUS]->(V1) I'm specifically interested in

Graph visualization frameworks

蓝咒 提交于 2019-12-19 12:21:53
问题 I want to visualize a Neo4j database in a graphical application. (I'm doing this primarily as a learning exercise). I want it to behave almost identically to the visualization in Neo4j's WebAdmin: When the graphic appears, I want to see the nodes moving around as they settle into their final locations, and I want the user to be able to click and drag node icons around the screen and have them stick where they are dropped, with the rest of the graph adjusting to account for the change. I have

Graph visualization frameworks

自古美人都是妖i 提交于 2019-12-19 12:21:37
问题 I want to visualize a Neo4j database in a graphical application. (I'm doing this primarily as a learning exercise). I want it to behave almost identically to the visualization in Neo4j's WebAdmin: When the graphic appears, I want to see the nodes moving around as they settle into their final locations, and I want the user to be able to click and drag node icons around the screen and have them stick where they are dropped, with the rest of the graph adjusting to account for the change. I have

Neo4j - Cypher vs Gremlin query language

情到浓时终转凉″ 提交于 2019-12-18 09:54:36
问题 I'm starting to develop with Neo4j using the REST API. I saw that there are two options for performing complex queries - Cypher (Neo4j's query language) and Gremlin (the general purpose graph query/traversal language). Here's what I want to know - is there any query or operation that can be done by using Gremlin and can't be done with Cypher? or vice versa? Cypher seems much more clear to me than Gremlin, and in general it seems that the guys in Neo4j are going with Cypher. But - if Cypher is

How to import a CSV file into Titan graph database?

半腔热情 提交于 2019-12-18 03:44:47
问题 Can anyone supply some sample code or hints on how to import a 1MB CSV of nodes, and another 1MB CSV of edges, into Titan graph database running on Cassandra? I've got small CSV files importing via Gremlin, but this doesn't seem appropriate for large files. I've seen Faunus can do this, but I'd like to avoid spending a couple of days setting it up if possible. It looks like BatchGraph might be the way to go (https://github.com/tinkerpop/blueprints/wiki/Batch-Implementation) but the example

What is the difference between graph-based databases and object-oriented databases?

余生颓废 提交于 2019-12-17 22:04:56
问题 What is the difference between graph-based databases (http://neo4j.org/) and object-oriented databases (http://www.db4o.com/)? 回答1: I'd answer this differently: object and graph databases operate on two different levels of abstraction. An object database's main data elements are objects, the way we know them from an object-oriented programming language. A graph database's main data elements are nodes and edges. An object database does not have the notion of a (bidirectional) edge between two

Graph/Gremlin for social media use case

耗尽温柔 提交于 2019-12-17 21:17:43
问题 Consider instagram feed scenario. I want to get all the posts 'posted' by the people I follow. For each of these posts I want to know whether I have liked it or not and also know which of the other people I follow have liked it (if any). What is the best solution to get this in gremlin (possibly avoiding duplication)? Image for clarity The following just gives the posts 'posted' by USER 2. How to get other information in the same query? g.V().has('ID','USER 2').out('posted') 回答1: When you ask

Performance of arbitrary queries with Neo4j

我怕爱的太早我们不能终老 提交于 2019-12-17 18:32:17
问题 I was reading a paper published by Neo4J (a while ago): http://dist.neo4j.org/neo-technology-introduction.pdf and on the 2nd to last page the Drawbacks section states that Neo4J is not good for arbitrary queries. Say I had Nodes of users with the following properties: NAME, AGE, GENDER And the following relationships: LIKE (points to Sports, Technology, etc. NODE) and FRIEND (Points to another USER). Is Neo4J not very efficient in querying something similar to: Find FRIENDS (of given node)