Couldn't display all nodes on Gephi from Neo4j


(Mehdi Ajroud) #1

I ve been working on this since a long time and it works perfectly . But this time I used the same queries and I realized that I am not displaying all nodes just after deleting duplicates nodes !
I have 151 unique node but it displays only 45 !
Here is all queries that I used :

LOAD CSV WITH HEADERS FROM 'file:///ContratFP.csv' AS Contracts
CREATE (c:Contrat {
id: Contracts.contract_id, 
object: Contracts.contract_complete_object ,
description: Contracts.contract_description, 
duration: Contracts.contract_duration,
state: Contracts.contract_state,
type: Contracts.contract_duration,
duration: Contracts.TYPE

LOAD CSV WITH HEADERS FROM 'file:///AttribFP.csv' AS AttributairesFP
CREATE (at:Attributaires {
id: AttributairesFP.beneficiary_SIREN,
label: AttributairesFP.NAME_beneficiary,
city: AttributairesFP.beneficiary_city,
dep : AttributairesFP.beneficiary_department_code,
awarded_amount_single_value : AttributairesFP.beneficiary_awarded_amount_single_value

LOAD CSV WITH HEADERS FROM 'file:///RelationFP.csv' AS Contracts
MATCH (c:Contract {id: Contracts.contract_id}) , (at:Attributaires {id: Contracts.beneficiary_SIREN})
MERGE (c)-[:ASSIGNED_FP]->(at)

match path = (at1:Attributaires)-[:COLLABORATE_WITH_FP]->(at2:Attributaires)
with collect(path) as paths
call apoc.gephi.add(null,'workspace1', paths) yield nodes, relationships, time
return nodes, relationships, time

MATCH (at:Attributaires)
WITH as id, collect(at) AS nodes
WHERE size(nodes) >  1
FOREACH (at in tail(nodes) | DETACH DELETE at)


(Michael Hunger) #2

Where does it only display 45?

You probably want to use an OPTIONAL MATCH to also find nodes that have no relationship?

(Mehdi Ajroud) #3

Yes I just got nodes which have relationships :) Thanks Micheal :)