{"id":296,"date":"2020-03-05T10:59:05","date_gmt":"2020-03-05T01:59:05","guid":{"rendered":"http:\/\/localhost:8000\/?p=296"},"modified":"2021-01-17T12:48:51","modified_gmt":"2021-01-17T03:48:51","slug":"neo4j-python-subgraph","status":"publish","type":"post","link":"http:\/\/localhost:8000\/2020\/03\/neo4j-python-subgraph.html","title":{"rendered":"Neo4j+python\u3067\u7279\u5b9a\u306e\u6761\u4ef6\u3067\u7e4b\u304c\u3063\u3066\u3044\u308b\u30b5\u30d6\u30b0\u30e9\u30d5\u3092\u62bd\u51fa\u3059\u308b"},"content":{"rendered":"
\u5019\u88dc\u30ce\u30fc\u30c9\uff08\u7d041\u5104\u4ef6\uff09\u3068\u5019\u88dc\u540c\u58eb\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\uff08\u7d04100\u5104\u4ef6\uff09\u3092neo4j\u306b\u767b\u9332\u3057\u3066\u3001\u7279\u5b9a\u306e\u6761\u4ef6\u3067\u7e4b\u304c\u3063\u3066\u3044\u308b\u30b5\u30d6\u30b0\u30e9\u30d5\u306e\u30ce\u30fc\u30c9ID\u3092\u62bd\u51fa\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n
\u5019\u88dc1 -- \u5019\u88dc2 (score = 40)\n\u5019\u88dc1 -- \u5019\u88dc3 (score = 60)\n\u5019\u88dc3 -- \u5019\u88dc4 (score = 50)\n\u5019\u88dc4 -- \u5019\u88dc5 (score = 70)\n\u5019\u88dc6 -- \u5019\u88dc7 (score = 30)\n\u5019\u88dc7 -- \u5019\u88dc8 (score = 70)\n\u5019\u88dc9 ... \u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u306a\u3057<\/code><\/pre>\nscore\u306f\u95a2\u9023\u6027\u306e\u5f37\u3055\u3067\u3059\u3002\u672c\u6765\u3001\u95a2\u9023\u6027\u306b\u65b9\u5411\u306f\u3042\u308a\u307e\u305b\u3093\u3002
\n\u30b0\u30e9\u30d5\u8868\u793a\u3059\u308b\u3068\u3053\u3093\u306a\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002
\n<\/p>\n
\u3053\u306e\u30c7\u30fc\u30bf\u304b\u3089\u30af\u30a8\u30ea\u3067score >= 50<\/code>\u4ee5\u4e0a\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u63a5\u5408\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n[\u5019\u88dc1, \u5019\u88dc3, \u5019\u88dc4, \u5019\u88dc5]\n[\u5019\u88dc2]\n[\u5019\u88dc6]\n[\u5019\u88dc7, \u5019\u88dc8]\n[\u5019\u88dc9]<\/code><\/pre>\n\u306a\u305c\u30b0\u30e9\u30d5DB\u3092\u5229\u7528\u3059\u308b\u306e\u304b<\/h2>\n
\u3042\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067[\u5019\u88dc]\u3068[\u5019\u88dc\u540c\u58eb\u306e\u95a2\u9023\u6027]\u3092\u5143\u306b\u5019\u88dc\u3092\u9069\u5207\u306b\u30b0\u30eb\u30fc\u30d4\u30f3\u30b0\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u3092\u3084\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u307e\u3055\u306b\u30b0\u30e9\u30d5\u306e\u30ce\u30fc\u30c9\u3068\u30a8\u30c3\u30b8\uff08\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\uff09\u306b\u5f53\u305f\u308b\u306e\u3067\u3059\u304c\u3001\u4ed6\u306e\u591a\u304f\u306e\u60c5\u5831\u3092BigQuery\u3067\u7ba1\u7406\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u306e\u30b0\u30e9\u30d5\u30c7\u30fc\u30bf\u3082BigQuery\u3067\u7ba1\u7406\u3057\u3066\u304d\u307e\u3057\u305f\u3002
\n\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u3060\u3068[\u5019\u88dc\u540c\u58eb\u306e\u95a2\u9023\u6027]\u304c\u657010\u4e07\u4ef6\u30ec\u30d9\u30eb\u3067\u7279\u306b\u554f\u984c\u306a\u304f\u52d5\u3044\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u672c\u756a\u30c7\u30fc\u30bf\u3060\u3068[\u5019\u88dc\u540c\u58eb\u306e\u95a2\u9023\u6027]\u306e\u4ef6\u6570\u304c100\u5104\u4ef6\u3092\u8d85\u3048\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u3001\u73fe\u5728\u306eBigQuery\u304b\u3089\u95a2\u9023\u6027\u60c5\u5831\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30d0\u30c3\u30c1\u30b5\u30fc\u30d0\u5185\u3067\u63a5\u5408\u3057\u3066\u3044\u304f\u4eca\u306e\u3084\u308a\u65b9\u3067\u306f\u3001\u6570TB\u4ee5\u4e0a\u306e\u30e1\u30e2\u30ea\u304c\u5fc5\u8981\u306a\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u3002
\n\u30b0\u30e9\u30d5DB\u3067\u3042\u308c\u3070\u3001BigQuery\u306eSQL\u3067\u306f\u8868\u73fe\u3067\u304d\u306a\u304b\u3063\u305f\u3088\u3046\u306a\u3001\u30ce\u30fc\u30c9\u3092\u63a5\u5408\u3057\u3066\u30b0\u30eb\u30fc\u30d4\u30f3\u30b0\u3059\u308b\u3088\u3046\u306a\u51e6\u7406\u3082DB\u30b5\u30fc\u30d0\u5185\u3067\u5b9f\u884c\u3067\u304d\u308b\u306e\u3067\u3001\u30d0\u30c3\u30c1\u30b5\u30fc\u30d0\u5074\u306e\u30e1\u30e2\u30ea\u306e\u554f\u984c\u3082\u89e3\u6d88\u3067\u304d\u308b\u306f\u305a\u3001\u3068\u601d\u3044\u3001\u30b0\u30e9\u30d5DB\u3092\u5c0e\u5165\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n
\u3061\u306a\u307f\u306b\u3001Google Cloud Bigtable<\/code> + JanusGraph<\/code>\u306e\u7d44\u5408\u305b\u3082\u5c11\u3057\u8003\u3048\u307e\u3057\u305f\u304c\u3001\u60c5\u5831\u304c\u5c11\u306a\u304f\u521d\u3081\u3066\u89e6\u308b\u306b\u306f\u4e0d\u5b89\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u60c5\u5831\u304c\u591a\u304f\u3066\u5b89\u5fc3\u611f\u306e\u3042\u308bNeo4j<\/code>\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\nNeo4j\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\nbrew \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5834\u5408<\/h3>\n
\/usr\/local\/Cellar\/neo4j\/3.5.14\/libexec<\/code> \u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002
\n2020\/03\/06\u73fe\u5728\u3001v3.5.14\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u30024\u7cfb\u306f\u7121\u3055\u305d\u3046\u3067\u3059\u3002<\/p>\n# \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nbrew install neo4j\n# \u8d77\u52d5\nneo4j start\n# \u505c\u6b62\nneo4j stop\n# \u30b9\u30c6\u30fc\u30bf\u30b9\u78ba\u8a8d\nneo4j status<\/code><\/pre>\ndocker-compose \u3092\u5229\u7528\u3059\u308b\u5834\u5408<\/h3>\n
docker-compose.yaml\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002
\n2020\/03\/06\u73fe\u5728\u3001v4.0.1\u306e\u30a4\u30e1\u30fc\u30b8\u304c\u3059\u3067\u306bdocker-hub\u306b\u4e0a\u304c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n
version: '3'\n\nservices:\n neo4j:\n image: neo4j:latest\n ports:\n - "7474:7474" # for HTTP\n - "7687:7687" # for Bolt\n volumes:\n - ${HOME}\/neo4j\/data:\/data\n - ${HOME}\/neo4j\/logs:\/logs\n - ${HOME}\/neo4j\/conf:\/conf\n - ${HOME}\/neo4j\/import:\/import # CSV\u30a4\u30f3\u30dd\u30fc\u30c8\u3092\u3059\u308b\u5834\u5408\u306b\u306f\u5fc5\u8981<\/code><\/pre>\n# \u30b3\u30f3\u30c6\u30ca\u8d77\u52d5\uff08\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\uff09\ndocker-compose up -d\n# \u30b3\u30f3\u30c6\u30ca\u505c\u6b62\ndocker-compose stop\n# \u30b3\u30f3\u30c6\u30ca\u524a\u9664\ndocker-compose down<\/code><\/pre>\n\u7ba1\u7406\u753b\u9762\u8868\u793a<\/h3>\n
DB\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3057\u305f\u3089\u3001\u4ee5\u4e0b\u306eURL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n
http:\/\/localhost:7474\/db\/data <\/a><\/p>\n\n- user_name: neo4j<\/li>\n
- password: neo4j<\/li>\n<\/ul>\n
\u521d\u671f\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5909\u66f4\u3059\u308b\u3068\u3001\u7ba1\u7406\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002
\n<\/p>\n
\u30b5\u30f3\u30d7\u30eb\u30b0\u30e9\u30d5\u3067\u304a\u8a66\u3057<\/h3>\n
\u7ba1\u7406\u753b\u9762\u306e\u30e1\u30cb\u30e5\u30fc\u3067 Example Graphs<\/code>\u306b\u4e8c\u3064\u306e\u30b5\u30f3\u30d7\u30eb\u304c\u6e96\u5099\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n- Movie Graph<\/li>\n
- Northwind Graph<\/li>\n<\/ul>\n
\u753b\u9762\u4e0a\u90e8\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf\u3067<\/p>\n
:play movie-graph<\/code><\/pre>\n\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001Movie Graph\u306e\u8aac\u660e\u304c\u6570\u30da\u30fc\u30b8\u306b\u6e21\u3063\u3066\u8868\u793a\u3055\u308c\u307e\u3059\u3002
\n2\u30da\u30fc\u30b8\u76ee\u306bMovie\u3001Person\u306e\u4e8c\u7a2e\u985e\u306e\u30ce\u30fc\u30c9\u3001Movie-Person\u9593\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\u30af\u30a8\u30ea\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u30af\u30ea\u30c3\u30af\u3057\u3066\u30a8\u30c7\u30a3\u30bf\u306b\u30b3\u30d4\u30fc\u3057\u3001\u5b9f\u884c\u3059\u308b\u3068\u30c7\u30fc\u30bf\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002
\n3\u30da\u30fc\u30b8\u76ee\u4ee5\u964d\u306b\u767b\u9332\u3057\u305f\u30c7\u30fc\u30bf\u3092\u691c\u7d22\u3059\u308b\u30af\u30a8\u30ea\u30b5\u30f3\u30d7\u30eb\u304c\u305f\u304f\u3055\u3093\u3042\u308b\u306e\u3067\u3001\u8a66\u3057\u3066\u307f\u308b\u3068\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n
\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u524a\u9664\u3059\u308b<\/h3>\n
DETACH<\/code>\u3092\u3064\u3051\u308b\u3053\u3068\u3067\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3082\u307e\u3068\u3081\u3066\u524a\u9664\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\nMATCH (n) DETACH DELETE n<\/code><\/pre>\n\u7ba1\u7406\u753b\u9762\u3067\u3084\u308a\u305f\u3044\u3053\u3068\u3092\u5b9f\u73fe<\/h2>\n
\u3044\u304d\u306a\u308apython\u3067\u5b9f\u88c5\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u307e\u305a\u306f\u7ba1\u7406\u753b\u9762\u4e0a\u306eCypher\u30af\u30a8\u30ea\u30d9\u30fc\u30b9\u3067\u3084\u308a\u305f\u3044\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u304b\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n
\u30c7\u30fc\u30bf\u767b\u9332<\/h3>\n
\u30ce\u30fc\u30c9\u3068\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u767b\u9332\u3059\u308b\u30af\u30a8\u30ea\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002
\n\u5b9f\u969b\u306b\u306f\u30ce\u30fc\u30c9\u304c1 \u5104\u4ef6\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u304c100\u5104\u4ef6\u3050\u3089\u3044\u306b\u306a\u308b\u60f3\u5b9a\u3067\u3059\u3002<\/p>\n
CREATE (c1:Candidate {id:1})\nCREATE (c2:Candidate {id:2})\nCREATE (c3:Candidate {id:3})\nCREATE (c4:Candidate {id:4})\nCREATE (c5:Candidate {id:5})\nCREATE (c6:Candidate {id:6})\nCREATE (c7:Candidate {id:7})\nCREATE (c8:Candidate {id:8})\nCREATE (c9:Candidate {id:9})\nCREATE\n (c1)-[:RELATED {score: 40}]->(c2),\n (c1)-[:RELATED {score: 60}]->(c3),\n (c3)-[:RELATED {score: 50}]->(c4),\n (c4)-[:RELATED {score: 70}]->(c5),\n (c6)-[:RELATED {score: 30}]->(c7),\n (c7)-[:RELATED {score: 70}]->(c8)<\/code><\/pre>\n\u30ce\u30fc\u30c9\u30e9\u30d9\u30ebCandidate<\/code>\u306f\u5019\u88dc\u3092\u8868\u3057\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30bf\u30a4\u30d7RELATED<\/code>\u306f\u95a2\u9023\u304c\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002RELATED<\/code>\u306e\u30d7\u30ed\u30d1\u30c6\u30a3score<\/code>\u306f\u95a2\u9023\u6027\u306e\u5f37\u3055\u3092\u683c\u7d0d\u3057\u3066\u3044\u307e\u3059\u3002 <\/p>\nNeo4j\u3067\u306f\u7121\u5411\u3082\u3057\u304f\u306f\u53cc\u65b9\u5411\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044<\/a>\u306e\u3067\u3001\u4e00\u65b9\u5411\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u767b\u9332\u3057\u3066\u304a\u304d\u3001\u30af\u30a8\u30ea\u3067\u65b9\u5411\u3092\u7121\u8996\uff08--<\/code>\uff09\u3057\u3066\u691c\u7d22\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\u30c7\u30fc\u30bf\u62bd\u51fa<\/h3>\n
Cypher\u30af\u30a8\u30ea\u3067\u3001score\u304c50\u4ee5\u4e0a\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u7e4b\u3044\u3067\u5019\u88dcID\u306e\u30ea\u30b9\u30c8\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n
MATCH (cs:Candidate)\nOPTIONAL MATCH p = (cs)-[*]-(:Candidate) \/\/ \u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u306a\u3044\u3082\u306e\u3082\u62bd\u51fa\nWHERE all(r IN relationships(p) WHERE r.score>=50) \/\/ score50\u70b9\u4ee5\u4e0a\u3067\u7d5e\u308a\u8fbc\u307f\nWITH\n cs.id AS cs_id\n , CASE WHEN p IS NULL THEN [cs.id] ELSE [n IN nodes(p)|n.id] END AS ids \/\/ \u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u306a\u3044 or 50\u70b9\u672a\u6e80\u306e\u5834\u5408\u306fp\u304cnull\u306b\u306a\u3063\u3066\u3044\u308b\nUNWIND ids AS id\nWITH cs_id, id\nORDER BY cs_id, id \/\/ \u3082\u3068\u3082\u3068path\u9806\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3053\u3053\u3067\u30bd\u30fc\u30c8\nWITH cs_id, collect(DISTINCT id) AS sorted_ids \/\/ \u958b\u59cb\u5019\u88dcID\u3067\u30b0\u30eb\u30fc\u30d4\u30f3\u30b0\nRETURN DISTINCT sorted_ids \/\/ \u91cd\u8907\u3092\u6392\u9664\u3057\u3066\u8fd4\u5374<\/code><\/pre>\n\u7121\u4e8b\u3001\u76ee\u7684\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n
\/\/ \u5b9f\u884c\u7d50\u679c\n\u2552\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2555\n\u2502"sorted_ids"\u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502[1,3,4,5] \u2502\n\u2502[2] \u2502\n\u2502[6] \u2502\n\u2502[7,8] \u2502\n\u2502[9] \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/code><\/pre>\n\u30dd\u30a4\u30f3\u30c8\u3092\u3044\u304f\u3064\u304b\u66f8\u3044\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n
\n- \u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u7e4b\u304c\u3063\u3066\u3044\u306a\u3044\u5019\u88dc\u3082\u53d6\u5f97\u3059\u308b\u305f\u3081\u306b
OPTIONAL MATCH<\/code>\u3092\u4f7f\u3046<\/li>\n- path\u306e\u9014\u4e2d\u306b\u542b\u307e\u308c\u308b\u5168\u3066\u306e\u30ce\u30fc\u30c9\u3092
nodes(p)<\/code>\u3067\u53d6\u5f97\u3059\u308b<\/li>\n- WHERE\u53e5\u3067list\u306b\u5bfe\u3057\u3066\u7d5e\u308a\u8fbc\u307f\u3092\u3059\u308b\u969b\u306f
all()<\/code>\u3092\u5229\u7528\u3059\u308b<\/li>\n- \u5404path\u306e\u30ce\u30fc\u30c9\u30ea\u30b9\u30c8\u306e\u91cd\u8907\u3092\u6392\u9664\u3059\u308b\u305f\u3081\u306blist\u306e\u8981\u7d20\u3092\u30bd\u30fc\u30c8\u3057\u305f\u3044\u304c\u3001\u76f4\u63a5\u30bd\u30fc\u30c8\u3059\u308b\u65b9\u6cd5\u304c\u306a\u3044\u306e\u3067\u3001\u4e00\u65e6
UNWIND<\/code>\u3059\u308b<\/li>\n<\/ul>\npython\u3067\u3084\u308a\u305f\u3044\u3053\u3068\u3092\u5b9f\u73fe<\/h2>\n
Cypher\u30af\u30a8\u30ea\u3067\u3084\u308a\u305f\u3044\u3053\u3068\u3092\u5b9f\u73fe\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u305f\u306e\u3067\u3001\u3042\u3068\u306fpython\u3067\u5b9f\u88c5\u3059\u308b\u3060\u3051\u3067\u3059\u3002 <\/p>\n
neo4j-driver\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n
2020\/03\/06\u6642\u70b9\u3067\u3001python-driver\u306fneo4j v4.0\u306b\u5bfe\u5fdc\u3057\u3066\u306a\u3044<\/a>\u3068\u66f8\u3044\u3066\u3042\u308a\u307e\u3059\u304c\u3001\u4eca\u56de\u306e\u5229\u7528\u7bc4\u56f2\u3067\u306f\u554f\u984c\u306a\u304f\u52d5\u304d\u307e\u3057\u305f\u3002<\/p>\npip install neo4j-driver<\/code><\/pre>\nNeo4j\u30a2\u30af\u30bb\u30b9\u7528\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30e9\u30c3\u30d1\u30fc\u3092\u4f5c\u6210<\/h3>\n
\u672c\u8a18\u4e8b\u3068\u3057\u3066\u306f\u306a\u304f\u3066\u3082\u5168\u7136\u3044\u3044\u306e\u3067\u3059\u304c\u3001\u5b9f\u904b\u7528\u3067\u4f7f\u3046\u306b\u306f\u30e9\u30c3\u30d1\u30fc\u30af\u30e9\u30b9\u3092\u4f5c\u3063\u3066\u304a\u3044\u305f\u65b9\u304c\u4f7f\u3044\u3084\u3059\u3044\u306e\u3067\u3001\u4f5c\u308a\u307e\u3057\u305f\u3002<\/p>\n
from neo4j import GraphDatabase, Driver, StatementResult, TransactionError, Session, Transaction\nimport traceback\nfrom typing import Dict, Any\n\nclass Neo4jClient:\n driver: Driver\n session: Session\n transaction: Transaction\n readonly: bool\n with_transaction: bool\n\n def __init__(\n self,\n uri: str = 'bolt:\/\/localhost:7687',\n user: str = 'neo4j',\n password: str = 'neo4j',\n readonly: bool = True,\n with_transaction: bool = True):\n self.driver = GraphDatabase.driver(uri, auth=(user, password), encrypted=False)\n self.session = self.driver.session()\n self.readonly = readonly\n self.with_transaction = with_transaction\n self.transaction = self.session.begin_transaction() if self.with_transaction else None\n\n def commit(self):\n if self.readonly:\n raise TransactionError('cannot commit when readonly')\n if self.session.has_transaction():\n self.transaction.commit()\n\n def rollback(self):\n if self.session.has_transaction():\n self.transaction.rollback()\n\n def run(self, query: str, **kwargs: Dict[str, Any]) -> StatementResult:\n print(f'query: {query}')\n print(f'kwargs: {kwargs}')\n\n result: StatementResult\n if self.with_transaction:\n result = self.transaction.run(query, kwargs)\n else:\n result = self.session.run(query, kwargs)\n return result\n\n def __enter__(self):\n return self\n\n def __exit__(self, exc_type, exc_value, tb):\n if tb is not None:\n print(''.join(traceback.format_tb(tb)))\n if self.session.has_transaction():\n self.rollback()\n self.session.close()\n self.driver.close()<\/code><\/pre>\n\u4f7f\u3044\u65b9\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n
# \u53c2\u7167\u7cfb\nwith Neo4jClient() as client:\n for row in client.run('MATCH (t:Test) RETURN t.id as id')\n print(row[id])\n\n# \u66f4\u65b0\u7cfb\nwith Neo4jClient(readonly=False) as client:\n client.run('MATCH (t:Test) DETACH DELETE t')\n client.run('CREATE (:Test {id:1})')\n client.run('CREATE (:Test {id:2})')\n if bussiness_check_ok():\n client.commit()\n else:\n client.rollback()<\/code><\/pre>\n\u30c7\u30fc\u30bf\u3092CSV\u30ed\u30fc\u30c9\u3067\u767b\u9332<\/h3>\n
\u5b9f\u30c7\u30fc\u30bf\u306f100\u5104\u4ef6\u3050\u3089\u3044\u3042\u308b\u306e\u3067\u3001CSV\u30ed\u30fc\u30c9\u3067\u767b\u9332\u3059\u308b\u65b9\u6cd5\u3092\u8a66\u3057\u307e\u3057\u305f\u3002<\/p>\n
import csv\nimport time\nfrom typing import str\n\nnodes_csv_name: str = 'nodes.csv'\nrelations_csv_name: str = 'relations.csv'\n\n# \u30ce\u30fc\u30c9\u7528CSV\u30d5\u30a1\u30a4\u30eb\u66f8\u304d\u8fbc\u307f\nwith open(f'{path_to_neo4j_dir}\/import\/{nodes_csv_name}', 'w') as f:\n writer = csv.writer(f)\n writer.writerow(['id'])\n for i in range(1, 10):\n writer.writerow([i])\n\n# \u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u7528CSV\u30d5\u30a1\u30a4\u30eb\u66f8\u304d\u8fbc\u307f\nwith open(f'{path_to_neo4j_dir}\/import\/{relations_csv_name}', 'w') as f: \n writer = csv.writer(f)\n writer.writerow(['from_id', 'to_id', 'score'])\n writer.writerow([1, 2, 40])\n writer.writerow([1, 3, 60])\n writer.writerow([3, 4, 50])\n writer.writerow([4, 5, 70])\n writer.writerow([6, 7, 30])\n writer.writerow([7, 8, 70])\n\n# \u3053\u306e\u5f85\u3061\u3092\u5165\u308c\u306a\u3044\u3068\u3001\u3054\u304f\u305f\u307e\u306b\u4e0d\u5b8c\u5168\u306aCSV\u30d5\u30a1\u30a4\u30eb\u3092\u30ed\u30fc\u30c9\u3057\u3066\u5931\u6557\u3059\u308b\ntime.sleep(0.1) \n\nwith Neo4jClient(with_transaction=False) as client:\n # \u30ce\u30fc\u30c9\u7528CSV\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\n nodes_query: str = """\n USING PERIODIC COMMIT 10000\n LOAD CSV WITH HEADERS FROM $csv_path AS line\n CREATE (:Candidate {id:toInteger(line.id)})\n """\n client.run(nodes_query, csv_path=f'file:\/\/\/{nodes_csv_name}')\n\n # \u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u7528CSV\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\n relations_query: str = """\n USING PERIODIC COMMIT 10000\n LOAD CSV WITH HEADERS FROM $csv_path AS line\n MATCH (cf:Candidate {id:toInteger(line.from_id)}), (ct:Candidate {id:toInteger(line.to_id)})\n CREATE (cf)-[:RELATED {score: toFloat(line.score)}]->(ct)\n """\n client.run(relations_query, csv_path=f'file:\/\/\/{relations_csv_name}')<\/code><\/pre>\n\u30dd\u30a4\u30f3\u30c8\u306f\u4ee5\u4e0b\u306e\u70b9\u3067\u3059\u3002<\/p>\n
\n- CSV LOAD\u6a5f\u80fd\u306fCypher\u30af\u30a8\u30ea\u3067\u5b9f\u884c\u3059\u308b\u305f\u3081\u3001DB\u30b5\u30fc\u30d0\u5074\u3067\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u305d\u306e\u305f\u3081DB\u30b5\u30fc\u30d0\u306e\u30ed\u30fc\u30ab\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u304b\u3001HTTP\/HTTPS\/FTP\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\u3059\u308b\u304b\u3001\u306b\u306a\u308a\u307e\u3059\u3002\u4eca\u56de\u306fWEB\u30b5\u30fc\u30d0\u3092\u7acb\u3066\u308b\u306e\u304c\u9762\u5012\u3060\u3063\u305f\u306e\u3067\u3001DB\u30b5\u30fc\u30d0\u4e0a\u306eimport\u7528\u30d5\u30a9\u30eb\u30c0\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f
{$NEO4J_HOME}\/import<\/code>\uff09\u306bCSV\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u30ed\u30fc\u30c9\u3057\u307e\u3057\u305f\u3002docker\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30db\u30b9\u30c8\u30de\u30b7\u30f3\u306e\u9069\u5f53\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092docker\u30b3\u30f3\u30c6\u30ca\u5074\u306e\/import<\/code>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30de\u30a6\u30f3\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n- \u7406\u7531\u306f\u3088\u304f\u5206\u304b\u3089\u306a\u3044\u306e\u3067\u3059\u304c\u3001CSV\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u3093\u3067\u3001\u305d\u306e\u307e\u307e\u3059\u3050\u306bCSV\u30ed\u30fc\u30c9\u3059\u308b\u3068\u3001\u7a7a\u306e\u884c\u304c\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u7a00\u306b\u3042\u308a\u3001\u82e6\u8089\u306e\u4f5c\u3067
time.sleep(0.1)<\/code>\u3092\u5165\u308c\u3066\u3044\u307e\u3059<\/li>\n- \u5927\u91cf\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\u3059\u308b\u969b\u306e\u30e1\u30e2\u30ea\u4e0d\u8db3\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u306b\u3001
USING PERIODIC COMMIT 10000<\/code>\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u6307\u5b9a\u3057\u305f\u4ef6\u6570\u6bce\u306b\u307e\u3068\u3081\u3066commit\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u305f\u3060\u3057\u3053\u308c\u306f\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u5185\u3067\u306f\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093<\/li>\n- CSV\u304b\u3089
LOAD CSV<\/code>\u3067\u8aad\u307f\u8fbc\u3093\u3060\u5024\u306f\u6587\u5b57\u5217\u6271\u3044\u306b\u306a\u308b\u306e\u3067\u3001int\u3084float\u306b\u3057\u305f\u3044\u5834\u5408\u306ftoInteger()<\/code>\u3084toFloat()<\/code>\u95a2\u6570\u3067\u5909\u63db\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059<\/li>\n<\/ul>\n\u5b9f\u969b\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97<\/h3>\nquery: str = """\n MATCH (cs:Candidate)\n OPTIONAL MATCH p = (cs)-[*]-(:Candidate)\n WHERE all(r IN relationships(p) WHERE r.score>=50)\n WITH\n cs.id AS cs_id\n , CASE WHEN p IS NULL THEN [cs.id] ELSE [n IN nodes(p)|n.id] END AS ids\n UNWIND ids AS id\n WITH cs_id, id\n ORDER BY cs_id, id\n WITH cs_id, collect(DISTINCT id) AS sorted_ids\n RETURN DISTINCT sorted_ids\n"""\n\n# \u81ea\u4f5c\u306e\u30e9\u30c3\u30d1\u30fc\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\nwith Neo4jClient() as client:\n for row in client.run(query):\n print(row['sorted_ids'])\n\n# \u76f4\u63a5\u30c9\u30e9\u30a4\u30d0\u30fc\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\ndriver: Driver = GraphDatabase.driver('bolt:\/\/localhost:7687', auth=('neo4j', 'neo4j'), encrypted=False)\nwith driver.session() as session:\n with session.begin_transaction() as tx:\n for row in tx.run(query):\n print(row['sorted_ids'])\n\n# \u51fa\u529b\u7d50\u679c\n# > [1, 3, 4, 5]\n# > [2]\n# > [6]\n# > [7, 8]\n# > [9]<\/code><\/pre>\n\u7121\u4e8b\u3001python\u3067\u3082\u3084\u308a\u305f\u3044\u3053\u3068\u3092\u5b9f\u73fe\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n
\u611f\u60f3<\/h2>\n
\u5b9f\u969b\u306b\u521d\u3081\u3066Neo4j\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306e\u7bc4\u56f2\u3060\u3068\u591a\u5c11\u8a70\u307e\u308b\u3053\u3068\u3082\u3042\u308b\u3051\u308c\u3069\u3001\u516c\u5f0f\u30de\u30cb\u30e5\u30a2\u30eb\u304c\u5145\u5b9f\u3057\u3066\u3044\u3066\u3001\u3069\u3053\u304b\u306b\u5bfe\u5fdc\u65b9\u6cd5\u304c\u66f8\u3044\u3066\u3042\u308b\u305f\u3081\u3001\u6bd4\u8f03\u7684\u3059\u3093\u306a\u308a\u3084\u308a\u305f\u3044\u3053\u3068\u3092\u5b9f\u73fe\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n
\u4eca\u56de\u306f\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u306escore\u7b97\u51fa\u306b\u4f7f\u3046\u30e1\u30bf\u30c7\u30fc\u30bf\u306e\u7ba1\u7406\u3082\u3001score\u306e\u7b97\u51fa\u3082\u5168\u3066BigQuery\u4e0a\u3067\u51e6\u7406\u3092\u3057\u3066\u304a\u308a\u3001score\u3092\u5143\u306b\u30ce\u30fc\u30c9\u3092\u7e4b\u3050\u3068\u3053\u308d\u3060\u3051\u306bNeo4j\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u672c\u6765\u5168\u3066\u3092Neo4j\u4e0a\u3067\u7ba1\u7406\u3001\u51e6\u7406\u3057\u305f\u65b9\u304c\u69cb\u6210\u4e0a\u30b9\u30c3\u30ad\u30ea\u3057\u305f\u304b\u3082\u3057\u308c\u306a\u3044\u3068\u601d\u3044\u307e\u3057\u305f\u3002<\/p>\n
\u3042\u3068\u306f\u3001\u5b9f\u904b\u7528\u3067\u6570100\u5104\u4ef6\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u306b\u672c\u5f53\u306b\u8010\u3048\u3089\u308c\u308b\u306e\u304b\u304c\u6c17\u306b\u306a\u308b\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n
\u5f8c\u65e5\u8ac7<\/h2>\n
\u5b9f\u30c7\u30fc\u30bf\u3067\u3084\u308b\u524d\u306b\u300115\u4e07\u30ce\u30fc\u30c9\u30013\u5104\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3067\u8a66\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u5b9f\u884c\u6642\u9593\u304c\u304b\u304b\u308a\u3059\u304e\u308b\u3053\u3068\u304c\u5224\u660e\u3057\u307e\u3057\u305f\u3002\u6570\u65e5\u9593\u6539\u5584\u3092\u8a66\u307f\u305f\u3068\u3053\u308d\u7d50\u5c40\u89e3\u6c7a\u3067\u304d\u305a\u3001Neo4j\u5c0e\u5165\u306f\u4e00\u65e6\u767d\u7d19\u306b\u623b\u3059\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/b><\/p>\n\u30cf\u30de\u3063\u305f\u3053\u3068\u2460\uff1aCSV\u30ed\u30fc\u30c9\u304c\u610f\u5916\u306b\u5927\u5909<\/h3>\n
\u307e\u305a\u3001\u3053\u306e\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u305fCSV\u30ed\u30fc\u30c9\u306e\u65b9\u6cd5\u3067\u3059\u304c\u4f4e\u901f\u3067\u3001\u30c7\u30fc\u30bf\u91cf\u304c3\u5104\u4ef6\u3067\u3082\u5168\u304f\u5fdc\u7b54\u304c\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u3053\u3061\u3089\u306f\u5225\u8a18\u4e8b\u3067\u5bfe\u5fdc\u65b9\u6cd5\u3092\u8a18\u8f09\u3057\u307e\u3057\u305f\u306e\u3067\u3001\u8a73\u7d30\u306f\u305d\u3061\u3089\u3092\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002
\nNeo4j\u306bCSV\u30ed\u30fc\u30c9\u3059\u308b4\u3064\u306e\u65b9\u6cd5<\/a><\/p>\n\u30cf\u30de\u3063\u305f\u3053\u3068\u2461\uff1a\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u6570\u304c\u591a\u3044\u3068\u7d50\u679c\u304c\u8fd4\u3063\u3066\u3053\u306a\u3044<\/h3>\n
\u6b21\u306b\u300115\u4e07\u30ce\u30fc\u30c9\u30013\u5104\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u5185\u306b\u542b\u307e\u308c\u308b\u7279\u5b9a\u6761\u4ef6\u306e\u30b5\u30d6\u30b0\u30e9\u30d5\u3092\u62bd\u51fa\u3059\u308b\u51e6\u7406\u3067\u3059\u304c\u3001\u3053\u3061\u3089\u3082\u5168\u304f\u5fdc\u7b54\u304c\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002
\n\u305d\u3061\u3089\u306fneo4j\u306e\u30b3\u30f3\u30b5\u30eb\u30c6\u30a3\u30f3\u30b0\u4f1a\u793e\u306e\u6280\u8853\u62c5\u5f53\u306e\u65b9\u306b\u76f8\u8ac7\u3057\u305f\u308a\u3082\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u7d50\u5c40\u7c21\u5358\u306b\u306f\u89e3\u6c7a\u3067\u304d\u308b\u611f\u3058\u3067\u306f\u306a\u304f\u3001\u6642\u9593\u3082\u306a\u304b\u3063\u305f\u306e\u3067\u4e00\u65e6\u8ae6\u3081\u307e\u3057\u305fww
\n\u305d\u306e\u969b\u306b\u8a66\u3057\u305f\u3044\u304f\u3064\u304b\u306e\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u306b\u3064\u3044\u3066\u306f\u3001\u5225\u8a18\u4e8b\u3067\u66f8\u3053\u3046\u304b\u306a\u3068\u601d\u3063\u3066\u304a\u308a\u307e\u3059\u3002
\nTBD<\/p>\n
[\u53c2\u8003] \u30e1\u30e2\u30ea\u306f\u3069\u308c\u3050\u3089\u3044\u4f7f\u3046\u304b<\/h2>\n
\u30ce\u30fc\u30c91\u5104\u4ef6\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3100\u5104\u4ef6\u3050\u3089\u3044\u306e\u60f3\u5b9a\u306a\u306e\u3067\u3059\u304c\u3001\u516c\u5f0f\u30de\u30cb\u30e5\u30a2\u30eb<\/a>\u306b\u4ee5\u4e0b\u306e\u8a18\u8ff0\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n\nTo avoid hitting disk you need more RAM. On a standard mechanical drive you can handle graphs with a few tens of millions of primitives (nodes, relationships and properties) with 2-3 GBs of RAM. A server with 8-16 GBs of RAM can handle graphs with hundreds of millions of primitives, and a good server with 16-64 GBs can handle billions of primitives. However, if you invest in a good SSD you will be able to handle much larger graphs on less RAM.<\/p>\n<\/blockquote>\n
\u3064\u307e\u308a\u3001RAM 16-64 GB \u3067\u657010\u5104\u4ef6\u3092\u51e6\u7406\u3067\u304d\u308b\u305d\u3046\u3067\u3059\u3002100GB\u7a4d\u3081\u3070\u304d\u3063\u3068\u5927\u4e08\u592b\u3068\u4fe1\u3058\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n
[\u53c2\u8003] Community\u30a8\u30c7\u30a3\u30b7\u30e7\u30f3 or Enterprise\u30a8\u30c7\u30a3\u30b7\u30e7\u30f3<\/h2>\n
\u4eca\u56de\u306fCommunity\u30a8\u30c7\u30a3\u30b7\u30e7\u30f3<\/code>\u3067\u306a\u3093\u3068\u304b\u5927\u4e08\u592b\u3068\u5224\u65ad\u3057\u307e\u3057\u305f\u3002<\/p>\n\u3053\u3061\u3089<\/a>\u306b\u4e8c\u3064\u306e\u30a8\u30c7\u30a3\u30b7\u30e7\u30f3\u306e\u9055\u3044\u304c\u66f8\u3044\u3066\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u6c17\u306b\u306a\u3063\u305f\u306e\u306f\u3001\u4ee5\u4e0b\u4e8c\u70b9\u3067\u3059\u3002<\/p>\n\n- Cluster<\/li>\n
- Graph size limitations: 34B nodes<\/li>\n<\/ul>\n
\u4eca\u56de\u306f\u3001\u30b0\u30e9\u30d5\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u7e4b\u3050\u3068\u3053\u308d\u3060\u3051\u3092Neo4j\u3067\u884c\u3063\u3066\u3001\u7d50\u679c\u30c7\u30fc\u30bf\u3092\u6052\u4e45\u7684\u306b\u7ba1\u7406\u3059\u308b\u306e\u306f\u3042\u304f\u307e\u3067BigQuery\u3067\u884c\u3046\u3053\u3068\u3092\u8003\u3048\u3066\u3044\u308b\u305f\u3081\u3001Clusteing\u3067\u304d\u306a\u304f\u3066\u5927\u4e08\u592b\u3068\u5224\u65ad\u3057\u307e\u3057\u305f\u3002<\/p>\n
\u30ce\u30fc\u30c9\u6570\uff08\u304a\u305d\u3089\u304f\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u6570\u3082\uff09\u304c340\u5104\u4ef6\u306e\u5236\u9650\u3082\u3001\u898b\u7a4d\u3082\u308a\u4e0a\u306f\u30ae\u30ea\u30ae\u30ea\u53ce\u307e\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u3084\u308a\u305f\u3044\u3053\u3068 \u5019\u88dc\u30ce\u30fc\u30c9\uff08\u7d041\u5104\u4ef6\uff09\u3068\u5019\u88dc\u540c\u58eb\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\uff08\u7d04100\u5104\u4ef6\uff09\u3092neo4j\u306b\u767b\u9332\u3057\u3066\u3001\u7279\u5b9a\u306e\u6761\u4ef6\u3067\u7e4b\u304c\u3063\u3066\u3044\u308b\u30b5\u30d6\u30b0\u30e9\u30d5\u306e\u30ce\u30fc\u30c9ID\u3092\u62bd\u51fa\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 \u5165\u529b\u30c7\u30fc\u30bf \u5019\u88dc1 — \u5019\u88dc2 (score = 40) \u5019\u88dc1 — \u5019\u88dc3 (score = 60) \u5019\u88dc3 — \u5019\u88dc4 (score = 50) \u5019\u88dc4 — \u5019\u88dc5 (score = 70) \u5019\u88dc6 — \u5019\u88dc7 (score = 30) \u5019\u88dc7 — \u5019\u88dc8 (score = 70) \u5019\u88dc9 … \u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u306a\u3057 score\u306f\u95a2\u9023\u6027\u306e\u5f37\u3055\u3067\u3059\u3002\u672c\u6765\u3001\u95a2\u9023\u6027\u306b\u65b9\u5411\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u30b0\u30e9\u30d5\u8868\u793a\u3059\u308b\u3068\u3053\u3093\u306a\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002 \u3053\u306e\u30c7\u30fc\u30bf\u304b\u3089\u30af\u30a8\u30ea\u3067score >= 50\u4ee5\u4e0a\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u63a5\u5408\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002 [\u5019\u88dc1, \u5019\u88dc3, \u5019\u88dc4, \u5019\u88dc5] [\u5019\u88dc2] [\u5019\u88dc6] <\/span>Continue Reading<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[31,7],"tags":[],"_links":{"self":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/296"}],"collection":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/comments?post=296"}],"version-history":[{"count":1,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/296\/revisions"}],"predecessor-version":[{"id":297,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/296\/revisions\/297"}],"wp:attachment":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/media?parent=296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/categories?post=296"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/tags?post=296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}