neo4j

Neo4j Cypher node filtering by pattern comprehension

爷,独闯天下 提交于 2019-12-25 16:00:13
问题 I have a following SDN 4 entities: Decision , Characteristic and Value : @NodeEntity public class Value extends Votable { private final static String SET_FOR = "SET_FOR"; private final static String SET_ON = "SET_ON"; private final static String CONTAINS = "CONTAINS"; @Relationship(type = SET_FOR, direction = Relationship.OUTGOING) private Decision decision; @Relationship(type = SET_ON, direction = Relationship.OUTGOING) private Characteristic characteristic; @Index(unique = false) private

Learning Blueprints, should I move directly to Tinkerpop 3? [closed]

笑着哭i 提交于 2019-12-25 14:48:30
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I need to learn Gremlin etc. and possibly use it within a public facing production-ready system I'm working on. As any release of my system is, at a minimum, 6 months away (say end Q1 2015), should I switch directly to the new, still pre-release, Tinkerpop 3 implementation,

How to create conditional relationships?

折月煮酒 提交于 2019-12-25 14:14:15
问题 I have a system that is run by an organization to implement a certain function, thus I have the relationship: Organization → Function → System but sometimes the function remains unknown, in which case I want to bind the system directly to the organization: Organization → System how do I write this kind of thing? the System contains attributes that are used for creating these relationships e.g. create (s:System {id: 'x', Organization: 'MST', Function: 'CM'}) or create (s:System {id: 'x',

Server not available on localhost with response code 403 & RuntimeError in Ruby on Rails

前提是你 提交于 2019-12-25 14:09:37
问题 After changing proxy settings in open_uri.rb and server_manage.rb I finally managed to install neo4j behind a proxy server. The neo4j server is running on port 7000 ( It opens in the browser) but when i enter : $rails generate scaffold post title body Error : /.rvm/gems/ruby-2.2.3/gems/neo4j-core-5.1.6/lib/neo4j-server/cypher_session.rb:51:in `open': Server not available on http://localhost:7000 (response code 403) (RuntimeError) What should I do ? Any help is appreciated!! $ ruby --version

Server not available on localhost with response code 403 & RuntimeError in Ruby on Rails

不羁的心 提交于 2019-12-25 14:08:27
问题 After changing proxy settings in open_uri.rb and server_manage.rb I finally managed to install neo4j behind a proxy server. The neo4j server is running on port 7000 ( It opens in the browser) but when i enter : $rails generate scaffold post title body Error : /.rvm/gems/ruby-2.2.3/gems/neo4j-core-5.1.6/lib/neo4j-server/cypher_session.rb:51:in `open': Server not available on http://localhost:7000 (response code 403) (RuntimeError) What should I do ? Any help is appreciated!! $ ruby --version

Server not available on localhost with response code 403 & RuntimeError in Ruby on Rails

微笑、不失礼 提交于 2019-12-25 14:08:20
问题 After changing proxy settings in open_uri.rb and server_manage.rb I finally managed to install neo4j behind a proxy server. The neo4j server is running on port 7000 ( It opens in the browser) but when i enter : $rails generate scaffold post title body Error : /.rvm/gems/ruby-2.2.3/gems/neo4j-core-5.1.6/lib/neo4j-server/cypher_session.rb:51:in `open': Server not available on http://localhost:7000 (response code 403) (RuntimeError) What should I do ? Any help is appreciated!! $ ruby --version

为什么选择图形数据库,为什么选择Neo4j?

不打扰是莪最后的温柔 提交于 2019-12-25 13:38:40
最近在抓取一些社交网站的数据,抓下来的数据用MySql存储。问我为什么用MySql,那自然是入门简单,并且我当时只熟悉MySql。可是,随着数据量越来越大,有一个问题始终困扰着我,那就是 社交关系的存储 。 就以新浪微博举例,一个大V少则十几万,多则几千万的粉丝,这些关注关系要怎么存呢?在MySql中,一条关注关系(大V id,大V的一个粉丝 id)存为一条数据,那么当用户数量上来的时候,关注关系轻松破亿,破十亿,甚至上百亿,并且为了保证每条数据的唯一性,还需要设置联合索引,MySql就有些力不从心了。那么有人要说了:分表呀。嗯,没错,分表的确可以在插入端和读取端提升一些速度。比如我们可以根据id哈希到100张表中。查询一个用户有哪些粉丝是快了,但是查询一个用户关注了哪些人时仍然需要遍历全表。好,这时候我们还可以以(id,其关注的一个用户的id)再构造100张表,于是两种查询都快了。然而,后面那100张表是冗余数据,看着就不爽...并且生成一张子图也不方便(需要多次写SQL查表)。 于是,在搜索更好的方案时无意间发现了图形数据库,查阅一番资料后感觉确实是个不错的选择,毕竟业界的一些大佬,如twitter,Adobe等也在用。 那么, 什么是图形数据库呢 ?在这里我贴上较为官方的定义: a database that uses graph structures for

neo4j cypher toInt function

别来无恙 提交于 2019-12-25 12:14:46
问题 In the neo4j Cypher refcard (http://docs.neo4j.org/refcard/2.0/) under Functions sections there is this definition: toInt({expr}) Converts the given input in an integer if possible; otherwise it returns NULL. If I try it in Cypher console I get this: neo4j-sh (?)$ match (n:Document) return toInt(n.date); ==> SyntaxException: Unknown function 'toInt' (line 1, column 27) ==> "match (n:Document) return toInt(n.date)" ==> ^ neo4j-sh (?)$ (In my case n.date is a string representation of that date.

Path Query in neo4j

牧云@^-^@ 提交于 2019-12-25 10:15:49
问题 This question is based on my earlier post on neo4j I am trying to find out the names of the person living in city 'X'. I am using 2 nodes: Person and City for this purpose and a relationship exists [LIVES_IN]. I have created 4 nodes and 2 relationships as such: CREATE (m:Person { name : 'sa', paswrd : 'abc' }); CREATE (n:Person { name : 'ti', paswrd : 'abc' }); CREATE (o:City { name : 'pune' }); CREATE (p:City { name : 'mumbai' }); CREATE (m)-[:LIVES_IN]->(o); CREATE (n)-[:LIVES_IN]->(o); Now

Neo4j Query Performance tuning Undestanding

◇◆丶佛笑我妖孽 提交于 2019-12-25 09:16:51
问题 I am trying to optimize the query performance in my Neo4j. I have created the Unique indexes and the query is performing pretty good. But the query performance figure shown in the Neo4j web console shows as " 0 estimated rows " and " 0 db hits ". But in real, I am getting the result with one relationship. My query: Match (a:Person{id:"1234"})-[r:Employed_by]->(b:Organization(id:"abcd")) RETURN r This query returns me a relationship. But when I am checking the same query with Profile, it is