{"id":90560,"date":"2026-08-05T14:41:41","date_gmt":"2026-08-05T06:41:41","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/90560.html"},"modified":"2026-08-05T14:41:41","modified_gmt":"2026-08-05T06:41:41","slug":"jgrapht-%e9%80%89%e5%9e%8b%e5%ae%9e%e5%bd%95%ef%bc%9a%e4%b8%ba%e4%bb%80%e4%b9%88%e4%b8%8d%e7%94%a8-sql%ef%bc%8c%e4%b9%9f%e4%b8%8d%e7%94%a8-neo4j","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/90560.html","title":{"rendered":"JGraphT \u9009\u578b\u5b9e\u5f55\uff1a\u4e3a\u4ec0\u4e48\u4e0d\u7528 SQL\uff0c\u4e5f\u4e0d\u7528 Neo4j"},"content":{"rendered":"<p>\u9879\u76ee\u91cc\u6709\u4e2a CRM \u5ba2\u6237\u7ba1\u7406\u52a9\u624b&#xff0c;\u5176\u4e2d\u89c4\u5219\u4e94&#xff08;\u5173\u7cfb\u94fe\u6316\u6398&#xff09;\u9700\u8981\u5904\u7406\u8282\u70b9\u95f4\u7684\u5173\u7cfb\u904d\u5386\u3002\u9009\u578b\u65f6\u7ecf\u5386\u4e86\u4e09\u8f6e\u601d\u8003&#xff1a;SQL \u80fd\u4e0d\u80fd\u641e\u5b9a&#xff1f;\u8981\u4e0d\u8981\u4e0a Neo4j&#xff1f;\u6700\u7ec8\u4e3a\u4ec0\u4e48\u9009\u4e86 JGraphT&#xff1f;\u8bb0\u5f55\u4e00\u4e0b\u5b8c\u6574\u7684\u51b3\u7b56\u8fc7\u7a0b\u3002<\/p>\n<h3>\u9879\u76ee\u80cc\u666f<\/h3>\n<p>CRM \u52a9\u624b\u662f\u4e00\u4e2a Java \u540e\u7aef\u670d\u52a1&#xff08;Spring Boot&#xff09;&#xff0c;\u6709\u4e00\u5957\u89c4\u5219\u5f15\u64ce\u5904\u7406\u5404\u79cd\u4e1a\u52a1\u89c4\u5219\u3002\u5176\u4e2d\u89c4\u5219\u4e94\u662f&#034;\u5173\u7cfb\u94fe\u6316\u6398&#034;&#xff1a;\u7ed9\u5b9a\u4e00\u4e2a\u5173\u952e\u4eba&#xff0c;\u6cbf\u6307\u5b9a\u5173\u7cfb\u7c7b\u578b&#xff08;\u540c\u4e8b\u3001\u540c\u53f8\u3001\u62dc\u8bbf&#xff09;\u67e5\u627e\u5173\u8054\u4eba&#xff0c;\u7528\u4e8e\u63a8\u8350\u5f15\u8350\u8def\u5f84\u3002<\/p>\n<p>\u56fe\u7ed3\u6784\u5f88\u7b80\u5355&#xff1a;<\/p>\n<ul>\n<li>\u8282\u70b9&#xff1a;\u5ba2\u6237\u3001\u8054\u7cfb\u4eba<\/li>\n<li>\u8fb9&#xff1a;\u96b6\u5c5e\u4e8e\u3001\u540c\u4e8b\u3001\u540c\u53f8\u3001\u62dc\u8bbf\u8bb0\u5f55<\/li>\n<li>\u6570\u636e\u6765\u6e90&#xff1a;\u5168\u90e8\u6765\u81ea CRM \u81ea\u6709\u7684 MySQL \u8868<\/li>\n<\/ul>\n<p>\u89c4\u5219\u4e94\u7684\u67e5\u8be2\u672c\u8d28\u662f\u5e26\u6761\u4ef6\u7684\u53d7\u9650\u5c40\u90e8\u904d\u5386&#xff1a;\u4ece\u5173\u952e\u4eba\u51fa\u53d1&#xff0c;\u6cbf\u6307\u5b9a\u8fb9\u7c7b\u578b\u8d70\u4e00\u8df3\u4f18\u5148\u3001\u4e8c\u8df3\u515c\u5e95&#xff0c;\u547d\u4e2d\u5373\u505c&#xff0c;\u8fd8\u8981\u8fc7\u6ee4\u79bb\u804c\u3001\u62dc\u8bbf\u8d85\u65f6\u7b49\u6761\u4ef6\u3002<\/p>\n<h3>\u7b2c\u4e00\u8f6e&#xff1a;SQL \u80fd\u4e0d\u80fd\u641e\u5b9a&#xff1f;<\/h3>\n<p>\u5148\u60f3\u7684\u662f\u6700\u76f4\u63a5\u7684\u65b9\u6848&#xff1a;SQL \u67e5\u3002<\/p>\n<h4>\u4e00\u8df3&#xff1a;\u52c9\u5f3a\u80fd\u505a<\/h4>\n<p>\u4e00\u8df3\u67e5\u8be2&#xff08;\u627e\u540c\u90e8\u95e8\u540c\u4e8b\u4e2d\u6709\u62dc\u8bbf\u8bb0\u5f55\u7684\u4eba&#xff09;\u7528 JOIN \u5c31\u80fd\u505a&#xff1a;<\/p>\n<p><span class=\"token keyword\">SELECT<\/span> <span class=\"token keyword\">DISTINCT<\/span> c2<span class=\"token punctuation\">.<\/span>person_id<br \/>\n<span class=\"token keyword\">FROM<\/span> colleague_relation c1<br \/>\n<span class=\"token keyword\">JOIN<\/span> colleague_relation c2 <span class=\"token keyword\">ON<\/span> c1<span class=\"token punctuation\">.<\/span>dept_id <span class=\"token operator\">&#061;<\/span> c2<span class=\"token punctuation\">.<\/span>dept_id<br \/>\n<span class=\"token keyword\">JOIN<\/span> visit_record v <span class=\"token keyword\">ON<\/span> v<span class=\"token punctuation\">.<\/span>visitor_id <span class=\"token operator\">&#061;<\/span> c2<span class=\"token punctuation\">.<\/span>person_id<br \/>\n<span class=\"token keyword\">WHERE<\/span> c1<span class=\"token punctuation\">.<\/span>person_id <span class=\"token operator\">&#061;<\/span> ? <span class=\"token operator\">AND<\/span> v<span class=\"token punctuation\">.<\/span>client_id <span class=\"token operator\">&#061;<\/span> ?<\/p>\n<p>\u80fd\u505a&#xff0c;\u4f46\u6ca1\u6709\u4efb\u4f55\u4f18\u52bf\u2014\u2014\u56fe\u67e5\u8be2\u5c31\u662f\u4e00\u884c neighborListOf\u3002<\/p>\n<h4>\u4e8c\u8df3&#xff1a;\u5f00\u59cb\u5931\u63a7<\/h4>\n<p>\u4e8c\u8df3&#xff08;\u540c\u4e8b\u7684\u540c\u4e8b\u3001\u8de8\u90e8\u95e8\u5173\u7cfb&#xff09;\u8981\u4e0a\u9012\u5f52 CTE&#xff1a;<\/p>\n<p><span class=\"token keyword\">WITH<\/span> RECURSIVE colleague_chain <span class=\"token keyword\">AS<\/span> <span class=\"token punctuation\">(<\/span><br \/>\n    <span class=\"token keyword\">SELECT<\/span> person_id<span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span> <span class=\"token keyword\">AS<\/span> depth<br \/>\n    <span class=\"token keyword\">FROM<\/span> colleague_relation<br \/>\n    <span class=\"token keyword\">WHERE<\/span> person_id <span class=\"token operator\">&#061;<\/span> ?<br \/>\n    <span class=\"token keyword\">UNION<\/span> <span class=\"token keyword\">ALL<\/span><br \/>\n    <span class=\"token keyword\">SELECT<\/span> c<span class=\"token punctuation\">.<\/span>person_id<span class=\"token punctuation\">,<\/span> cc<span class=\"token punctuation\">.<\/span>depth <span class=\"token operator\">&#043;<\/span> <span class=\"token number\">1<\/span><br \/>\n    <span class=\"token keyword\">FROM<\/span> colleague_relation c<br \/>\n    <span class=\"token keyword\">JOIN<\/span> colleague_chain cc <span class=\"token keyword\">ON<\/span> c<span class=\"token punctuation\">.<\/span>dept_id <span class=\"token operator\">&#061;<\/span> cc<span class=\"token punctuation\">.<\/span>person_id<br \/>\n    <span class=\"token keyword\">WHERE<\/span> cc<span class=\"token punctuation\">.<\/span>depth <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">2<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> <span class=\"token keyword\">DISTINCT<\/span> person_id <span class=\"token keyword\">FROM<\/span> colleague_chain<span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5199\u6cd5\u590d\u6742\u3001\u5bb9\u6613\u51fa\u9519&#xff0c;\u8fd8\u8981\u81ea\u5df1\u63a7\u5236\u5c42\u6570\u548c\u53bb\u91cd\u3002\u8fd9\u662f&#034;\u56fe\u904d\u5386&#034;\u7684\u6d3b&#xff0c;\u786c\u585e\u7ed9 SQL \u662f\u62ff\u5173\u7cfb\u4ee3\u6570\u6a21\u62df\u56fe\u7b97\u6cd5\u3002<\/p>\n<h4>\u6700\u77ed\u8def\u5f84 &#043; \u547d\u4e2d\u5373\u7ec8\u6b62&#xff1a;SQL \u7684\u6b7b\u7a74<\/h4>\n<p>\u89c4\u5219\u4e94\u8981\u7684\u662f&#034;\u8df3\u6570\u6700\u5c11\u7684\u5f15\u8350\u94fe&#xff0c;\u547d\u4e2d\u5373\u505c&#034;\u3002BFS \u5929\u7136\u6309\u8df3\u6570\u9012\u589e\u6269\u5c55&#xff0c;\u7b2c\u4e00\u6b21\u547d\u4e2d\u5c31\u662f\u6700\u77ed\u8def\u5f84&#xff0c;\u904d\u5386\u5668\u81ea\u5e26\u7ec8\u6b62\u3002<\/p>\n<p>SQL \u8981\u8868\u8fbe&#034;\u53d6\u5230\u6700\u4f18\u5c31\u505c&#034;\u5f97\u5199\u5b58\u50a8\u8fc7\u7a0b\u6216\u590d\u6742\u9012\u5f52&#xff0c;\u6700\u77ed\u8def\u5f84\u8fd8\u8981\u81ea\u5df1\u505a\u56de\u6eaf\u2014\u2014\u6781\u96be\u7ef4\u62a4&#xff0c;\u4e14\u6bcf\u6b21\u626b\u63cf\u90fd\u8981\u91cd\u5199\u67e5\u8be2\u3002<\/p>\n<h4>\u8fb9\u7c7b\u578b\u53e0\u52a0&#xff1a;\u67e5\u8be2\u7206\u70b8<\/h4>\n<p>\u56fe\u91cc\u6709\u56db\u7c7b\u8fb9&#xff1a;\u96b6\u5c5e\u3001\u540c\u4e8b\u3001\u540c\u53f8\u3001\u62dc\u8bbf\u3002\u904d\u5386\u65f6\u8fd8\u8981\u8fc7\u6ee4&#034;\u53ea\u8d70\u540c\u4e8b\u548c\u540c\u53f8\u8fb9&#034;\u201c\u6392\u9664\u79bb\u804c\u201d\u201c\u62dc\u8bbf\u8d85\u65f6\u8fc7\u6ee4\u201d\u3002\u5173\u7cfb\u6bcf\u591a\u4e00\u79cd&#xff0c;JOIN \u6761\u4ef6\u5c31\u6210\u500d\u53e0\u52a0&#xff0c;\u8c13\u8bcd\u4e00\u591a\u67e5\u8be2\u5c31&#034;\u7206\u70b8&#034;\u3002<\/p>\n<h4>\u6839\u672c\u95ee\u9898&#xff1a;\u67e5\u8be2\u903b\u8f91\u4e0e\u5b58\u50a8\u6b7b\u7ed1<\/h4>\n<p>JGraphT \u628a\u56fe\u904d\u5386&#xff08;BFS\/\u6700\u77ed\u8def\u5f84&#xff09;\u4f5c\u4e3a\u5185\u5b58\u4e2d\u7684\u539f\u5730\u64cd\u4f5c&#xff0c;\u56fe\u7ed3\u6784\u600e\u4e48\u53d8\u3001\u89c4\u5219\u600e\u4e48\u6539&#xff0c;\u4e0d\u78b0\u5b58\u50a8\u5c42\u3002SQL \u5219\u662f\u628a\u56fe\u903b\u8f91\u786c\u7f16\u7801\u8fdb\u67e5\u8be2\u8bed\u53e5&#xff0c;\u56fe\u6a21\u578b\u4e00\u53d8\u5c31\u8981\u6539 SQL\u3001\u6539\u7d22\u5f15&#xff0c;\u626b\u63cf\u903b\u8f91\u548c\u8868\u7ed3\u6784\u6b7b\u6b7b\u7ed1\u5728\u4e00\u8d77\u3002<\/p>\n<p>\u8fd8\u6709\u4e00\u4e2a\u9690\u60a3&#xff1a;MySQL \u7684\u9012\u5f52 CTE \u5bf9&#034;\u5c42\u6570\u4e0a\u9650&#034;\u7684\u63a7\u5236\u662f&#034;\u9010\u5c42 UNION ALL \u76f4\u5230\u4e0d\u4ea7\u751f\u65b0\u884c&#034;\u3002\u5199 2 \u8df3\u8fd8\u52c9\u5f3a\u80fd\u770b&#xff0c;\u4e00\u65e6\u672a\u6765\u8981\u6269\u5230 3 \u8df3\u30014 \u8df3&#xff0c;CTE \u7684\u5c42\u6570\u6269\u5c55\u548c\u8def\u5f84\u56de\u6eaf\u590d\u6742\u5ea6\u4f1a\u6307\u6570\u7ea7\u6076\u5316\u3002\u800c JGraphT \u91cc MAX_DEPTH \u5c31\u662f\u4e2a\u5e38\u91cf&#xff0c;\u6539\u4e00\u884c\u5b8c\u4e8b\u3002<\/p>\n<p>\u7ed3\u8bba&#xff1a;\u4e00\u8df3\u52c9\u5f3a\u53ef\u505a\u4f46\u6ca1\u4f18\u52bf&#xff1b;\u4e00\u65e6\u6d89\u53ca\u4e8c\u8df3\u3001\u8def\u5f84\u56de\u6eaf\u3001\u8fb9\u7c7b\u578b\u53e0\u52a0&#xff0c;\u9012\u5f52 CTE \u590d\u6742\u6613\u9519\u3001\u6027\u80fd\u968f\u8df3\u6570\u6076\u5316\u3002\u4e0d\u662f SQL \u4e0d\u884c&#xff0c;\u662f\u8fd9\u4e2a\u67e5\u8be2\u672c\u8d28\u4e0a\u662f\u56fe\u95ee\u9898&#xff0c;SQL \u8868\u8fbe\u4e0d\u4e86\u5b83\u7684&#034;\u904d\u5386\u8bed\u4e49&#034;\u3002<\/p>\n<h3>\u7b2c\u4e8c\u8f6e&#xff1a;\u8981\u4e0d\u8981\u4e0a Neo4j&#xff1f;<\/h3>\n<p>SQL \u4e0d\u884c&#xff0c;\u90a3\u4e0a\u56fe\u6570\u636e\u5e93&#xff1f;\u8003\u8651\u4e86 Neo4j&#xff0c;\u6700\u7ec8\u8fd8\u662f\u6ca1\u9009\u3002<\/p>\n<h4>1. \u89c4\u6a21\u6839\u672c\u4e0d\u5339\u914d<\/h4>\n<p>\u56fe\u8c31\u53ea\u6709\u4e24\u7c7b\u8282\u70b9&#xff08;\u5ba2\u6237 &#043; \u8054\u7cfb\u4eba&#xff09;&#xff0c;\u8fb9\u6570\u7ea6\u4e3a\u8054\u7cfb\u4eba\u6570\u7684 2~4 \u500d\u3002\u7eaf\u5185\u5b58\u5efa\u56fe\u6beb\u79d2\u7ea7\u5b8c\u6210&#xff0c;\u6bcf\u5468\u626b\u63cf\u524d rebuild \u4e00\u6b21\u5373\u53ef\u3002\u8fd9\u4e2a\u91cf\u7ea7\u4e0b&#xff0c;Neo4j \u7684\u6301\u4e45\u5316\u3001\u7d22\u5f15\u3001\u96c6\u7fa4\u80fd\u529b\u5168\u90fd\u7528\u4e0d\u4e0a\u3002<\/p>\n<p>\u9879\u76ee\u6587\u6863\u660e\u786e\u5199\u4e86\u5347\u7ea7\u6761\u4ef6&#xff1a;\u5ba2\u6237\u91cf\u8d85\u8fc7 10 \u4e07\u65f6\u518d\u8003\u8651 Neo4j\u3002\u5f53\u524d\u91cf\u7ea7\u8fdc\u6ca1\u5230\u90a3\u4e00\u6b65\u3002<\/p>\n<h4>2. \u67e5\u8be2\u590d\u6742\u5ea6\u7528\u4e0d\u4e0a\u56fe\u6570\u636e\u5e93<\/h4>\n<p>\u89c4\u5219\u4e94\u672c\u8d28\u662f\u5e26\u6761\u4ef6\u7684\u53d7\u9650\u5c40\u90e8\u904d\u5386&#xff1a;\u4e00\u8df3\u4f18\u5148\u3001\u4e8c\u8df3\u515c\u5e95\u3001\u547d\u4e2d\u5373\u505c\u3002JGraphT \u7684 BreadthFirstIterator \/ Graphs.neighborListOf \/ \u8fb9\u7c7b\u578b\u8fc7\u6ee4\u539f\u5730\u5c31\u80fd\u505a&#xff0c;\u8fd8\u5929\u7136\u652f\u6301&#034;\u6700\u77ed\u8def\u5f84\u3001\u547d\u4e2d\u5373\u7ec8\u6b62&#034;\u3002<\/p>\n<p>Neo4j \u7684\u4f18\u52bf\u573a\u666f\u662f\u5168\u56fe\u591a\u8df3\u5206\u6790&#xff08;\u5982\u5168\u94fe\u8def\u5f15\u8350\u63a8\u8350&#xff09;&#xff0c;\u5728\u8fd9\u91cc\u5c5e\u4e8e\u6740\u9e21\u7528\u725b\u5200\u3002<\/p>\n<h4>3. \u90e8\u7f72\u8fd0\u7ef4\u6210\u672c<\/h4>\n<p>JGraphT \u662f\u7eaf Java \u5e93&#xff0c;\u4e00\u4e2a Maven \u4f9d\u8d56&#xff0c;\u968f\u5e94\u7528\u4e00\u8d77\u8dd1&#xff0c;\u96f6\u989d\u5916\u4f9d\u8d56\u3001\u65e0\u989d\u5916\u8fdb\u7a0b\u3001\u65e0\u7aef\u53e3\u3001\u65e0\u5907\u4efd\u3001\u65e0\u76d1\u63a7\u3002<\/p>\n<p>Neo4j \u662f\u72ec\u7acb\u6570\u636e\u5e93\u670d\u52a1&#xff1a;\u9700\u8981\u4e0b\u8f7d\u5b89\u88c5\u3001\u914d\u7f6e\u3001\u5f00\u7aef\u53e3\u3001License \u6388\u6743\u3001\u5907\u4efd\u7b56\u7565\u3001\u76d1\u63a7\u544a\u8b66\u3001\u7248\u672c\u5347\u7ea7\u3002\u5bf9\u6bcf\u5468\u53ea\u8dd1\u4e00\u6b21\u7684\u5b9a\u65f6\u4efb\u52a1\u6765\u8bf4&#xff0c;\u8fd9\u4e2a\u8fd0\u7ef4\u6210\u672c\u662f\u7eaf\u6d6a\u8d39\u3002<\/p>\n<h4>4. \u53cc\u5199\u540c\u6b65\u95ee\u9898<\/h4>\n<p>\u6240\u6709\u5173\u7cfb\u6570\u636e\u90fd\u6765\u81ea CRM \u81ea\u6709\u7684 MySQL \u8868\u3002\u5982\u679c\u7528 Neo4j&#xff0c;\u9700\u8981\u7ef4\u62a4\u4e00\u4efd\u4e0e MySQL \u540c\u6b65\u7684\u56fe\u526f\u672c\u2014\u2014\u5f15\u5165\u53cc\u5199\u6216 ETL \u540c\u6b65&#xff0c;\u589e\u52a0\u4e00\u81f4\u6027\u95ee\u9898\u3002\u6570\u636e\u53d8\u66f4\u65f6\u8fd8\u5f97\u62c5\u5fc3\u4e24\u8fb9\u6570\u636e\u662f\u5426\u5bf9\u9f50\u3002<\/p>\n<p>\u7528 JGraphT&#xff1a;\u6bcf\u6b21\u4ece\u6e90\u5934\u91cd\u5efa&#xff0c;\u5929\u7136\u4e00\u81f4\u3002\u6ca1\u6709\u540c\u6b65\u5c31\u6ca1\u6709\u4e0d\u4e00\u81f4\u3002<\/p>\n<h3>\u7b2c\u4e09\u8f6e&#xff1a;JGraphT \u5b9e\u73b0<\/h3>\n<p>\u6838\u5fc3\u4ee3\u7801\u5206\u4e24\u90e8\u5206&#xff1a;\u56fe\u6784\u5efa\u548c\u56fe\u67e5\u8be2\u3002<\/p>\n<h4>\u56fe\u6784\u5efa<\/h4>\n<p>\u6bcf\u5468\u5b9a\u65f6\u4efb\u52a1\u524d\u4ece\u6570\u636e\u5e93\u91cd\u5efa\u56fe&#xff0c;\u903b\u8f91\u5c01\u88c5\u5728 KnowledgeGraphBuilder \u91cc&#xff1a;<\/p>\n<p><span class=\"token keyword\">public<\/span> <span class=\"token class-name\">Graph<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">RelationshipEdge<\/span><span class=\"token punctuation\">&gt;<\/span><\/span> <span class=\"token function\">build<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token class-name\">Graph<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">RelationshipEdge<\/span><span class=\"token punctuation\">&gt;<\/span><\/span> graph <span class=\"token operator\">&#061;<\/span><br \/>\n        <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">DefaultDirectedGraph<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">RelationshipEdge<\/span><span class=\"token punctuation\">.<\/span><span class=\"token keyword\">class<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u6dfb\u52a0\u8282\u70b9&#xff1a;\u5ba2\u6237\u3001\u8054\u7cfb\u4eba<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Contact<\/span> contact <span class=\"token operator\">:<\/span> contactDao<span class=\"token punctuation\">.<\/span><span class=\"token function\">findAll<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        graph<span class=\"token punctuation\">.<\/span><span class=\"token function\">addVertex<\/span><span class=\"token punctuation\">(<\/span>contact<span class=\"token punctuation\">.<\/span><span class=\"token function\">getId<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u6dfb\u52a0\u8fb9&#xff1a;\u540c\u4e8b\u5173\u7cfb<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">ColleagueRelation<\/span> rel <span class=\"token operator\">:<\/span> colleagueDao<span class=\"token punctuation\">.<\/span><span class=\"token function\">findAll<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        graph<span class=\"token punctuation\">.<\/span><span class=\"token function\">addEdge<\/span><span class=\"token punctuation\">(<\/span>rel<span class=\"token punctuation\">.<\/span><span class=\"token function\">getPersonA<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> rel<span class=\"token punctuation\">.<\/span><span class=\"token function\">getPersonB<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">RelationshipEdge<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">RelationType<\/span><span class=\"token punctuation\">.<\/span><span class=\"token constant\">COLLEAGUE<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u6dfb\u52a0\u8fb9&#xff1a;\u540c\u53f8\u5173\u7cfb<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">CompanyRelation<\/span> rel <span class=\"token operator\">:<\/span> companyDao<span class=\"token punctuation\">.<\/span><span class=\"token function\">findAll<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        graph<span class=\"token punctuation\">.<\/span><span class=\"token function\">addEdge<\/span><span class=\"token punctuation\">(<\/span>rel<span class=\"token punctuation\">.<\/span><span class=\"token function\">getPersonA<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> rel<span class=\"token punctuation\">.<\/span><span class=\"token function\">getPersonB<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">RelationshipEdge<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">RelationType<\/span><span class=\"token punctuation\">.<\/span><span class=\"token constant\">SAME_COMPANY<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u6dfb\u52a0\u8fb9&#xff1a;\u62dc\u8bbf\u8bb0\u5f55<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">VisitRecord<\/span> record <span class=\"token operator\">:<\/span> visitDao<span class=\"token punctuation\">.<\/span><span class=\"token function\">findAll<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        graph<span class=\"token punctuation\">.<\/span><span class=\"token function\">addEdge<\/span><span class=\"token punctuation\">(<\/span>record<span class=\"token punctuation\">.<\/span><span class=\"token function\">getVisitorId<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> record<span class=\"token punctuation\">.<\/span><span class=\"token function\">getClientId<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">RelationshipEdge<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">RelationType<\/span><span class=\"token punctuation\">.<\/span><span class=\"token constant\">VISITED<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token keyword\">return<\/span> graph<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h4>\u89c4\u5219\u4e94&#xff1a;\u5e26\u6761\u4ef6\u7684\u53d7\u9650 BFS<\/h4>\n<p>\u67e5\u8be2\u903b\u8f91\u5728 KnowledgeGraphService \u4e2d&#xff0c;\u6838\u5fc3\u65b9\u6cd5\u662f\u5e26\u6761\u4ef6\u7684\u53d7\u9650 BFS&#xff1a;<\/p>\n<p><span class=\"token comment\">\/**<br \/>\n * \u89c4\u5219\u4e94&#xff1a;\u5173\u7cfb\u94fe\u6316\u6398<br \/>\n * \u4ece\u5173\u952e\u4eba\u51fa\u53d1&#xff0c;\u6cbf\u6307\u5b9a\u8fb9\u7c7b\u578b\u505a\u53d7\u9650 BFS&#xff0c;\u547d\u4e2d\u5373\u505c<br \/>\n *\/<\/span><br \/>\n<span class=\"token keyword\">public<\/span> <span class=\"token class-name\">List<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">&gt;<\/span><\/span> <span class=\"token function\">findRelationChain<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span> keyPerson<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">String<\/span> targetClientId<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token constant\">MAX_DEPTH<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u4e00\u8df3\u4f18\u5148&#xff0c;\u4e8c\u8df3\u515c\u5e95<\/span><\/p>\n<p>    <span class=\"token class-name\">Queue<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">&gt;<\/span><\/span> queue <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">LinkedList<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token class-name\">Map<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">Integer<\/span><span class=\"token punctuation\">&gt;<\/span><\/span> depthMap <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">HashMap<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    queue<span class=\"token punctuation\">.<\/span><span class=\"token function\">offer<\/span><span class=\"token punctuation\">(<\/span>keyPerson<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    depthMap<span class=\"token punctuation\">.<\/span><span class=\"token function\">put<\/span><span class=\"token punctuation\">(<\/span>keyPerson<span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>queue<span class=\"token punctuation\">.<\/span><span class=\"token function\">isEmpty<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token class-name\">String<\/span> current <span class=\"token operator\">&#061;<\/span> queue<span class=\"token punctuation\">.<\/span><span class=\"token function\">poll<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">int<\/span> depth <span class=\"token operator\">&#061;<\/span> depthMap<span class=\"token punctuation\">.<\/span><span class=\"token function\">get<\/span><span class=\"token punctuation\">(<\/span>current<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token comment\">\/\/ \u547d\u4e2d\u5373\u505c&#xff1a;\u5f53\u524d\u8282\u70b9\u62dc\u8bbf\u8fc7\u76ee\u6807\u5ba2\u6237<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>current<span class=\"token punctuation\">.<\/span><span class=\"token function\">equals<\/span><span class=\"token punctuation\">(<\/span>keyPerson<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">hasVisited<\/span><span class=\"token punctuation\">(<\/span>current<span class=\"token punctuation\">,<\/span> targetClientId<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">return<\/span> <span class=\"token function\">buildChain<\/span><span class=\"token punctuation\">(<\/span>keyPerson<span class=\"token punctuation\">,<\/span> current<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p>        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>depth <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token constant\">MAX_DEPTH<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">continue<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token comment\">\/\/ \u6cbf\u6307\u5b9a\u8fb9\u7c7b\u578b\u6269\u5c55&#xff08;\u53ea\u8d70\u540c\u4e8b\u3001\u540c\u53f8\u8fb9&#xff09;<\/span><br \/>\n        <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">RelationshipEdge<\/span> edge <span class=\"token operator\">:<\/span> graph<span class=\"token punctuation\">.<\/span><span class=\"token function\">edgesOf<\/span><span class=\"token punctuation\">(<\/span>current<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>edge<span class=\"token punctuation\">.<\/span><span class=\"token function\">getType<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token class-name\">RelationType<\/span><span class=\"token punctuation\">.<\/span><span class=\"token constant\">COLLEAGUE<\/span><br \/>\n                <span class=\"token operator\">||<\/span> edge<span class=\"token punctuation\">.<\/span><span class=\"token function\">getType<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token class-name\">RelationType<\/span><span class=\"token punctuation\">.<\/span><span class=\"token constant\">SAME_COMPANY<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                <span class=\"token class-name\">String<\/span> neighbor <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">Graphs<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">getOppositeVertex<\/span><span class=\"token punctuation\">(<\/span>graph<span class=\"token punctuation\">,<\/span> edge<span class=\"token punctuation\">,<\/span> current<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>depthMap<span class=\"token punctuation\">.<\/span><span class=\"token function\">containsKey<\/span><span class=\"token punctuation\">(<\/span>neighbor<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                    depthMap<span class=\"token punctuation\">.<\/span><span class=\"token function\">put<\/span><span class=\"token punctuation\">(<\/span>neighbor<span class=\"token punctuation\">,<\/span> depth <span class=\"token operator\">&#043;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                    queue<span class=\"token punctuation\">.<\/span><span class=\"token function\">offer<\/span><span class=\"token punctuation\">(<\/span>neighbor<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                <span class=\"token punctuation\">}<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token class-name\">Collections<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">emptyList<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u6838\u5fc3\u5c31\u8fd9\u51e0\u884c&#xff1a;BFS \u6309\u8df3\u6570\u9012\u589e\u6269\u5c55\u3001\u8fb9\u7c7b\u578b\u8fc7\u6ee4\u3001\u547d\u4e2d\u5373\u7ec8\u6b62\u3002MAX_DEPTH \u6539\u4e00\u884c\u5c31\u80fd\u8c03\u5c42\u6570&#xff0c;\u4e0d\u7528\u91cd\u5199\u67e5\u8be2\u3001\u4e0d\u7528\u6539\u7d22\u5f15\u3002<\/p>\n<p>\u4e5f\u53ef\u4ee5\u7528 JGraphT \u81ea\u5e26\u7684 BreadthFirstIterator \u66f4\u7b80\u6d01&#xff0c;\u9879\u76ee\u91cc\u56e0\u4e3a\u8981\u63a7\u5236\u8fb9\u7c7b\u578b\u548c\u547d\u4e2d\u7ec8\u6b62\u6761\u4ef6&#xff0c;\u624b\u52a8\u5199 BFS \u66f4\u7075\u6d3b\u3002\u5bf9\u4e0a\u5c42\u8c03\u5ea6\u5668\u6765\u8bf4&#xff0c;\u56fe\u8ba1\u7b97\u6a21\u5757\u5c31\u662f\u4e00\u4e2a\u666e\u901a\u7684 Java \u670d\u52a1&#xff0c;\u611f\u77e5\u4e0d\u5230 JGraphT \u7684\u5b58\u5728\u3002<\/p>\n<h3>\u4ec0\u4e48\u65f6\u5019\u8be5\u6362&#xff1f;<\/h3>\n<p>\u9009 JGraphT \u4e0d\u662f&#034;\u6c38\u8fdc\u4e0d\u7528 Neo4j&#034;&#xff0c;\u800c\u662f&#034;\u5f53\u524d\u4e0d\u8be5\u7528&#034;\u3002\u9879\u76ee\u6587\u6863\u753b\u4e86\u660e\u786e\u7684\u5347\u7ea7\u8fb9\u754c&#xff0c;\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\u65f6\u518d\u8bc4\u4f30&#xff1a;<\/p>\n<ul>\n<li>\u5ba2\u6237\u91cf\u8d85\u8fc7 10 \u4e07&#xff0c;\u5185\u5b58\u5efa\u56fe\u625b\u4e0d\u4f4f<\/li>\n<li>\u9700\u8981\u5168\u56fe\u591a\u8df3\u5206\u6790&#xff08;\u5982\u5168\u94fe\u8def\u5f15\u8350\u63a8\u8350&#xff09;&#xff0c;\u4e0d\u518d\u662f\u5c40\u90e8\u904d\u5386<\/li>\n<li>\u5173\u7cfb\u6570\u636e\u4e0d\u518d\u5168\u90e8\u6765\u81ea CRM \u81ea\u6709\u8868&#xff0c;\u9700\u8981\u591a\u6e90\u56fe\u5b58\u50a8<\/li>\n<li>\u67e5\u8be2\u9891\u7387\u53d8\u9ad8&#xff08;\u4ece\u6bcf\u5468\u4e00\u6b21\u53d8\u6210\u5b9e\u65f6\u67e5\u8be2&#xff09;<\/li>\n<\/ul>\n<p>\u56fe\u6784\u5efa\u903b\u8f91\u5c01\u88c5\u5728 KnowledgeGraphBuilder \u91cc&#xff0c;\u67e5\u8be2\u903b\u8f91\u5728 KnowledgeGraphService \u4e2d\u3002\u5c06\u6765\u771f\u8981\u6362 Neo4j&#xff0c;\u53ea\u9700\u6539\u8fd9\u4e24\u4e2a\u7c7b&#xff0c;\u5bf9\u4e0a\u5c42\u8c03\u5ea6\u5668\u5b8c\u5168\u900f\u660e&#xff0c;\u8fc1\u79fb\u6210\u672c\u53ef\u63a7\u3002<\/p>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u6574\u4e2a\u9009\u578b\u8fc7\u7a0b\u5176\u5b9e\u5c31\u4e09\u4e2a\u95ee\u9898&#xff1a;<\/p>\n<li>SQL \u80fd\u4e0d\u80fd\u505a&#xff1f; \u4e00\u8df3\u52c9\u5f3a&#xff0c;\u4e8c\u8df3\u5931\u63a7&#xff0c;\u6700\u77ed\u8def\u5f84\u548c\u8fb9\u7c7b\u578b\u53e0\u52a0\u662f SQL \u7684\u6b7b\u7a74\u3002\u67e5\u8be2\u672c\u8d28\u662f\u56fe\u904d\u5386&#xff0c;SQL \u8868\u8fbe\u4e0d\u4e86\u904d\u5386\u8bed\u4e49\u3002<\/li>\n<li>\u8981\u4e0d\u8981\u4e0a\u56fe\u6570\u636e\u5e93&#xff1f; \u6570\u636e\u91cf\u5c0f\u3001\u4e00\u8df3\u4e8c\u8df3\u5c40\u90e8\u904d\u5386\u3001\u6570\u636e\u6e90\u5355\u4e00\u2014\u2014Neo4j \u7684\u6301\u4e45\u5316\u3001\u7d22\u5f15\u3001\u96c6\u7fa4\u80fd\u529b\u5168\u662f\u8fc7\u5ea6\u8bbe\u8ba1\u3002<\/li>\n<li>JGraphT \u591f\u4e0d\u591f&#xff1f; \u7eaf Java \u5e93\u3001\u96f6\u8fd0\u7ef4\u3001BFS \u548c\u8fb9\u8fc7\u6ee4\u5f00\u7bb1\u5373\u7528\u3001MAX_DEPTH \u4e00\u884c\u8c03\u5c42\u6570\u3002\u6210\u672c\u6700\u4f4e&#xff0c;\u4e14\u5347\u7ea7\u8def\u5f84\u6e05\u6670\u3002<\/li>\n<p>\u9009\u578b\u7684\u5173\u952e\u4e0d\u662f\u9009&#034;\u66f4\u5f3a\u7684\u5de5\u5177&#034;&#xff0c;\u800c\u662f\u9009&#034;\u5bf9\u8def\u7684\u5de5\u5177&#034;\u3002SQL \u64c5\u957f\u96c6\u5408\u7b5b\u9009&#xff0c;Neo4j \u64c5\u957f\u5927\u89c4\u6a21\u56fe\u5b58\u50a8\u548c\u591a\u8df3\u67e5\u8be2&#xff0c;JGraphT \u64c5\u957f\u5185\u5b58\u4e2d\u7684\u56fe\u7b97\u6cd5\u8ba1\u7b97\u3002\u89c4\u5219\u4e94\u7684\u9700\u6c42\u843d\u5728\u6700\u540e\u4e00\u4e2a\u533a\u95f4&#xff0c;\u90a3\u5c31\u7528\u5b83\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9879\u76ee\u91cc\u6709\u4e2a CRM \u5ba2\u6237\u7ba1\u7406\u52a9\u624b&#xff0c;\u5176\u4e2d\u89c4\u5219\u4e94&#xff08;\u5173\u7cfb\u94fe\u6316\u6398&#xff09;\u9700\u8981\u5904\u7406\u8282\u70b9\u95f4\u7684\u5173\u7cfb\u904d\u5386\u3002\u9009\u578b\u65f6\u7ecf\u5386\u4e86\u4e09\u8f6e\u601d\u8003&#xff1a;SQL \u80fd\u4e0d\u80fd\u641e\u5b9a&#xff1f;\u8981\u4e0d\u8981\u4e0a Neo4j&#xff1f;\u6700\u7ec8\u4e3a\u4ec0\u4e48\u9009\u4e86 JGraphT&#xff1f;\u8bb0\u5f55\u4e00\u4e0b\u5b8c\u6574\u7684\u51b3\u7b56\u8fc7\u7a0b\u3002<br \/>\n\u9879\u76ee\u80cc\u666f<br \/>\nCRM \u52a9\u624b\u662f\u4e00\u4e2a Java \u540e\u7aef\u670d\u52a1&#xff08;Spring Boot&#xff09;&#xff0c;\u6709\u4e00\u5957\u89c4\u5219\u5f15\u64ce\u5904\u7406\u5404\u79cd\u4e1a\u52a1\u89c4\u5219\u3002\u5176\u4e2d\u89c4\u5219\u4e94\u662f\\&#8221;\u5173\u7cfb\u94fe\u6316\u6398\\&#8221;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,2756,768,100],"topic":[],"class_list":["post-90560","post","type-post","status-publish","format-standard","hentry","category-server","tag-java","tag-neo4j","tag-sql","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JGraphT \u9009\u578b\u5b9e\u5f55\uff1a\u4e3a\u4ec0\u4e48\u4e0d\u7528 SQL\uff0c\u4e5f\u4e0d\u7528 Neo4j - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/90560.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JGraphT \u9009\u578b\u5b9e\u5f55\uff1a\u4e3a\u4ec0\u4e48\u4e0d\u7528 SQL\uff0c\u4e5f\u4e0d\u7528 Neo4j - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u9879\u76ee\u91cc\u6709\u4e2a CRM \u5ba2\u6237\u7ba1\u7406\u52a9\u624b&#xff0c;\u5176\u4e2d\u89c4\u5219\u4e94&#xff08;\u5173\u7cfb\u94fe\u6316\u6398&#xff09;\u9700\u8981\u5904\u7406\u8282\u70b9\u95f4\u7684\u5173\u7cfb\u904d\u5386\u3002\u9009\u578b\u65f6\u7ecf\u5386\u4e86\u4e09\u8f6e\u601d\u8003&#xff1a;SQL \u80fd\u4e0d\u80fd\u641e\u5b9a&#xff1f;\u8981\u4e0d\u8981\u4e0a Neo4j&#xff1f;\u6700\u7ec8\u4e3a\u4ec0\u4e48\u9009\u4e86 JGraphT&#xff1f;\u8bb0\u5f55\u4e00\u4e0b\u5b8c\u6574\u7684\u51b3\u7b56\u8fc7\u7a0b\u3002 \u9879\u76ee\u80cc\u666f CRM \u52a9\u624b\u662f\u4e00\u4e2a Java \u540e\u7aef\u670d\u52a1&#xff08;Spring Boot&#xff09;&#xff0c;\u6709\u4e00\u5957\u89c4\u5219\u5f15\u64ce\u5904\u7406\u5404\u79cd\u4e1a\u52a1\u89c4\u5219\u3002\u5176\u4e2d\u89c4\u5219\u4e94\u662f&quot;\u5173\u7cfb\u94fe\u6316\u6398&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/90560.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-05T06:41:41+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/90560.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/90560.html\",\"name\":\"JGraphT \u9009\u578b\u5b9e\u5f55\uff1a\u4e3a\u4ec0\u4e48\u4e0d\u7528 SQL\uff0c\u4e5f\u4e0d\u7528 Neo4j - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-05T06:41:41+00:00\",\"dateModified\":\"2026-08-05T06:41:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/90560.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/90560.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/90560.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JGraphT \u9009\u578b\u5b9e\u5f55\uff1a\u4e3a\u4ec0\u4e48\u4e0d\u7528 SQL\uff0c\u4e5f\u4e0d\u7528 Neo4j\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JGraphT \u9009\u578b\u5b9e\u5f55\uff1a\u4e3a\u4ec0\u4e48\u4e0d\u7528 SQL\uff0c\u4e5f\u4e0d\u7528 Neo4j - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/90560.html","og_locale":"zh_CN","og_type":"article","og_title":"JGraphT \u9009\u578b\u5b9e\u5f55\uff1a\u4e3a\u4ec0\u4e48\u4e0d\u7528 SQL\uff0c\u4e5f\u4e0d\u7528 Neo4j - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u9879\u76ee\u91cc\u6709\u4e2a CRM \u5ba2\u6237\u7ba1\u7406\u52a9\u624b&#xff0c;\u5176\u4e2d\u89c4\u5219\u4e94&#xff08;\u5173\u7cfb\u94fe\u6316\u6398&#xff09;\u9700\u8981\u5904\u7406\u8282\u70b9\u95f4\u7684\u5173\u7cfb\u904d\u5386\u3002\u9009\u578b\u65f6\u7ecf\u5386\u4e86\u4e09\u8f6e\u601d\u8003&#xff1a;SQL \u80fd\u4e0d\u80fd\u641e\u5b9a&#xff1f;\u8981\u4e0d\u8981\u4e0a Neo4j&#xff1f;\u6700\u7ec8\u4e3a\u4ec0\u4e48\u9009\u4e86 JGraphT&#xff1f;\u8bb0\u5f55\u4e00\u4e0b\u5b8c\u6574\u7684\u51b3\u7b56\u8fc7\u7a0b\u3002 \u9879\u76ee\u80cc\u666f CRM \u52a9\u624b\u662f\u4e00\u4e2a Java \u540e\u7aef\u670d\u52a1&#xff08;Spring Boot&#xff09;&#xff0c;\u6709\u4e00\u5957\u89c4\u5219\u5f15\u64ce\u5904\u7406\u5404\u79cd\u4e1a\u52a1\u89c4\u5219\u3002\u5176\u4e2d\u89c4\u5219\u4e94\u662f\"\u5173\u7cfb\u94fe\u6316\u6398\"","og_url":"https:\/\/www.wsisp.com\/helps\/90560.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-05T06:41:41+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/90560.html","url":"https:\/\/www.wsisp.com\/helps\/90560.html","name":"JGraphT \u9009\u578b\u5b9e\u5f55\uff1a\u4e3a\u4ec0\u4e48\u4e0d\u7528 SQL\uff0c\u4e5f\u4e0d\u7528 Neo4j - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-05T06:41:41+00:00","dateModified":"2026-08-05T06:41:41+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/90560.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/90560.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/90560.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"JGraphT \u9009\u578b\u5b9e\u5f55\uff1a\u4e3a\u4ec0\u4e48\u4e0d\u7528 SQL\uff0c\u4e5f\u4e0d\u7528 Neo4j"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/90560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=90560"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/90560\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=90560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=90560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=90560"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=90560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}