基於目標羣體的潛在人物挖掘
一、目標羣體中存在潛在關係的人物挖掘
目標:通過對當前多個節點的標籤、關係、屬性的分析,從社交圖譜中挖掘與目標羣體關係緊密的潛在人物。
1、遍歷路徑拿到與目標人羣有關聯的所有人
2、計算潛在人與目標羣體關係緊密度得分,並將得分更新到屬性
3、使用targetGroupPersonDiggerRelaCount屬性排序(通過潛在人與目標人羣的關係緊密度SCORE排行)
4、過濾得分最高的前N個人
5、輸出過濾的N個人與目標羣體的關係路徑
二、案例測試
1、目標羣體
MATCH (n) WHERE id(n) IN [0,32,33,52] RETURN n
2、目標羣體潛在關係人物挖掘
WITH [0,32,33,52] AS groupIds
MATCH p=(source)--(target) WHERE id(source) IN groupIds AND
zdr.apoc.relatCalculateRestrict(labels(target),labels(target),'Linkedin||Twitter||Facebook||人物')
WITH zdr.apoc.removeIdsFromRawList(collect(id(target)),groupIds) AS targetIds,groupIds AS sourceIds
UNWIND targetIds AS targetId
UNWIND sourceIds AS sourceId
MATCH (sou),(tar) WHERE id(sou)=sourceId AND id(tar)=targetId
MATCH path=(sou)--(tar) WITH collect(id(sou)) AS sourceList,collect(id(tar)) AS targetList
CALL zdr.apoc.publicFriendAnalysisMap(sourceList,targetList) YIELD list WITH list,targetList,sourceList
UNWIND list AS row
MATCH (n) WHERE id(n)=row.id AND id(n) IN targetList SET n.targetGroupPersonDiggerRelaCount=row.count
WITH n,sourceList ORDER BY n.targetGroupPersonDiggerRelaCount DESC SKIP 0 LIMIT 2
MATCH p=(n)--(m) WHERE id(m) IN sourceList RETURN p