neo4j

Sending Cypher script with LOAD CSV via REST isn't working for me

余生长醉 提交于 2019-12-11 11:22:07
问题 I'm trying to send this cypher script via REST: {"statements":[{"statement":"LOAD CSV WITH HEADERS FROM \"http://localhost:9000/api/csv/Countries/csv\" as csvLine MERGE (c:Country { Code: csvLine.Code }) RETURN c","resultDataContents":["row"],"includeStats":true}]} But I am getting back: {"results":[],"errors":[]} If I the same embedded query in the Neo4J browser it works fine. The following works fine: {"statements":[{"statement":"CREATE n RETURN n","resultDataContents":["row"],"includeStats

Method “rel_length” in Neo4j.rb doesn't work.

筅森魡賤 提交于 2019-12-11 11:15:13
问题 I need to get "friends of friends" of User . So, friend(rel_length: 2) doesn't work (ignores method), returning friends. class User include Neo4j::ActiveNode ... has_many :out, :friend, rel_class: Friend ... end class Friend include Neo4j::ActiveRel from_class User to_class User type 'friend' property :activity, type: String property :relation, type: String property :token, type: String end 回答1: For anybody finding this later the reason was because he was using an older version of the gem

neo4j 2.1.1 sample datasets not working

我怕爱的太早我们不能终老 提交于 2019-12-11 11:08:32
问题 I've installed Neo4j Community v2.1.1 in a Windows 7 x64 environment, then tried to play around with sample datasets (drwho, cineast, etc.) but couldn't load any of them. Returned error is "Starting Neo4j Server failed: Error starting org.neo4j.kernel.EmbeddedGraphDatabase". Setting allow_store_upgrade=true in {sample dataset folder}/neo4j.properties didn't solve it out. 来源: https://stackoverflow.com/questions/24042383/neo4j-2-1-1-sample-datasets-not-working

How to aggregate result of Union in Cypher?

人盡茶涼 提交于 2019-12-11 10:54:14
问题 I am trying to figure out how to aggregate the result of Union in Cypher. The following example can be executed in Cypher snippets live: MATCH (n:Crew)-[r:KNOWS]->m WHERE n.name='Neo' RETURN n AS name,m UNION MATCH (n:Crew)-[r:KNOWS]->m WHERE n.name='Morpheus' RETURN n AS name,m This query shows three rows as result because Neo knows one person and Morpheus two (note the directional link in the query). Let's say that we want to aggregate the known people. We can do something like this: MATCH

Neo4J: Query to return nodes grouped by relation attributes?

左心房为你撑大大i 提交于 2019-12-11 10:51:06
问题 In my case, nodes are connected with one or more relations of type similar . This relation has two attributes fldName and value . For example: (x)-[r:similar {fldName:'e-mail', value: 'name@x.y.com' }]->(y) (x)-[r:similar {fldName:'phone', value: '123-45-67' }]->(y) (q)-[r:similar {fldName:'e-mail', value: 'other@x.y.com' }]->(p) (q)-[r:similar {fldName:'phone', value: '891-23-45' }]->(p) (s)-[r:similar {fldName:'e-mail', value: 'neo@x.y.com' }]->(t) Questions: 1) What is the query to return

Using a legacy Neo4j database with Grails

爷,独闯天下 提交于 2019-12-11 10:48:59
问题 I would like to use the ENRON GraphML dataset, loaded into Neo4j, as a database for my Grails 2.0 application. The use-case for the data is read-only. I have had no trouble loading the dataset and creating a database in a stand-alone application, and now would like to use the Grails plugin to manage access to the database. Looking at the Neo4J plugin documentation on mapping domain classes, I see that it requires subreference nodes for each type of vertex. My data doesn't have that. I can see

How to secure access to neo4j remote shell?

和自甴很熟 提交于 2019-12-11 10:46:47
问题 I am running neo4j as embedded service in Jetty / webapp, but for support purposes I need shell access to it. I can enable remote shell using approach described here, but because I am using a shared hosting this does not feel secure enough, I would prefer some additional protection, e.g. username/password. Is that possible? Neo4j docs on securing the server only seem to apply to the web admin interface. 回答1: There is no authentication in remote shell. The way to secure access is to protect

Cypher do not repeat same results

时光毁灭记忆、已成空白 提交于 2019-12-11 10:43:39
问题 I have a cypher code that goes like this : start n=node(*) match p=n-[r:OWES*1..200]->n return extract(s in relationships(p) : s.amount), extract(t in nodes(p) : t.name), length(p) The query gives back nodes in a closed circle connected with relation OWES up to 200 level deep . The results given are : 2 [155.55, 100641359] [LJUBOJEVIC STR I PRZIONA KAFE VL.LJ , SASA , LJUBOJEVIC STR I PRZIONA KAFE VL.LJ ] 2 [100641359, 155.55] [SASA , LJUBOJEVIC STR I PRZIONA KAFE VL.LJ , SASA ] 3 [100641359,

How to configure the Neo4j repository with Spring Data Neo4j 3.4.0?

梦想与她 提交于 2019-12-11 10:43:20
问题 I tried to upgrade from the 3.3.2 to the 3.4.0 version of spring data neo4j on search.maven.org but the build now gives the following exception: AnnotationFormatError: Invalid default: public abstract java.lang.Class org.springframework.data.neo4j.config.EnableNeo4jRepositories.repositoryBaseClass() The application works just fine in 3.3.2. Here is the configuration class: @Configuration @EnableNeo4jRepositories(basePackages = { "it.data.neo4j.repository" }) @EnableTransactionManagement

Don't want to display neo4j relations in a form

不想你离开。 提交于 2019-12-11 10:42:04
问题 I'm using neo4j in my current app and it is my first time with this database, then I have a lot of doubts. The most important now is the following. I'm customizing my input forms (as you may see in this question I asked) and here is one of my models: class Contact include Neo4j::ActiveNode property :first_name, type: String property :surname, type: String property :email, type: String property :phones, type: String has_one :in, :address, type: :HAS_ADDRESS has_one :in, :title, type: :HAS