graph-databases

How to retrieve nodes for multiple depth relationships Neo4j Database Cypher?

丶灬走出姿态 提交于 2019-12-10 13:25:39
问题 Assuming that there is a simple graph as follows, (City {name:gotham})<-[:LOCATED]-(Tower {name:abc})<-[:LOCATED]-(Bank:{name:CityBank}) (City {name:gotham})<-[:LOCATED]-(Cinema {name:MainHall}) (City {name:gotham})<-[:LOCATED]-(Bank {name:ComBank}) How can i get all banks located in City named Gotham in Neo4j Database (including CityBank and comBank)? I tried following pattern, it returned all the nodes LOCATED in City named gotham (Including Cinema as well) MATCH (City{name:'Gotham'})<--

Is it possible to constraint edge multiplicity in Neo4j / OrientDB?

妖精的绣舞 提交于 2019-12-10 13:09:59
问题 I was wondering whether Neo4j and OrientDB provide the possibility of defining constraints in terms of multiplicity for specific edge types? 回答1: For OrientDB You can set multiplicity on out/in collection per label. Example to set maximum 1 edges from Person to Company if the edge's label is "workFor": ALTER PROPERTY Person.out_workFor NOT NULL ALTER PROPERTY Person.out_workFor MAX 1 You can also set the minimum with: ALTER PROPERTY Person.out_workFor MIN 1 In this way with min & max it's

How to access and mutate node property value by the property name string in Cypher?

左心房为你撑大大i 提交于 2019-12-10 12:42:35
问题 My goal is to access and mutate a property of a node in a cypher query where the name of the property to be accessed and mutated is an unknown string value. For example , consider a command: Find all nodes containing a two properties such that the name of the first property is lower-case and the name of the latter is the upper-case representation of the former. Then , propagate the value of the property with the lower-case string name to the value of the property with the upper-case name. The

Programmatically creating edges in ArangoDB

痞子三分冷 提交于 2019-12-10 11:21:43
问题 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

GAS API implementation and usage

你说的曾经没有我的故事 提交于 2019-12-10 11:20:05
问题 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

Understanding of Neo4j object cache

泪湿孤枕 提交于 2019-12-10 10:47: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

Error in Executing Neo4j Cypher Query (by Java) embedded mode

*爱你&永不变心* 提交于 2019-12-10 10:13:30
问题 Im having error in executing Cypher query in java (embedded mode) This is my code: import org.neo4j.cypher.internal.ExecutionEngine; import org.neo4j.cypher.internal.ExecutionResult; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.factory.GraphDatabaseFactory; public class test { public static void main(String[] args) { GraphDatabaseFactory graphdbFactory = new GraphDatabaseFactory(); GraphDatabaseService graphdb = new graphdbFactory.newEmbeddedDatabase("C:/Users/dell

How to get nodes that have a given amount of outgoing relationships with a given property in Neo4j Cypher?

流过昼夜 提交于 2019-12-10 10:00:20
问题 In my domain a node can have several relationships of the same type to other entities. Each relationship have several properties and I'd like to retrieve the nodes that are connected by at least 2 relationships that present a given property. EG: A relationship between nodes have a property year . How do I find the nodes that have at least two outgoing relationships with the year set to 2012 ? Why Chypher query so far looks like this (syntax error) START x = node(*) MATCH x-[r:RELATIONSHIP

How to store graph data in a database?

℡╲_俬逩灬. 提交于 2019-12-08 15:50:26
问题 I am new to graphs and its very interesting.This question may be noob one but please site some good materials. I am trying to make a small social Network where each user is a node and has undirected connection with his friend. Its working fine but now I want to store it in a database. How can I store the data?How to store all the connected nodes(pointer) of a node. Is it better to delete the memory after the user log out and read it from database when he logs in or should logging in and

Graph database performance

独自空忆成欢 提交于 2019-12-08 08:56:38
问题 I was reading a book recommended on Neo4j site: http://neo4j.com/books/graph-databases/ about graph database performance and it said: "In contrast to relational databases, where join-intensive query performance deteriorates as the dataset gets bigger, with a graph database performance tends to remain relatively constant, even as the dataset grows. This is because queries are localized to a portion of the graph . As a result, the execution time for each query is proportional only to the size