Hi Sam,

JCR 2.0 supports storing queries as nodes, but not any of the fancy features
you are asking for.

Here is the appropriate section in the spec:

http://www.day.com/specs/jcr/2.0/6_Query.html#6.9.7%20Stored%20Query

Mark Adamcin
Acquity Group



On Wed, Jul 13, 2011 at 4:07 PM, sam web scale expert <[email protected]>wrote:

> Is there query api that builds query from resources?
> Since a resource is a tree, I was thinking I could express query as a
> resource (a tree):
>
> GET /query/foo.json
>
> will return the query result of foo as json. The query is structured in
> /query/foo  tree.
>
> /query/foo/@searchRoot = "/content/diaries"
> /query/foo/or/has/@bar = True
> /query/foo/or/has/@author = True
> /query/foo/or/and/is/@publishDate = 2011-07-03 00:00:00
> /query/foo/or/and/is/@cateogry = "secret"
> ...
> would build:
> /jcr:root/content/diaries//*[(@bar and @author) or (@publishDate =
> '2011-07-03 00:00:00' and @category = 'secret')]
>
>
> Is there something like this?
> If not, would having this kind of API be useful?
> I know I can just store xpath as a property in a node... But since xpath is
> deprecated in JCR 2.0, I was wondering if it could be useful to store query
> in a resource somehow.
>
> It's like prepared queries.. in a way.
> And the resource might even cache query results and run the query only when
> needed to.
>

Reply via email to