1

我需要这个 xpath 查询的 jackrabbit sql 2 等效查询

xpath = "/jcr:root//institutes/institute[*]/(@title | @overallScore)"

我已经为 sql2 准备好了这个,我可以'/IN/institues/institute'通过使用 ISCHILDNODE() 约束来获得

但我想以这种方式归还所有研究所'/%/institutes/institute'。如果我可以使用加入来实现这一点,请让我知道完整的声明

当前我正在使用此查询,但没有成功

参考:参考链接

sql2 = "SELECT institute.title, institute.overallScore FROM [nt:unstructured] AS country "
            + "INNER JOIN [nt:unstructured] AS institutes ON ISCHILDNODE(institutes, country) "
            + "INNER JOIN [nt:unstructured] AS institute ON ISCHILDNODE(institute, institutes) "
            + "WHERE NAME(institutes) = 'institutes' ORDER BY institute.overallScore DESC";

我还发现 PATH() like 没有在 jackrabbit 中实现

4

1 回答 1

0

我自己没有测试它,我不确定它是否有效,但是这个查询应该可以工作:

select b.[jcr:path] as [jcr:path], 
       b.[title] as [title], 
       b.[overallScore] as [overallScore] 
from [nt:base] as a 
inner join [nt:base] as b on ischildnode(b, a) 
where name(a) = 'institutes' 
and name(b) = 'institute'
于 2014-01-14T07:54:35.390 回答