我知道 Neo4j 在创建时需要一个关系方向,但允许在查询时忽略这个方向。通过这种方式,我可以查询我的图形而忽略关系方向。
我还知道,对于关系自然是双向或非定向的情况,有一些解决方法,如此处所述。
我的问题是:为什么以这种方式实施?有充分的理由在创建时不允许非定向或双向关系吗?这是数据库架构的限制吗?
不允许使用如下 Cypher 语句:
CREATE ()-[:KNOWS]-()
CREATE ()<-[:KNOWS]->()
Run Code Online (Sandbox Code Playgroud)
我在网上搜索了答案,但没有找到太多答案。例如,这个 github 问题。
必须为没有关系的人定义关系方向,这很奇怪。在我看来,我正在损害我的图表的语义。
编辑 1:
澄清我对“语义问题”的立场(也许这个词是错误的):
假设我运行这个简单的CREATE语句:
CREATE (a:Person {name:'a'})-[:KNOWS]->(b:Person {name:'b'})
Run Code Online (Sandbox Code Playgroud)
结果我有这个非常简单的图表:
该:KNOWS关系有一个方向,只是因为Neo4j的要求在创建时的关系方向。在我的领域a知道b和b知道a。
现在,一个新的团队成员将使用这个 Cypher 查询来查询我的图表:
MATCH path = (a:Person {name:'a'})-[:KNOWS]-(b:Person {name:'b'})
return path
Run Code Online (Sandbox Code Playgroud)
这个新的团队成员不知道,当我创建这个图时,我认为这种:KNOWS关系是没有方向的。他将看到的结果是一样的:
根据结果,这个新团队成员可以认为只有 Person a 考虑知道 Person b。在我看来很糟糕。不适合你?这有意义吗?
我正在学习JavaScript Fetch API,我对Promises有点困惑.
考虑这个在控制台中打印"ok"的虚拟示例:
fetch(".")
.then(function(response) { // first then() call
return response;
}).then(function(response) { // second then() call
console.log("ok");
});
Run Code Online (Sandbox Code Playgroud)
有关Fetch API 的响应对象的页面说:
fetch()调用返回一个promise,该promise使用与资源获取操作关联的Response对象解析.
好吧,既然fetch()返回一个Promise对象,我可以理解第一个then()调用工作正常,因为Promise对象有这个方法.但链接调用中返回的Response对象不是Promise对象.然而,then()方法的第二次调用工作!
改变虚拟示例打印undefined在第一个console.log():
fetch(".")
.then(function(response) { // first then() call
console.log(response.then)
return response;
}).then(function(response) { // second then() call
console.log("ok");
});
Run Code Online (Sandbox Code Playgroud)
我的问题是:为什么这有效?then()自返回对象以来第二次调用如何工作没有这个方法?它是一种语法糖吗?
谢谢!
我正在尝试以下查询,
start n=node(*) match (n)-[r]->(m) return count(r)
我不确定这个查询是否正确。
我们想创建一个非常慢的查询来在我们的应用程序中测试它.有没有办法让Neo4j查询持续一段特定的秒数?
我试图从视图模型中的模型绑定选择器的值,在那里我得到模型的路径而不是值.
<Picker x:Name="LocationPicker"
Title="Location" HeightRequest="40"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
SelectedItem="{Binding Location}"
ItemsSource="{Binding MaintainRoomTypes}"/>
Run Code Online (Sandbox Code Playgroud)
这是我的视图模型代码:
if (jobDetailsForFitter != null)
{
WindowDetails = new WindowDetailsModel
{
Windows = jobDetailsForFitter.Windows,
Locations = jobDetailsForFitter.Locations,
RoomTypes = jobDetailsForFitter.RoomTypes,
AddFiles = jobDetailsForFitter.AddFiles
};
Locations = jobDetailsForFitter.Locations;
MaintainRoomTypes = jobDetailsForFitter.RoomTypes;
await FitterService.Instance.LoadJobDetailsToLocalStore(jobDetailsForFitter, SelectedJob?.Id ?? 0);
}
Run Code Online (Sandbox Code Playgroud)
如何绑定itemsource以获取列表.
public List<Room> Locations { get; set; }
public List<RoomTypeModel> RoomTypes { get; set; }
Run Code Online (Sandbox Code Playgroud) “可变长度关系”部分让我感到困惑。
这个例子:
MATCH (martin { name: 'Charlie Sheen' })-[:ACTED_IN*1..3]-(movie:Movie)
RETURN movie.title
返回 3 行,其中重复出现“美国总统”。
如果我将 3 更改为 2,则仅返回一行“华尔街”。这是为什么?minHops该部分中的和是什么意思maxHops?
我几天前下载了Ionic 3,当我尝试使用的每个离子命令(离子信息,离子发射,离子启动等)之后,昨天突然出现这个错误,一切正常.
{FatalException错误(C:\ Users\X\AppData\Roaming \npm \node_modules\ionic \node_modules\@ionic\cli-utils\dist\lib\errors.js:8:23)在FatalException(C:在Config上的\ Users\X\AppData\Roaming \npm \node_modules\ionic \node_modules\@ionic\cli-utils\dist\lib\errors.js:17:9).(C:\ Users\X\AppData\Roaming \npm \node_modules\ionic \node_modules\@ionic\cli-utils\dist\lib\config.js:41:31)throw(native)at rejected(C:\ Users\X\AppData\Roaming \npm \node_modules\ionic \node_modules\@ionic\cli-utils\dist\lib\config.js:5:65)name:'Exception',exitCode:1,fatal:true}
我试图删除离子和cordova并使用我在网上找到的许多不同说明重新安装多次:
npm uninstall cordova ionic
npm cache clean -f
npm install npm -g
npm uninstall node
apt-get purge npm
apt-get install npm
npm install node -g
Run Code Online (Sandbox Code Playgroud)
我也试图删除并重新安装节点,但这个错误保留在我试过的每个版本的离子3.XX.另一方面,离子2工作得很好.任何想法可能导致了什么以及如何解决它?
我正在使用:
我正在建立SSL连接(作为客户端),根据这篇Oracle文章,如果您使用TLSv1.2并启用强制版本的管辖区策略,则JDK7中将支持以下两种cypher诉讼.
但是,在进行安全连接时会忽略两个密码算法.
Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
**Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384**
Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256
**Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256**
Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA256
Allow unsafe renegotiation: false …Run Code Online (Sandbox Code Playgroud) 如果有更优雅的方式吗?
if (err.code === 'CONFLICT-GROUP-GENERAL' ||
err.code === 'CONFLICT-USER-GENERAL' ||
err.code === 'CONFLICT-FORM-GENERAL' ||
err.code === 'CONFLICT-PROJECT-GENERAL' ||
err.code === 'CONFLICT-TEMPLATE-GENERAL') {}
Run Code Online (Sandbox Code Playgroud) neo4j ×5
cypher ×4
javascript ×2
cordova ×1
es6-promise ×1
fatal-error ×1
ionic3 ×1
java-7 ×1
npm ×1
promise ×1
ssl ×1
xamarin ×1