neo4j

neo4j return a relationship that isn't defined

 ̄綄美尐妖づ 提交于 2021-02-02 09:55:20
问题 I am quite new to graph databases so what I am asking may be completely made up in my head. I have three nodes, product, supplier and country which looks like the below (feedback welcome on appraoch). I would like to return the product and the country BUT I would like to return a relationship between them to show they are connected (I am envisioning two nodes connected by a line). I got this far where I can return product and supplier but no matter which way I spin the syntax I can't seem to

Setting up Causal Cluster Fails

久未见 提交于 2021-01-29 13:23:41
问题 I am trying to setup up a Neo4J Causal Cluster with 3 cores (core only). I have three Debian servers all debian 8.5. I have installed Java 8 and Neo4J Enterprise 3.4.0 (package source deb https://debian.neo4j.org/repo stable/) on each server. My hosts are 192.168.20.163, 192.168.20.164 and 192.168.20.165. The config is the same on each host with the obvious change for IP address. The following is for the .163 host dbms.connectors.default_listen_address=0.0.0.0 dbms.connectors.default

How to represent non unique parent-child relationship as graph?

六月ゝ 毕业季﹏ 提交于 2021-01-29 11:36:47
问题 I want to see if there is a way to represent/model a nested parent-child relationship in a graph db platform like neo4j or arangodb. In particular, I am trying to model the contractor/subcontractor relations over multiple contracts: example contract relations image link I can see how this can be done using a table where both the parent and the contract are represented. I can't see how to do this in a graph since there can be multiple A-B relations but for different contracts. 回答1: Using

Graph Database or Relational Database Common Table Extensions: Comparing acyclic graph query performance

♀尐吖头ヾ 提交于 2021-01-29 10:09:07
问题 Are graph databases more performant than relational databases for highly connected acyclic graph data? I need to significantly speed up my query results and hope that graph databases will be the answer. I had seen significant improvement in my relational database queries when I used Common Table Extensions bringing a recursive search of my sample data from 16 hours to 30 minutes. Still, 30 minutes is way too long for a web application and trying to work around that kind of response gets

How to query exact path in neo4j and avoid cartesian product?

[亡魂溺海] 提交于 2021-01-29 09:36:58
问题 I have around 3000 nodes with 7000 relationships in a graph but for a presentation, I'd like to plot a sub-graph of which I know exactly which nodes I need. Therefore, I use the following query which sometimes gives me the correct path as a result (after a long waiting period) and sometimes depletes memory and cpu resources until I force-quit the neo4j-browser. MATCH p1=(:DestinationNode)-[:IS_AT]-> (:CentiDegreeNode{x: 4714, y: 843})-[:CONNECTED_TO*1]- (:CentiDegreeNode{x: 4715, y: 843})-[

Pivoting data in Cypher

若如初见. 提交于 2021-01-29 09:22:23
问题 I've just gotten into working with a Neo4J database, and I'm having a hard time figuring out a good way to pivot some data that I'm working with. I have a basic query that looks like this: MATCH (n:DATA) WHERE n.status =~ "SUCCESS" return n.group as Group, n.label as Label, avg(toFloat(n.durationMillis)/60000) as Minutes , which produces tall narrow data like this: |Group |Label |Minutes| |-------|-------|-------| |group1 |label1 |1.0 | |group1 |label2 |2.0 | |group1 |label3 |5.0 | |group2

Neo4J variable alias not recognized

£可爱£侵袭症+ 提交于 2021-01-29 08:41:01
问题 I have three Person nodes with various relationships. Each node has a latitude and longitude. First, I find the combinations of pairs of nodes: MATCH (p1: Person)-[]->(p2: Person) RETURN p1.name, p2.name My output is correct: Next, I attempt to find the distances between the pairs of nodes: MATCH (p1:Person)-[]->(p2:Person) WITH point({longitude: p1.longitude, latitude: p1.latitude}) AS p1Point, point({longitude: p2.longitude, latitude: p2.latitude}) AS p2Point RETURN (distance(p1Point,

Neo4j Java bolt driver: how to convert the result to Json?

僤鯓⒐⒋嵵緔 提交于 2021-01-29 03:07:02
问题 I am using the Java Bolt driver (1.0.1) and I am wondering there is a way to convert the result to Json (possibly the same as in the REST api)? I tried to use gson in this way: Result r = null; try ( Transaction tx = graphDb.beginTx() ) { r = graphDb.execute("MATCH..."); tx.success(); } catch {...} new Gson().toJson(result); but what I get is: java.lang.StackOverflowError at com.google.gson.internal.$Gson$Types.canonicalize($Gson$Types.java:98) at com.google.gson.reflect.TypeToken.<init>

Failed to invoke procedure `ga.timetree.now`: java.lang.NoClassDefFoundError: com.graphaware.module.timetree.SingleTimeTree

落爺英雄遲暮 提交于 2021-01-28 19:32:16
问题 I am unable to run CALL ga.timetree.now({}) It fails with a subj error. My neo4j.conf includes the following: dbms.unmanaged_extension_classes=com.graphaware.server=/graphaware com.graphaware.runtime.enabled=true com.graphaware.module.TT.1=com.graphaware.module.timetree.module.TimeTreeModuleBootstrapper Iam using neo4j 3.4.12 with grapaware-server-all.3.4.9.52 and timetree-3.4.9.52.28 built from repositories and put into /plugins directory. Could anyone help me with what i am missing ? 回答1:

gremlin filter on Hashmap property without using a lambda

痴心易碎 提交于 2021-01-28 18:54:11
问题 If I have a vertex in a graph database where one of the properties is a map, is there a way to filter on properties of the map without using a lambda? Create the vertex like this: gremlin> v = graph.addVertex(label, 'LABEL') ==>v[68] gremlin> g.V(68).property('prop', [ key: 'val' ]) ==>v[68] gremlin> g.V(68).valueMap() ==>{prop=[{key=val}]} Is there a way to filter for vertices by prop.key == 'val' without using a lambda? gremlin> g.V().filter{ it.get().values('prop').next().get('key') ==