问题标签 [neoeloquent]

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 回答
164 浏览

php - 数据库 [neo4j] 未配置

我想使用NeoEloquent OMG将Lumen PHP 框架连接到 neo4j,但是当我执行这个命令时:

在控制台中出现此消息:

这些是我的配置:

.env

数据库.php

作曲家.json

应用程序.php

我已经在谷歌、stackoverflow 和任何地方搜索以找出这个问题,但我无法解决它。

0 投票
1 回答
307 浏览

rest - Create an api using lumen and neo4j

I want to create an api rest using lumen that it will comunicate with neo4j, for this purpose I'm using NeoEloquent. I've already read the NeoEloquent's documentation but I'm confused. I've understand how lumen it work with a relational database, there is a model, a controller, every action that I want to do on my db pass through a routes that specify the method to use, but I don't understand how this work with a graph database. In particular I don't understand how can I create new label, retrieve all label and relationship using the Http methods. I've try to follow the same procedure that it's explain in this guide (clearly readapting it to my use case) but without success.

Example

Let we say that we have two labels with a many to many relationship, this labels will be Exhibit and Zone. We want to retrieve the zone that is associate to the Exhibit that has a specific identificator. So, the query will be something like this:

For do this query we need to have this routes that it has to present in web.php file:

With this routes we are saying: when come a request with a get method, go inside the ExhibitController class and call the retrieveZone function. This is what is present in controller class:

When we call retrieveZone function, we will call the function findZone as well that is present in Exhibit model:

The Zone class:

This is what I've done for translate the query using NeoEloquent, Lumen and Fastroute, but the result is 500 Internal Server Error.

Stack Trace

0 投票
1 回答
304 浏览

rest - 使用流明检索边缘和关系属性

我是 lumen 和 neo4j 的新手,我想为两个标签之间的特定关系添加一些属性。

例如,如果我们假设Exhibit标签和以坐标属性为特征的区域标签之间存在多对多关系,我如何检索坐标属性?

阅读neoEloquent 文档,我了解到要检索两个标签之间的边缘,我必须遵循函数findZone中存在的过程:

问题是,当我测试这个函数时,结果是一个空响应,但我确信标签之间有一个边缘。

我错了还是 findZone 函数可以在 Cypher 中翻译为这个查询?

编辑

正如用户 Sven Hakvoort 建议我的那样,我有改变

现在响应是 500 内部错误,堆栈跟踪:

0 投票
2 回答
121 浏览

rest - 使用 Lumen 和 NeoEloquent OGM 从 Neo4j 检索 DateTime

语境

我正在创建一个 api rest,它与已经由节点和边填充的图形数据库接口,该节点和边描述了事件和展览在几个以区域为特征的博物馆内的位置。特别是在展览和区域之间存在一些边缘,这些边缘具有开始时间和坐标等属性。开始时间是一个符合DateTime neo4j 格式的属性,下面是一个例子:

我创建边缘的方式是:

其中展览和区域分别是节点 ID。

问题

我想从特定边缘检索 start 属性,但结果如下:

代码

findZone 函数产生问题:

我试图只给边缘坐标属性,当我用坐标函数替换开始属性时。

堆栈跟踪

0 投票
0 回答
206 浏览

laravel - 为什么 laravel 无法打开与 http://localhost:7474/db/data/ 的连接?

我已经以 root 身份安装了 neo4j,除了我的 laravel 应用程序之外,它可以正常运行并且可以从任何地方访问。它给了我错误“无法打开与http://localhost:7474/db/data/的连接”。

然后我删除它并用普通用户重新安装它,但用 sudo sudoer 重新安装它,再次无法访问但状态正在运行。

没有 sudo 我无法安装它。

我的机器是 Digital Ocean 上的 CentOS VPS。我已将 neo4j 的配置身份验证变量设置为 false。

如果有人可以提供帮助将不胜感激。

0 投票
2 回答
35 浏览

laravel - 2 种多对多关系的方式只在 NeoEloquent 的一侧工作

我有 2 个模型,User如下所示:UserGroupManyToMany relashionship

UserGroup.php

User.php

我添加了user一个usergroup这样的:

$u=User::find(myUserId)获取用户,并且$g=UserGroup::find(myGroupId)

而且$g->users()->attach($u)它工作得非常好,当我这样做时$g->users()->get(),它也可以工作。但是当我这样做时,$u->userGoup()->get()它返回一个空array。所以relashionship只在一侧起作用,usergroup->users而不是user->usergroup

0 投票
1 回答
92 浏览

php - 通过在控制器中添加新数据来动态更新验证规则

我正在开发一个基于 Web 的应用程序,技术堆栈是:VueJS,用于表示层,Laravel (PHP)用于RESTFUL API服务,以及一个名为neo4j的基于 nosql 图形的数据库 。这是问题上下文,我有一个名为Post的模型,这里定义的属性是所有帖子类型共享的,所以它们都会有它:

PostType:这里的类型可以是文件链接事件等。例如:[name=>'Event','description'=>'description','slug'=>'event']

最后是CustomField模型:

所以这里是流程: 1 - 在用户第一次打开帖子创建帖子表单的 UI 中,他作为模型fillable属性中定义的要填写的公共字段Post。为此,已经有一个表单请求进行验证,定义如下:

2 - 在同一个表单中,用户type在 a 中有一个字段,该字段<select>ContentType. 一旦他选择了一个类型,另一个就会去检索。请注意,这里的自定义字段意味着,对于一个类型字段以以下格式发送,等等。我使用这些字段属性来动态构建我的,并且一次用户填写表单并在后端服务器中发送数据:我不知道如何处理验证。我首先做的是为我的所有自定义创建一个表单请求,但我想如果不是只是拥有database(throug ajax)Eg : Event,Link,File,...request(ajax)CustomFieldEvent['field_name'=>'name','field_type'=>'string','field_order'=>'1',validation_rules=>'required|max:200']PostType fieldsFront-Endinputs fieldEvent,File and Link Post types我添加 20。我不会创建 20 验证规则。此时我的控制器只知道如何验证“发布”,如下所示:

我想做的是根据来自前端的数据使用新字段和新规则更新现有的 StorePost 验证。所以我不知道如何更新Form Request我的 Requests 文件夹中的现有定义控制器,并基于来自前端的数据创建了基于前端定义和填充字段的新验证规则。我有一个想法,包括基于前端的 posttypes 获取所有 input_fields 验证规则发送给我,然后更新现有的验证规则。

注意:我定义 relashionship 的方式不同,Eloquent因为我使用Neoloquent的是实现neo4j数据库。

0 投票
0 回答
71 浏览

php - Laravel NeoEloquent 相当于 Inner Join

我有这个图表

在此处输入图像描述

绿色节点是答案。

暗玫瑰节点是问题,可能不止一个。

蓝色节点是一个部分,可能不止一个。

最后玫瑰节点是问卷。

我已经从 Vinelab 下载了NeoEloquent,我的问题是我必须得到一份问卷,但我从那里什么也得不到。

我的模特是

部分

问题

回答

我找到了一些从子节点获取父节点的示例,但问题是我必须创建一个获取问卷 ID 并且必须返回所有子节点的 API。

我试过这样的事情。

但这只是给我带来了父问卷,但没有部分,我意识到的另一个解决方案是获取所有节点并通过 foreach 和一些 if 进行制作和排列。

密码等效

match (q:Questionnarie)<-[x]-(y:Section)<-[t]-(n:Question)<-[e]-(p:Answer) where ID(q) = 83 return q,x,y,t,n,e,p

0 投票
0 回答
104 浏览

laravel - 在数据库 laravel-neo4j 中存储会话详细信息

大家好,

我是新手neo4j。我已经构建了一个测试应用程序。这是一个简单的laravel-neo4j用户登录和注册应用程序。一切正常。但我想将会话详细信息存储在数据库中,而不是文件中。所以我尝试了这种方法并得到了Undefined offset: 0错误。所以请帮助我。我已经给出了 docker 的链接和运行它的命令。请运行它并帮助我解决这个问题。现在会话存储在文件中。首先,注册一个帐户,然后使用该帐户登录。谢谢你。

码头工人:https ://drive.google.com/file/d/1q0Cd6QwaVnqyoWeUOHWnodWNCL24MBrj/view?usp=sharing

运行docker文件的命令

网址

前端:http: //0.0.0.0 :8081/

登录:http: //0.0.0.0 :8081/login

注册:http: //0.0.0.0 :8081/register

Neo4j:http://0.0.0.0:8083/ browser /

neo4j 的登录凭据: