neo4j

Use vars from before WITH statement in RETURN statement in Neo4j Cypher

廉价感情. 提交于 2019-12-14 02:55:45
问题 I'm starting with Neo4j (v2.1.5) and I'm having an issue with the following Cypher query: MATCH (actor:Person{name:"Tom Cruise"})-[role:ACTED_IN]->(movies)<-[r:ACTED_IN]-(coactors) WITH coactors, count(coactors) as TimesCoacted RETURN coactors.name, avg(TimesCoacted) ORDER BY avg(TimesCoacted) DESC It is based on the mini movie graph which comes with Neo4j installation. Everything works fine, it shows all coactors which coacted in movies with Tom Cruise and how many times they coacted

Neo4j - convert node attribute storage from string to number?

走远了吗. 提交于 2019-12-14 02:53:36
问题 I have a Neo4j database that was initially created from a Perl script using the Rest::Neo4p Perl module. For some unknown reason, one of the attributes on the nodes was created as a string, even though the values for said attribute on all of the nodes are numeric (verified through a Cypher regex search of that attribute). Is there an easy way to convert the attribute's storage type from string to a number short of recreating the database? Perhaps a Cypher query that would create a new

Neo4j gem - Preferred method to deal with admin relationship

ⅰ亾dé卋堺 提交于 2019-12-14 02:16:24
问题 This is mostly a design/efficiency question but I wanted to see if there was a preferred way to handle this in neo4j as opposed to how I would do it in a sql db. Right now I have 2 models - user and event . I also have a relationship between user and event to represent that they will attend the event. I want to figure out the best way to represent the admin of the event. In other words, I want to be able to query the events that are admined by a user. One way to do it is to create a new

Neo4J server startup error after enabling the unmanaged extension configuration

三世轮回 提交于 2019-12-14 00:35:39
问题 I am using Neo4J community edition 2.3.0 on windows OS 10. Everything works well until I changed the configuration at neo4j-server.properties files as: org.neo4j.server.thirdparty_jaxrs_classes=org.neo4j.examples.server.unmanaged=/examples/unmanaged The error at server startup is: Starting Neo4j failed: org.neo4j.server.web.NeoServletContainer-5b85e832@73766070==org.neo4j.server.web.NeoServletContainer,-1,false If I disable this change then server starts very well. I am trying to run the

neo4j produces “No authorization header supplied” error

牧云@^-^@ 提交于 2019-12-14 00:18:50
问题 I'm trying to access neo4j running on an aws ec2 instance from the command line where I get authorisation errors. I've enabled org.neo4j.server.webserver.address=0.0.0.0 and get a 503 error on the first statement and the same errors for the rest using the ec2 host name. ubuntu@ip-10-0-0-192:/etc/neo4j$ curl http://localhost:7474/ { "management" : "http://localhost:7474/db/manage/", "data" : "http://localhost:7474/db/data/" }ubuntu@ip-10-0-0-192:/etc/neo4j$ curl http://localhost:7474/db/data/

How make the relationship splitting the score of soccer in cypher

送分小仙女□ 提交于 2019-12-13 22:30:32
问题 In EPL match, the results between two teams is 2-6, so how to make the relationship and show that the high goals scored team won the match. Here is an attempt to load the CSV data. LOAD CSV WITH HEADERS FROM "file:///EPL_dataset_for_2018_19_assignment.csv" as row MERGE (team1:EPL_Teams{name:row.Team1}) MERGE (team2:EPL_Teams{name:row.Team2}) MERGE (round:Round{name:row.Round}) MERGE (date:Date{name:row.Date}) MERGE (score1:Scores{name:row.HT}) MERGE (score2:Scores{name:row.FT}) 回答1: You can

Neo4JClient: How to view the relationship (Direct reportees)?

 ̄綄美尐妖づ 提交于 2019-12-13 22:25:02
问题 I have an example of creating relationship using Neo4JClient: How to create relationships?. How to view the relationship? I mean if I want to find how many nodes are directly connected to "A", how to do that? Update After a little help from @manonthemat, I converted the cypher in C# var record = client.Cypher .Match("(A)-[r]->()") .Return((A, r) => new { User = A.As<ExampleNode>(), NumberOfFriends = r.Count() }).Results; Though I am able to get the direct count say 4 for A, I also want to get

cypher union group by sum

别说谁变了你拦得住时间么 提交于 2019-12-13 21:26:09
问题 I would like to boost edges for a user depending of some rules base on graph traversal. Basically in mysql I would do that : select id, sum(weight) as total from ( select id, 10 as weight from user inner join userRel1 ON user.id = userRel1.userId where userRel1.attr1 in (1, 2) union select id, 5 as weight from user inner join userRel2 ON user.id = userRel2.userId inner join userRel3 ON user.id = userRel3.userId where userRel2.attr2 = 'a' and userRel3.attr2 = 'z' union ... ) group by id order

Create Neo4j database using CSV files

99封情书 提交于 2019-12-13 21:01:11
问题 I have 2 CSV files which I want to convert into a Neo4j database. They look like this: first file: name,enzyme Aminomonas paucivorans,M1.Apa12260I Aminomonas paucivorans,M2.Apa12260I Bacillus cellulosilyticus,M1.BceNI Bacillus cellulosilyticus,M2.BceNI second file name,motif Aminomonas paucivorans,GGAGNNNNNGGC Aminomonas paucivorans,GGAGNNNNNGGC Bacillus cellulosilyticus,CCCNNNNNCTC As you can see the common factor is the Name of the organism and the. Each Organism will have a few Enzymes and

Compatibility neo4j-spatial with spring-data-neo4j-rest and neo4j CE 2.2.1 server mode?

Deadly 提交于 2019-12-13 19:20:20
问题 I'm trying to make neo4j-spatial version 0.14-neo4j-2.2.0, works with spring-data-neo4j-rest version 3.3.0.RELEASE with neo4j CE 2.2.1 in server mode. It looks like they are not compatible. Trying to create new instance of class EditableLayer throws NoSuchMethod exception. For instance: EditableLayer layer = (EditableLayer) spatialDb.getOrCreateLayer( "layer",SimplePointEncoder.class, EditableLayerImpl.class); I get the exception: SEVERE: Servlet.service() for servlet [com.stampy.foundation