json - 如何使用密码查询语言将未嵌套的 json 数据解析到 Neo4j 数据库?
问题描述
在下面的 json 文件中,我想访问“934934507945312256”、“934934503604174848”、....然后是其中的键。但是在使用UNWIND 子句后,我无法访问这些键的数据(quote_count,reply_count 等),因为这些键(“934934507945312256”,“934934503604174848”,...)是随机生成的。
{
"934934507945312256": {
"quote_count": 0,
"reply_count": 0,
"hashtags": null,
"datetime": "2017-11-26 23:58:51",
"date": "2017-11-26",
"like_count": 0,
"verified": "False",
"sentiment": 0,
"author": "JudyThe Resistance",
"location": "Hollywood, California USA",
"tid": "934934507945312256",
"retweet_count": 0,
"type": "retweet",
"media_list": null,
"quoted_source_id": null,
"url_list": null,
"tweet_text": "RT @kylegriffin1: Reminder: The Senate Judiciary Committee gave Jared Kushner a November 27 deadline to turn over the missing records… ",
"author_profile_image": "https://pbs.twimg.com/profi...",
"author_screen_name": "jgirl66",
"author_id": "23737528",
"lang": "en",
"keywords_processed_list": [
"reminder",
"senate judiciary committee",
"kushner november",
"deadline"
],
"retweet_source_id": "934872065471115264",
"mentions": [
"kylegriffin1"
],
"replyto_source_id": null
},
"934934503604174848": {
"quote_count": 0,
"reply_count": 2,
"hashtags": [
"MissUniverse",
"Thailand"
],
"datetime": "2017-11-26 23:58:50",
"date": "2017-11-26",
"like_count": 38,
"verified": "False",
"sentiment": 0,
"author": "P'Hmee7.5",
"location": "Bangkok, Thailand",
"tid": "934934503604174848",
"retweet_count": 105,
"type": "Tweet",
"media_list": null,
"quoted_source_id": null,
"url_list": null,
"tweet_text": "รอโหวต มรญ #MissUniverse #Thailand",
"author_profile_image": "
Thumbnail
",
"author_screen_name": "Peehmee75",
"author_id": "700720806972624897",
"lang": "th",
"keywords_processed_list": null,
"retweet_source_id": null,
"mentions": null,
"replyto_source_id": null
},
"934934336381636608": {
"quote_count": 0,
"reply_count": 0,
"hashtags": null,
"datetime": "2017-11-26 23:58:10",
"date": "2017-11-26",
"like_count": 0,
"verified": "False",
"sentiment": 0,
"author": "selfresqingprncess",
"location": "Maine, USA",
"tid": "934934336381636608",
"retweet_count": 0,
"type": "retweet",
"media_list": null,
"quoted_source_id": null,
"url_list": null,
"tweet_text": "RT @kylegriffin1: Reminder: The Senate Judiciary Committee gave Jared Kushner a November 27 deadline to turn over the missing records… ",
"author_profile_image": "https://pbs.twimg.com/profi...",
"author_screen_name": "slfresqngprncss",
"author_id": "100536014",
"lang": "en",
"keywords_processed_list": [
"reminder",
"keywords_processed_list": [
"reminder",
"senate judiciary committee",
"kushner november",
"deadline"
],
"retweet_source_id": "934872065471115264",
"mentions": [
"kylegriffin1"
],
"replyto_source_id": null
}
}
我已经尝试过:-
query =
"""
with {json} as data
UNWIND data as doc
FOREACH( l in doc|
MERGE (label1:Label1 {author:l.author}))
"""
但我收到错误:-
无法使用作者的空属性值合并节点。
解决方案
推荐阅读
- python-3.x - 在其目录系统中读取 LIDC-IDRI 数据集?
- assembly - MOVNTSS 有多少性能损失?
- python - 在 Python 中调用 C 函数并返回 2 个值
- sql-server - 在 Azure SQL Server 上创建从本地 SQL Server 读取表的视图
- sql - 此检查是否避免 SQL 注入?
- sql - Postgresql:创建一个插入查询,在一个范围内插入多条记录
- java - 如何让 GUI 和 Graphics 同时出现?
- docker - 如何在 docker 容器中添加文件并使其可以从其他容器访问?
- vba - microsoft excel - 如何将图像放入形状中?
- python - 在 Python 中循环列并为文件中的每一列写入输出