cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Should Virtual Relationship Be Displayed in Browser?

andy_hegedus
Graph Fellow

Hi,

Starting with virtual relationships and have a simple cypher statement

MATCH (a:company)<-[:Assigned_to]-(r:patent)-[:Classified_as]->(b:cpc) RETURN a,b, apoc.create.vRelationship(a,'Uses',{howmany:count(r)},b)

This seems to return the correct result when viewed in table format in browser.
{
"identity": 1,
"labels": [
"company"
],
"properties": {
"name": "Advanced Microgrid Solutions",
"description": "Advanced Microgrid Solutions installs advanced energy storage systems in buildings to lower energy costs for consumers and provide clean.",
"URL": "https://www.crunchbase.com/organization/advanced-microgrid-solutions"
}
}
{
"identity": 227674,
"labels": [
"cpc"
],
"properties": {
"cpclevel": 8,
"art": "Load forecast, e.g. methods or systems for forecasting future load demand",
"subgroup": "H02J3/003"
}
}
{
"identity": -26011,
"start": 1,
"end": 227674,
"type": "Uses",
"properties": {
"howmany": 2
}
}

However in graph mode display the relationships are not shown. Yellow nodes are 'a' and green are 'b' nodes. The virtual relationship is not shown. Is this intended behavior or must I define it somehow to display it?

If I change the query slightly to include a specific company (name:'Sonnen')

MATCH (a:company{name:'Sonnen'})<-[:Assigned_to]-(r:patent)-[:Classified_as]->(b:cpc)
RETURN a,b, apoc.create.vRelationship(a,'Uses',{howmany:count(r)},b)

Then the returned graph does display the virtual relationships:

So I do I get this result for all the companies as defined in the first query?

Andy

1 REPLY 1

Hello @andy.hegedus

I think the result view is limited by the browser since you have all the results in the table but not in graph view, you can change these parameters in browser settings (bottom left of the interface, gear icon):

  • Initial Node Display
  • Max Neighbours
  • Max Rows
  • Connect result nodes

Regards,
Cobra