我最近创建了一个Neo4j沙箱实例(空白),因此我可以测试https://guides.neo4j.com/wiki。
使用https://guides.neo4j.com/wiki,我成功运行了第一个cypher语句,用维基百科类别填充图表。但是,第二个cypher语句会在运行几秒后产生错误。
以下是声明:
UNWIND range(0,4) as level
CALL apoc.cypher.doIt("
MATCH (c:Category { pagesFetched: false, level: $level })
CALL apoc.load.json('https://en.wikipedia.org/w/api.php?format=json&action=query&list=categorymembers&cmtype=page&cmtitle=Category:' + apoc.text.urlencode(c.catName) + '&cmprop=ids%7Ctitle&cmlimit=500')
YIELD value as results
UNWIND results.query.categorymembers AS page
MERGE (p:Page {pageId: page.pageid})
ON CREATE SET p.pageTitle = page.title, p.pageUrl = 'http://en.wikipedia.org/wiki/' + apoc.text.urlencode(replace(page.title, ' ', '_'))
WITH p,c
MERGE (p)-[:IN_CATEGORY]->(c)
WITH DISTINCT c
SET c.pagesFetched = true", { level: level }) YIELD value
RETURN value
以下是错误消息:
Error ServiceUnavailable
WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket `readyState` is: 3
js控制台显示错误消息:
neo4j-web.min.js:20 WebSocket is already in CLOSING or CLOSED state.
我也在neoj4 Slack频道和neo4j Google小组发布了这个内容 - 感谢任何帮助。
作为这篇文章的补遗(5/25/2018):
我在AWS EC2(Linux)实例上安装了neo4j社区版3.4.0版,并没有像上面那样收到ServiceUnavailable错误。我的MacBook Pro Macos 10.13.4上发生错误
感谢您的关注。
科林戈德堡