Hi Folks,
I have a query which gives me some virtual nodes and relationships. BUt now I want to send this over to gephi using the apoc.gephi.add. Unfortunately, I can't figure out if this is possible with vNodes.
Here is my current query:
MATCH (a:Author)
WITH collect(distinct a.country) as countries
WITH [cName in countries | apoc.create.vNode(['Country'],{name:cName})] as countryNodes
WITH apoc.map.groupBy(countryNodes,'name') as countries
MATCH (a1:Author)-->(p:Paper)<--(a2:Author)
WHERE a1.country < a2.country
WITH a1.country AS countryName1, a2.country as countryName2, count(distinct p) as numCollabs, countries
WITH countries[countryName1] as country1, countries[countryName2] as country2, apoc.create.vRelationship(countries[countryName1], 'COLLABORATED_WITH', {numCollabs: numCollabs}, countries[countryName2]) as rels
RETURN country1, country2, rels limit 25
This works fine, but the examples in the documentation for gephi.add use a MATCH, but I can't seem to do that here.
Similarly, I can't even export the properties from Neo4j to csv because something like this doesn't work:
RETURN country1.name
This just returns null (because the nodes are virtual I guess) even though RETURN country1 returns a correct looking JSON object I can't return individual properties.
Any ideas?
Thanks.