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.

No changes no records for clusters creation

I started by importing 2 csv files and then I made connection by importing the third one , here my queries :

LOAD CSV WITH HEADERS FROM 'file:///ContratFP18.csv' AS Contracts
CREATE (c:Contrat {
id: Contracts.contract_id, 
complete_object: Contracts.contract_complete_object ,
conditional_tranche: Contracts.contract_conditional_tranche,
description: Contracts.contract_description, 
duration: Contracts.contract_duration,
exe_dep_code: Contracts.contract_execution_department_code,
exe_geo_city: Contracts.contract_execution_geo_city,
floor_area: Contracts.contract_floor_area,
firm_tranche: Contracts.contract_firm_tranche,
housing_code: Contracts.contract_housing_count,
mandatory_site_visit: Contracts.contract_mandatory_site_visit,
notice_first_post: Contracts.contract_notice_first_publication,
object: Contracts.contract_object,
post: Contracts.contract_posting,
progress: Contracts.contract_progress,
response: Contracts.contract_response,
social_criteria: Contracts.contract_social_criteria,
state_intitule: Contracts.contract_state_intitule,
time_frame_duration_type: Contracts.contract_time_frame_duration_type,
time_frame_end: Contracts.contract_time_frame_end,
time_frame_start: Contracts.contract_time_frame_start,
contract_with_parts: Contracts.contract_with_parts,
contract_with_variant: Contracts.contract_with_variant,
type: Contracts.TYPE,
CPV_main_code_court: Contracts.contract_CPV_main_code_court,
intitule_CPV_court: Contracts.contract_intitule_CPV_court,
estimated_amount_single_value: Contracts.contract_estimated_amount_single_value
})


LOAD CSV WITH HEADERS FROM 'file:///AttribFP18.csv' AS AttributairesFP
CREATE (at:Attributaires {
id: AttributairesFP.beneficiary_SIREN,
name: AttributairesFP.NAME_beneficiary,
city: AttributairesFP.beneficiary_city,
dep_code : AttributairesFP.beneficiary_department_code,
insee_code: AttributairesFP.beneficiary_insee_code,
awarded_amount_single_value : AttributairesFP.beneficiary_awarded_amount_single_value
})

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

After that , I wanted to apply one query that it worked before but now it displays (no changes,no records) even when I changed values , here is my query :

match (n1:Attributaires)-[r]-()
with n1.clusterId as clusterId, count(n1) as clusterSize,count(distinct r) as numberOfRels
where clusterSize > 10 AND  numberOfRels > 10
match (n2) where n2.clusterId = clusterId
return n2,clusterId

Anyone could help me with that please ? 🙂

1 ACCEPTED SOLUTION

I fixed it ! I have just to run this query before running the last one to show clusters :

CALL algo.unionFind(
'match (n) return id(n) as id',
'match (n1:Person)--(n2) return id(n1) as source, id(n2) as target',
{graph:'cypher', write:true, partitionProperty:"clusterId"})
YIELD nodes, setCount, loadMillis, computeMillis, writeMillis;

View solution in original post

1 REPLY 1

I fixed it ! I have just to run this query before running the last one to show clusters :

CALL algo.unionFind(
'match (n) return id(n) as id',
'match (n1:Person)--(n2) return id(n1) as source, id(n2) as target',
{graph:'cypher', write:true, partitionProperty:"clusterId"})
YIELD nodes, setCount, loadMillis, computeMillis, writeMillis;