问题标签 [neography]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
242 浏览

ruby - 启动 neo4j 服务器时出错(Neography、Ruby)

服务器突然停止工作并在重新启动时出现以下错误。在网上找不到与此相关的任何内容。知道什么是错的以及如何解决这个问题吗?

org.neo4j.server.logging.Logger 日志严重:org.neo4j.server.ServerStartupException:启动 Neo4j 服务器失败:活动标记为 1,但 org.neo4j.server 中不存在 data/graph.db/nioneo_logical.log.1。 AbstractNeoServer.start(AbstractNeoServer.java:218) at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:87) at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:50) 原因:java.lang .IllegalStateException:活动标记为 1,但在 org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLogFiles.determineState(XaLogicalLogFiles.java:138) 中不存在数据/graph.db/nioneo_logical.log.1 org.neo4j.kernel .impl.recovery.StoreRecoverer.recoveryNeededAt(StoreRecoverer.java:65) 在 org.neo4j.server.preflight.PerformRecoveryIfNecessary.run(PerformRecoveryIfNecessary.java:56) 在 org.neo4j.server.preflight。PreFlightTasks.run(PreFlightTasks.java:70) at org.neo4j.server.AbstractNeoServer.runPreflightTasks(AbstractNeoServer.java:333) at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:152) ... 2 更多

2014 年 4 月 25 日晚上 9:13:07 org.neo4j.server.logging.Logger 日志严重:无法在端口 [7474] 上启动 Neo Server

0 投票
3 回答
732 浏览

neo4j - 在 Neo4j 中记住和重用先前查询结果的方法

我正在使用 Neo4j 和 gem Neography 在 Ruby 中编码。在查询的时候,我使用了Neography提供的execute_neo4j_query方法。我不确定最佳实践。

假设我使用以下代码来获取用户:

并以类似方式获取另一个用户

然后我对这两个用户做了一些事情。

现在我需要在这两个用户之间创建一个边缘,所以我这样做了

但是,我认为这种方法不是最优的,因为我两次查询了相同的两个用户。

我的问题是:

1)有没有办法使用Neography重用以前查询的结果?

2)除了直接使用execute_neo4j_query,是否推荐使用Neography提供的方法如@neo.create_node?我选择后者是因为我不确定封装的方法是否能满足我的任务。所以,如果你能用原生 Neography 代码重写我上面的代码,将不胜感激。

0 投票
1 回答
637 浏览

neo4j - neo4j 的性能问题

我正在使用rdb 将我的 rdb 转移到 neo4j 2.0.3 。一开始,我的每个传输查询过去花费的时间非常少,但现在(graphml 文件的大小约为 1.3gbs)插入需要 3-5xtime 并且经常为某些查询抛出此错误。

org.neo4j.kernel.guard.Guard$Timeout.check(Guard.java:132) org.neo4j.kernel.guard.Guard.check(Guard.java:43) org.neo4j.kernel.InternalAbstractGraphDatabase$5.getNodeByIdOrNull(InternalAbstractGraphDatabase .java:745) org.neo4j.kernel.impl.core.NodeManager.getNodeById(NodeManager.java:301) org.neo4j.kernel.InternalAbstractGraphDatabase.getNodeById(InternalAbstractGraphDatabase.java:1121) org.neo4j.cypher.internal.spi .v2_0.TransactionBoundQueryContext$NodeOperations.getById(TransactionBoundQueryContext.scala:157) org.neo4j.cypher.internal.spi.v2_0.TransactionBoundQueryContext$$anonfun$getNodesByLabel$1.apply(TransactionBoundQueryContext.scala:131) org.neo4j.cypher.internal .spi.v2_0.TransactionBoundQueryContext$$anonfun$getNodesByLabel$1.apply(TransactionBoundQueryContext.scala:131) org.neo4j.cypher.internal.helpers。JavaConversionSupport$$anon$2.next(JavaConversionSupport.scala:33) scala.collection.Iterator$$anon$11.next(Iterator.scala:328) scala.collection.Iterator$$anon$13.next(Iterator.scala:372) scala.collection.Iterator$$anon$14.hasNext(Iterator.scala:389) scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371) scala.collection.Iterator$$anon$14.hasNext(Iterator. scala:388) scala.collection.Iterator$class.foreach(Ite​​rator.scala:727) scala.collection.AbstractIterator.foreach(Ite​​rator.scala:1157) scala.collection.generic.Growable$class.$plus$plus$eq (Growable.scala:48) scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:176) scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:45) scala .collection.TraversableOnce$class.to(TraversableOnce.scala:27​​3) scala.collection.AbstractIterator.to(Iterator.scala:第1157章 难怪

我通过遍历每行rdb并为电影(如果不存在)及其相关标签(如果不存在)创建节点,然后在它们之间创建关系以及类似的此类操作,将电影数据从rdb导入neo4j。

如何使性能更好并解决此错误?

这是我的neo4j-wrapper.conf

在搜索时,我登陆了http://docs.neo4j.org/chunked/stable/configuration.html,它提供了详细的性能和配置提示。但一开始似乎很复杂。为了更好的性能,有什么可做和不应该使用neo4j 和 ruby​​ 的。

请帮帮我。

0 投票
1 回答
2369 浏览

neo4j - 如何在neo4j中按时间戳过滤边缘?

我有一张表格:

(products:Product)-[:in_stock { updated: timestamp }]->(stock_items:StockItem { quantity: q })-[:stored_at]->(locations:Location)

显然更重要的是,但你明白了要点。stock_item 节点和 in_stock 边经常被添加(位置和产品不是那么多),因此对于这些图表中的每一个,都会有许多这样的关系。我想按时间戳(自 1970 年 1 月 1 日以来的毫秒数)搜索和过滤,只提取最新的(最大值)并返回当前数量。

我不知道如何进行过滤。有任何想法吗?

0 投票
1 回答
160 浏览

ruby - Neo4j Batch Inserts

I used the Neo4j API to batch insert a few million records, which normally would take much longer if done individually. The import finished considerably faster but I do not see the millions of records I inserted. Does Neo4j keep some form of queue for the batch insertions and insert it over time?

If so, how can I see the progress of this queue? I am doing a count and I notice the records are increasing, but at a very slow pace.

I am using the Neography gem's batch insertion (https://github.com/maxdemarzi/neography/wiki/Batch) and the code that does the batch insert is below:

Running Neo4j 2.1.2 enterprise edition on Ubuntu 12.04 LTS.

0 投票
0 回答
112 浏览

ruby - Neo4j 在提供查询后变得非常慢

我有一个中型 Neo4j 数据库,大约有 700000 个节点,每个节点上有 1-5 个传出关系。

如果我使用浏览器界面查询索引属性上的节点并查找相邻节点,大约需要 1500 毫秒,这对我来说很好。

但是,如果我使用 Ruby Neography 库运行类似的 Cypher 查询提及关系,则需要几分钟才能完成。

在那之后,常规的浏览器查询也变得非常慢,每次大约需要两分钟。

我在 64 位 ubuntu 14.04 笔记本电脑上运行实验,8GB 内存和 1GB 堆用于 neo4j。Neo4j 版本是从官方 deb 包安装的 2.1.3。Neography 版本为 1.6.0。我使用 MRI-1.9.3。

当 neo 忙于为查询提供服务时,我使用 kill -3 完成了堆栈转储。 https://gist.github.com/akamaus/a06bc9e04c7209c480e9

任何想法出了什么问题以及如何调查它?

0 投票
2 回答
161 浏览

ruby - 使用execute_query、ruby和neography将大量csv数据读入neo4j

我写了一个快速的 ruby​​ 例程来加载一些非常大的 csv 数据。我对尝试使用 load_csv 所以恢复为 ruby​​ 的各种内存不足问题感到沮丧。我对neo4j 比较陌生,所以尝试Neography 只是调用我创建为字符串的密码查询。

密码代码使用合并来添加 2 个现有节点之间的关系:

我只是遍历运行这些文件中的行。它在大约 30000 行后失败,并出现套接字错误“无法分配请求的地址”。我相信 GC 在某种程度上引起了问题。然而,日志并没有告诉我任何事情。我尝试过以不同方式调整 GC,并尝试不同数量的堆。每次都在同一个地方失败。任何帮助表示赞赏。

[编辑] 更多信息 - 运行 netstat --inet 显示数千个到 localhost:7474 的连接。execute_query 是否没有按设计重用连接,还是这是一个问题?

我现在尝试了参数并且行为是相同的。您将如何使用批处理编码这种查询并确保您使用 npi 上的索引?

0 投票
1 回答
301 浏览

ruby-on-rails - 如何获取节点上的写锁?

我想做这样的事情(红宝石,密码查询):

// 在节点 1 上获取写锁

// 一些先读后写的代码,例如:

// 释放节点 1 上的写锁

根据文档,http ://docs.neo4j.org/chunked/stable/transactions-isolation.html :

默认情况下,除非当前事务中存在本地修改,否则读取操作将读取最后提交的值。默认隔离级别与 READ_COMMITTED 非常相似:读取不会阻塞或占用任何锁,因此可能会发生不可重复读取。可以通过手动获取读写锁来实现更强的隔离级别(如 REPETABLE_READ 和 SERIALIZABLE)。

http://docs.neo4j.org/chunked/stable/transactions.html

可以手动获取节点和关系上的写锁以实现更高级别的隔离(SERIALIZABLE)。

但是没有任何地方提到如何获取锁或如何更改隔离级别。

0 投票
1 回答
70 浏览

search - Neo4j,Neography:让搜索更智能

我一直在使用full-text-indexesNeo4j 图形数据库进行搜索。但万一用户输入错误的拼写或查询不匹配任何结果。在这种情况下,有没有办法处理这个或did you mean某种功能?

此外,如何根据用户正在搜索的查询使搜索更智能?我遇到了SearchKick,但这与neography 没有任何集成。

0 投票
2 回答
93 浏览

ruby - 将 neo4j 与红宝石一起使用

(请,这个问题是关于 NEO4J 的 Ruby 而不是 Ruby on Rails)

我想使用 ruby​​ 和 neo4j 开发一个小型数据库驱动的应用程序,我的问题是关于部署部分,所以,将使用该应用程序的人必须先在他们的计算机上安装 neo4j,或者我可以将它与应用程序一起打包一次?

任何帮助将不胜感激,谢谢。