[xwiki-devs] [RFC] XWiki Query Language
Hi, devs. I'm working on JCRStore and QueryPlugin and I want to get some feedback about http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query+Language+Specificatio... 1. Why our QueryPlugin's xpath isn't sufficient? (except it doesn't work now and some features are unimplemented :)) 2. Are we sure to use sql-like query language? I think sql isn't user friendly language. Also many features of sql (such as joins) is impossible for JCR. 3. What user query language would you prefer for xwiki? -- Artem Melentyev
On Fri, 16 May 2008 01:10:31 +0600, Artem Melentyev wrote
Hi, devs.
I'm working on JCRStore and QueryPlugin and I want to get some feedback about http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query+Language+Specificatio...
just my 2 cents:
1. Why our QueryPlugin's xpath isn't sufficient? (except it doesn't work now and some features are unimplemented :)) 2. Are we sure to use sql-like query language? I think sql isn't user friendly language. Also many features of sql (such as joins) is impossible for JCR.
Fir other side: sql is more user-friendly them xpath.
3. What user query language would you prefer for xwiki?
I prefer something similar to JPA Object query language, according to some (ideal, unexistend) O/R mapping.
-- Artem Melentyev
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
-- Ruslan Shevchenko GradSoft. http://www.gradsoft.ua
rssh wrote:
On Fri, 16 May 2008 01:10:31 +0600, Artem Melentyev wrote
Hi, devs.
I'm working on JCRStore and QueryPlugin and I want to get some feedback about http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query+Language+Specificatio...
just my 2 cents:
1. Why our QueryPlugin's xpath isn't sufficient? (except it doesn't work now and some features are unimplemented :)) 2. Are we sure to use sql-like query language? I think sql isn't user friendly language. Also many features of sql (such as joins) is impossible for JCR.
Fir other side: sql is more user-friendly them xpath.
3. What user query language would you prefer for xwiki?
I prefer something similar to JPA Object query language, according to some (ideal, unexistend) O/R mapping.
I'm not sure we can be compliant with a O/R mapping. Also we probably have some specificities in the Document/Object relationship for which the QL could become complicated unless we use some internal shortcuts in our language specification. I'm for a SQL type languages that is simplified to the maximum based on our entities. Ludovic -- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
Artem Melentyev wrote:
Hi, devs.
I'm working on JCRStore and QueryPlugin and I want to get some feedback about http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query+Language+Specificatio...
1. Why our QueryPlugin's xpath isn't sufficient? (except it doesn't work now and some features are unimplemented :))
I think xpath is way to complicated to write. You always forget what the first and second and third /*/ means.
2. Are we sure to use sql-like query language?
SQL is actually use friendly. It is quite natural. We should use as little joins as possible. We should be able to use subqueries. If the underlying storage does not support it we can run it ourselves. Lot's of developers are already familiar with SQL so it's a path which allows them to easily use our language. I think a query language similar to the GQL in Google AppEngine could be cool.
I think sql isn't user friendly language. Also many features of sql (such as joins) is impossible for JCR.
It's ok if we don't have all joins.
3. What user query language would you prefer for xwiki?
SQL like languague with no joins necessary for 95% of the queries Ludovic -- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
Hi Artem, On May 15, 2008, at 9:10 PM, Artem Melentyev wrote:
Hi, devs.
I'm working on JCRStore and QueryPlugin and I want to get some feedback about http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query+Language+Specificatio...
1. Why our QueryPlugin's xpath isn't sufficient? (except it doesn't work now and some features are unimplemented :))
Using xpath would be definitely easier to implement. However I agree it's not very user-friendly.
2. Are we sure to use sql-like query language? I think sql isn't user friendly language.
SQL-like is going to be quite hard to implement (we'll need to use a JavaCC or Antlr grammar) but it's probably slightly more user- friendly, but not perfect either. The hard part is going to ensure that the grammar is complete IMO and the mapping with the underlying storage implementation (JCR or Hibernate).
Also many features of sql (such as joins) is impossible for JCR.
In that case, we should probably make our query module generic and independent of the storage module. Then the SPI implementations for the given storage modules can restrict what's allowed and what's not allowed maybe? The mapping is really going to be the hard part.
3. What user query language would you prefer for xwiki?
I think we should offer an even simpler DSL for querying objects and object properties in xwiki documents that can be used by non developers. Either something like http://code.xwiki.org/xwiki/bin/view/Macros/RequestStructuredDocumentsMacro or a generic query language but very simple and working only on documents, objects and classes. More generally: I'd really like that we have a design that supports multiple query languages by having a QueryManager component designed like http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/query/QueryManage... In that way we could support XPath, SQL and the new query language we're talking about. I sent the following mail below on September 2007 about this but I couldn't find it on nabble or markmail so maybe it never reached the list for some reason: ===start here==================== Hi, I'd like to start designing the v2 of the Storage/Query API. Current issues: ============= * Current XWikiStoreInterface is too broad, having business methods for anything that can retrieved from the store. * Business methods should be located in the Model. For example, getDocumentNames() should be located in the Wiki object representing a wiki. * There's currently no object for manipulating queries so there are lots of duplications Requirements: ============ * Solve current issues listed above * The store interface should be simple and have a minimal number of method. I can imagine one for now: List executeQuery(Query query); * It should allow for new query languages and support the current HQL syntax Proposal: ======== * Create a new module in core called xwiki-store * Use the new component model * Have the following classes/interfaces in it: - Store List executeQuery(Query) - HibernateStore: implementation of Store for Hibernate - CacheStore: caching implementation of Store - Query (interface) - HibernateQuery: implementation of Query for HQL - (later) JCRQuery: implementation of Query for JCR Usage: ====== HibernateQuery query = new HibernateQuery("select * from ...."); query.addParameter(index, value); // for named HQL queries List results = store.execute(query); Notes: ====== * This proposal is backward compatible with current code * Slowly move current code to use the new code, deprecating methods/ classes as we progress * There are some overlaps with the query plugin
On Thu, May 15, 2008 at 9:10 PM, Artem Melentyev <amelentev@gmail.com> wrote:
Hi, devs.
I'm working on JCRStore and QueryPlugin and I want to get some feedback about http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query+Language+Specificatio...
1. Why our QueryPlugin's xpath isn't sufficient? (except it doesn't work now and some features are unimplemented :)) 2. Are we sure to use sql-like query language? I think sql isn't user friendly language.
For me XPath is way more clear and logical than SQL like language but I agree that only programmer can think that way ;)
Also many features of sql (such as joins) is impossible for JCR. 3. What user query language would you prefer for xwiki?
Agree with Vincent about a very simple XWiki Query language and be able to support multiple query languages. In fact I think we should support XPath as we already support it even if we choose to desing our complete XWiki Query language.
-- Artem Melentyev
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
Would be great also to have something like JLINQ (If I remember well Vincent already written something about JLINQ in a previous mail) to make query from plugins/components. On Sat, May 17, 2008 at 12:18 PM, Thomas Mortagne <thomas.mortagne@xwiki.com> wrote:
On Thu, May 15, 2008 at 9:10 PM, Artem Melentyev <amelentev@gmail.com> wrote:
Hi, devs.
I'm working on JCRStore and QueryPlugin and I want to get some feedback about http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query+Language+Specificatio...
1. Why our QueryPlugin's xpath isn't sufficient? (except it doesn't work now and some features are unimplemented :)) 2. Are we sure to use sql-like query language? I think sql isn't user friendly language.
For me XPath is way more clear and logical than SQL like language but I agree that only programmer can think that way ;)
Also many features of sql (such as joins) is impossible for JCR. 3. What user query language would you prefer for xwiki?
Agree with Vincent about a very simple XWiki Query language and be able to support multiple query languages. In fact I think we should support XPath as we already support it even if we choose to desing our complete XWiki Query language.
-- Artem Melentyev
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
-- Thomas Mortagne
Hi there,
I'm working on JCRStore and QueryPlugin and I want to get some feedback
about http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query +Language+Specification
1. Why our QueryPlugin's xpath isn't sufficient? (except it doesn't work now and some features are unimplemented :))
Actually, interestingly enough, after looking for a few secs at xpath and understanding a bit better how it works (thanks Wikipedia) I found it easy to understand. Provided users can find a treeview of how XWiki underlying elements work involved on XWiki.org it could be easy to use... In fact, rather than the query language itself I think the main issue for people starting to use XWiki is that it's hard to find what exactly are the XWiki elements (object, classes, etc) and how to build queries around them. Having various query languages is great because developers can use the one that they are the most familiar with. But for XWiki beginners what is really needed is a clear documentaiton page saying something like : "If you want to query property A from object B in space C here are the XWiki bits involved : - in hql : BaseObject, doc.web, prop.id.id (or whatever) - in xpath : /*/*[space/Main/ and and obj/XWiki/XWikiUsers/@xp:email like 'XXX']" providing examples, explanations, and so on... As a XWiki beginner I don't even know what a query language is, yet I may want to build applications -> I need to know how I should go about doing this. Having an automated query builder might be the best answer to this issue though...
2. Are we sure to use sql-like query language? I think sql isn't user friendly language.
For me XPath is way more clear and logical than SQL like language but I agree that only programmer can think that way ;)
Not necessarily ;-) Guillaume
On May 17, 2008, at 12:50 PM, Guillaume Lerouge wrote:
Hi there,
I'm working on JCRStore and QueryPlugin and I want to get some feedback
about http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query +Language+Specification
1. Why our QueryPlugin's xpath isn't sufficient? (except it doesn't work now and some features are unimplemented :))
Actually, interestingly enough, after looking for a few secs at xpath and understanding a bit better how it works (thanks Wikipedia) I found it easy to understand. Provided users can find a treeview of how XWiki underlying elements work involved on XWiki.org it could be easy to use...
In fact, rather than the query language itself I think the main issue for people starting to use XWiki is that it's hard to find what exactly are the XWiki elements (object, classes, etc) and how to build queries around them.
Having various query languages is great because developers can use the one that they are the most familiar with. But for XWiki beginners what is really needed is a clear documentaiton page saying something like :
"If you want to query property A from object B in space C here are the XWiki bits involved :
- in hql : BaseObject, doc.web, prop.id.id (or whatever) - in xpath : /*/*[space/Main/ and and obj/XWiki/XWikiUsers/ @xp:email like 'XXX']"
providing examples, explanations, and so on... As a XWiki beginner I don't even know what a query language is, yet I may want to build applications -> I need to know how I should go about doing this.
This is what we started doing on http://platform.xwiki.org/xwiki/bin/view/DevGuide/APIGuide Thanks -Vincent
Having an automated query builder might be the best answer to this issue though...
2. Are we sure to use sql-like query language? I think sql isn't user friendly language.
For me XPath is way more clear and logical than SQL like language but I agree that only programmer can think that way ;)
Not necessarily ;-)
Guillaume
On May 17, 2008, at 12:36 PM, Thomas Mortagne wrote:
Would be great also to have something like JLINQ (If I remember well Vincent already written something about JLINQ in a previous mail) to make query from plugins/components.
yes, the one I had seen was quaere: http://quaere.codehaus.org/ The only problem is that it's not very active: http://fisheye.codehaus.org/browse/quaere -Vincent
On Sat, May 17, 2008 at 12:18 PM, Thomas Mortagne <thomas.mortagne@xwiki.com> wrote:
On Thu, May 15, 2008 at 9:10 PM, Artem Melentyev <amelentev@gmail.com> wrote:
Hi, devs.
I'm working on JCRStore and QueryPlugin and I want to get some feedback about http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query+Language+Specificatio...
1. Why our QueryPlugin's xpath isn't sufficient? (except it doesn't work now and some features are unimplemented :)) 2. Are we sure to use sql-like query language? I think sql isn't user friendly language.
For me XPath is way more clear and logical than SQL like language but I agree that only programmer can think that way ;)
Also many features of sql (such as joins) is impossible for JCR. 3. What user query language would you prefer for xwiki?
Agree with Vincent about a very simple XWiki Query language and be able to support multiple query languages. In fact I think we should support XPath as we already support it even if we choose to desing our complete XWiki Query language.
Hi, devs.
I'm working on JCRStore and QueryPlugin and I want to get some feedback about http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query+Language+Specificatio...
1. Why our QueryPlugin's xpath isn't sufficient? (except it doesn't work now and some features are unimplemented :)) 2. Are we sure to use sql-like query language? I think sql isn't user friendly language. Also many features of sql (such as joins) is impossible for JCR.
XPath makes a lot of sense and user friendliness if we ignore its (scary) name: if we look at a wiki as a file system, XPath is perfectly usable as a file system path referencing: all data would be nodes, all metadata would be attributes. I think that, put this way, besides being clear as daylight for developers (as Thomas mentioned), it can also be easily understandable by users (as Guillaume proved). Besides that, since it is based only on a few simple rules (once axis implemented), we would be exposing less unimplemented features to the user than with our own, sql-like-but-not-quite-sql query language. As well, an XPath query language would allow us to implement the support of sheets (currently Velocity code or Groovy code) as XSL Sheets, using the wiki as one big input document. I know I would definitely love this 'feature'. Of course, I agree that SQL might be a little more natural or easier for users / developers, but I think its popularity and it being here for a longer time than XPath has much to do with it.
3. What user query language would you prefer for xwiki?
3. so I'm for full, clean XPath Happy coding! Anca Luca
-- Artem Melentyev
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
Hi, devs. Thanks for feedback. There are important info from JCR v2 [1] unfinished standard (Public Review. Final release at Sep-2008): http://wiki.apache.org/jackrabbit/Proposed_JCR_2%2e0_API_Changes - xpath & jcrsql are deprecated in jcr2, but supported + new language JCR-SQL2 which is much extended jcrsql with joins. + new Java API for quering called QueryObjectModel (JCR-JQOM) (like Hibernate Criteria or LINQ) recent Jackrabbit 1.4 already has this features, but they are not stable yet. eXoJCR hasn't this features yet. Jackrabbit has a parser [2] from JCR-SQL2 to JCR-JQOM, so we can simply translate some subset of QOM to HQL. What else parsers / query frameworks can you recommend? I looked at some jpa, jdo ql implementations but they are not expose nice Query Model for reuse. [1] http://www.jcp.org/en/jsr/detail?id=283 [2] http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/core/query/sql2/P... Artem Melentyev wrote:
Hi, devs.
I'm working on JCRStore and QueryPlugin and I want to get some feedback about http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query+Language+Specificatio...
1. Why our QueryPlugin's xpath isn't sufficient? (except it doesn't work now and some features are unimplemented :)) 2. Are we sure to use sql-like query language? I think sql isn't user friendly language. Also many features of sql (such as joins) is impossible for JCR. 3. What user query language would you prefer for xwiki?
-- Artem Melentyev
Hi Artem, That's some news indeed! What's important IMO is that we agree to have a generic Query Interface as I mentioned in some previous email. In that manner we can continue to use HQL + introduce new query languages. This is good for extensibility and also for backward compatibility. Do you/we all agree on this? Thanks -Vincent On May 21, 2008, at 9:57 PM, Artem Melentyev wrote:
Hi, devs.
Thanks for feedback.
There are important info from JCR v2 [1] unfinished standard (Public Review. Final release at Sep-2008): http://wiki.apache.org/jackrabbit/Proposed_JCR_2%2e0_API_Changes - xpath & jcrsql are deprecated in jcr2, but supported + new language JCR-SQL2 which is much extended jcrsql with joins. + new Java API for quering called QueryObjectModel (JCR-JQOM) (like Hibernate Criteria or LINQ)
recent Jackrabbit 1.4 already has this features, but they are not stable yet. eXoJCR hasn't this features yet.
Jackrabbit has a parser [2] from JCR-SQL2 to JCR-JQOM, so we can simply translate some subset of QOM to HQL.
What else parsers / query frameworks can you recommend? I looked at some jpa, jdo ql implementations but they are not expose nice Query Model for reuse.
[1] http://www.jcp.org/en/jsr/detail?id=283 [2] http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/core/query/sql2/P...
Artem Melentyev wrote:
Hi, devs.
I'm working on JCRStore and QueryPlugin and I want to get some feedback about http://dev.xwiki.org/xwiki/bin/view/Design/XWiki+Query+Language+Specificatio...
1. Why our QueryPlugin's xpath isn't sufficient? (except it doesn't work now and some features are unimplemented :)) 2. Are we sure to use sql-like query language? I think sql isn't user friendly language. Also many features of sql (such as joins) is impossible for JCR. 3. What user query language would you prefer for xwiki?
-- Artem Melentyev _______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
participants (7)
-
ancapaula.luca@xwiki.com -
Artem Melentyev -
Guillaume Lerouge -
Ludovic Dubost -
rssh -
Thomas Mortagne -
Vincent Massol