org.ow2.weblab.util
Class WebLabQueryParser

java.lang.Object
  extended by org.ow2.weblab.util.WebLabQueryParser
Direct Known Subclasses:
SimpleQueryParser, SolrQueryParser

public abstract class WebLabQueryParser
extends java.lang.Object


Constructor Summary
WebLabQueryParser()
           
 
Method Summary
abstract  java.lang.String getComposedRequest(org.ow2.weblab.core.model.ComposedQuery q, org.ow2.weblab.core.helper.ResourceHelper hlpr)
          Build a string query based on the content of a ComposedQuery.
abstract  boolean getOrder(org.ow2.weblab.core.model.Query q, org.ow2.weblab.core.helper.ResourceHelper hlpr)
          Test if the property ASCENDENT_ORDERING_MODE_EXPECTED is set to true.
abstract  java.lang.String getOrderBy(org.ow2.weblab.core.model.Query q, org.ow2.weblab.core.helper.ResourceHelper hlpr)
          Test if the property TO_BE_ORDERED_BY exists on the query and get its value if applicable.
abstract  java.lang.String getRequest(org.ow2.weblab.core.model.Query q, org.ow2.weblab.core.helper.ResourceHelper hlpr)
          Build a string request based on the content of a Query.
abstract  java.lang.String getRequestWithScope(org.ow2.weblab.core.model.Query q, org.ow2.weblab.core.helper.ResourceHelper hlpr)
          Extract the request from the StringQuery possibly using the property HAS_SCOPE to restrict request scope and adapt syntax.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebLabQueryParser

public WebLabQueryParser()
Method Detail

getRequest

public abstract java.lang.String getRequest(org.ow2.weblab.core.model.Query q,
                                            org.ow2.weblab.core.helper.ResourceHelper hlpr)
                                     throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Build a string request based on the content of a Query.

Parameters:
q - a Query
hlpr - a JenaResourceHelper initialized on the Query
Returns:
the request as a string
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException

getComposedRequest

public abstract java.lang.String getComposedRequest(org.ow2.weblab.core.model.ComposedQuery q,
                                                    org.ow2.weblab.core.helper.ResourceHelper hlpr)
                                             throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Build a string query based on the content of a ComposedQuery. This method is for now limited to simple composition (ie one level ComposedQuery) and only accepting StringQuery as sub- queries.

Parameters:
q - the ComposedQuery
hlpr - a JenaResourceHelper initialized on the ComposedQuery
Returns:
the composed request as a string
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException

getRequestWithScope

public abstract java.lang.String getRequestWithScope(org.ow2.weblab.core.model.Query q,
                                                     org.ow2.weblab.core.helper.ResourceHelper hlpr)
                                              throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Extract the request from the StringQuery possibly using the property HAS_SCOPE to restrict request scope and adapt syntax.

Parameters:
q - a StrinQuery
Returns:
the request as a String
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException

getOrderBy

public abstract java.lang.String getOrderBy(org.ow2.weblab.core.model.Query q,
                                            org.ow2.weblab.core.helper.ResourceHelper hlpr)
                                     throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Test if the property TO_BE_ORDERED_BY exists on the query and get its value if applicable.

Parameters:
q - a StrinQuery
Returns:
The URI of the property to be used for ordering or null if empty.
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException

getOrder

public abstract boolean getOrder(org.ow2.weblab.core.model.Query q,
                                 org.ow2.weblab.core.helper.ResourceHelper hlpr)
                          throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Test if the property ASCENDENT_ORDERING_MODE_EXPECTED is set to true.

Parameters:
q - a StrinQuery
Returns:
true of false, the value of the property (default is false)
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException


Copyright © 2004-2012. All Rights Reserved.