OrientDb检查边是否存在

时间:2015-08-02 23:55:12

标签: sql graph orientdb

在OrientDB Studio中我试图编写一个函数来检查两个顶点之间是否存在边。如果查询找到命中,则应该返回true,如果没有命中则返回false。每个顶点在embeddedSet中都有一个唯一的URL。这是用于标识顶点的字段。

如何查询边缘?如何返回真或假边缘?

如果我知道RID,则此代码有效。

select from E where (in = #14:29 and out = #15:15) OR (in = #15:15 and out = #14:29);

只要urlSet字段不是url,此代码就可以工作。

select from E where out IN (select from v where urlSet contains 'A') and in IN (select from v where urlSet contains 'B');

当我尝试使用此代码搜索网址时

select from E where out IN (select from v where urlSet contains 'https:\/\/url1.com/a/something') and in IN (select from v where urlSet contains 'https:\/\/url2.com/b/something');

我收到此错误:

  

com.orientechnologies.orient.core.sql.OCommandSQLParsingException:在位置#35处解析命令时出错:无效关键字'FROM'命令:从E中选择IN IN(从v中选择urlSet包含'https:// url1 .com / a / something')和IN(从v中选择urlSet包含'https://url2.com/b/something'); ------------------------------------------- ^

0 个答案:

没有答案