neo4j

neo4j - user suggestion with mutual count

纵然是瞬间 提交于 2019-12-13 08:14:56
问题 I have created 5 nodes in neo4j as follows. Node 1 {userid:1000, username: A, someOtherProperties...} Node 2 {userid:2000, username: B, someOtherProperties...} Node 3 {userid:3000, username: c, someOtherProperties...} Node 4 {userid:4000, username: D, someOtherProperties...} Node 5 {userid:5000, username: E, someOtherProperties...} Node 1 connected with Node 2 & 3, and Node 2 connected with node 1, 3, 4 1 -> 2 1 -> 3 2 -> 1 2 -> 3 2 -> 4 3 -> 4 Now I want user suggestion for node 1 which

How to integrate Neo4j database, NestJS framework and GraphQL?

匆匆过客 提交于 2019-12-13 07:53:58
问题 I'm trying to integrate my REST API (NestJS) with new Neo4j database with GraphQL queries. Anybody succeed? Thanks in advance EDIT 1: (I added my code) import { Resolver } from "@nestjs/graphql"; import { Query, forwardRef, Inject, Logger } from "@nestjs/common"; import { Neo4jService } from "src/shared/neo4j/neoj4.service"; import { GraphModelService } from "./models/model.service"; import { Movie } from "src/graphql.schema"; @Resolver('Movie') export class GraphService { constructor(private

Spring data neo4j : count relation By EndNode ID

﹥>﹥吖頭↗ 提交于 2019-12-13 07:46:32
问题 I'm using a spring data neo4j 5.0.0. My model is a (user)-[:ATTEND]-(meeting) and ATTEND is a RelationshipEntity. user have attend relationship, meeting does not have relationship. @Relationship(type = "ATTEND") Set<AttendMeeting> attendMeetings = new HashSet<>(); RelationshipEntity code. @Setter @Getter @ToString @NoArgsConstructor @RelationshipEntity(type = "ATTEND") public class AttendMeeting { @GraphId private Long id; @JsonIgnore @StartNode private User user; @EndNode private Meeting

neo4j uuid is not created

怎甘沉沦 提交于 2019-12-13 07:30:02
问题 class Client include Neo4j::ActiveNode end > client = Client.new => #<Client uuid: nil, bot_client_id: nil, created_at: nil, email: nil, first_name: nil, last_name: nil, sms: nil, telegram_id: nil, updated_at: nil> My expectation is that the uuid would be populated. 回答1: The uuid is only populated once the node object has been saved. So you could either do: client = Client.create Or: client = Client.new client.save 来源: https://stackoverflow.com/questions/43535208/neo4j-uuid-is-not-created

Start neo4j server on windows

痴心易碎 提交于 2019-12-13 07:22:52
问题 When I try to start the server on windows: Open a windows command prompt, go to the neo4j bin directory and execute Neo4j.bat. I get this error message: Error: Unable to access jarfile C:\app\NEO4J-~1.2\bin\windows-service-wrapper-*.jar What do I need to change in the bat files that it works? 回答1: Replace the * with the version of the neo4j you have downloaded. go to the bin directory open the base.bat file and look for something like this set wrapperJarFilename=windows-service-wrapper-*.jar

How can I copy a path in Neo4j?

廉价感情. 提交于 2019-12-13 07:12:43
问题 I'd like to recreate a whole chain of nodes and relationships in Neo4j. I know that I can save a path with p= , but CREATE doesn't accept this. MATCH p=(:Person)-[*]->(:Dog) CREATE p Is there a way to do this? 回答1: As you've seen, the syntax you tried does not work, so one would have to attempt to write a lot of Cypher code to copy all the parts of each path. However, it turns out that it is not currently possible to use Cypher alone to duplicate arbitrary paths -- as some needed capabilities

Neo4j graph.index().forNodes not finding nodes

匆匆过客 提交于 2019-12-13 07:05:00
问题 I'm trying to create unique nodes of type TEST with a unique property of "id". However the forNodes() method is not detecting duplicates, is there any better method using Java API only and why does the below not work? public class Neo4jTest { public static void main(String args[]) { GraphDatabaseService graph = new TestGraphDatabaseFactory().newImpermanentDatabase(); Label testLabel = new Label() { @Override public String name() { return "TEST"; } }; try (Transaction tx = graph.beginTx()) {

neo4j rest graphdb hangs when connecting to remote heroku instance

非 Y 不嫁゛ 提交于 2019-12-13 07:03:58
问题 public class Test { private static RestAPI rest = new RestAPIFacade("myIp","username","password"); public static void main(String[] args) { Map<String, Object> foo = new HashMap<String, Object>(); foo.put("Test key", "testing"); rest.createNode(foo); } } No output it just hangs on connection indefinitely. Environment: Eclipse JDK 7 neo4j-rest-binding 1.9: https://github.com/neo4j/java-rest-binding Heroku Any ideas as to why this just hangs? The following code works: public class Test {

Neo4j how to get first 10 desc codes

天大地大妈咪最大 提交于 2019-12-13 07:00:26
问题 I have this relation MATCH (chatitems)-[r:PartOf]->(teams)-[o:OwnedBy]-() I want to get teams.id and chatitems.id from first 10 teams distinct and ordered desc. I need to keep teams.id and chatitems because I need to use in other match I executed two queries first is MATCH (chatitems)-[r:PartOf]->(teams)-[o:OwnedBy]-() with distinct teams order by teams.id DESC with collect(teams)[0..10] as teams1 unwind teams1 as teamsid return teamsid Results are teamsid "{""id"":62531}" "{""id"":58852}" "{

Neo4j : Slow Selection Operation with Huge Data

一曲冷凌霜 提交于 2019-12-13 06:46:28
问题 I am trying to the nodes from the Graph randomly each time. the number of nodes is 24600968 in the database. The following query MATCH (n:Employee) WITH n AS emp,rand() AS ids ORDER BY ids LIMIT 10 MATCH (n:Company) WITH emp, n AS com,rand() AS ids ORDER BY ids LIMIT 10 RETURN emp.guid,com.guid is taking very long time. The time is Returned 10 rows in 306863 ms. How can I speed up this process. 回答1: run 2 separate statements try this Lookup nodes by a random set of ids and check if they are