On Tue, Jul 28, 2009 at 1:48 PM, Edward Yakop<[email protected]> wrote:
> Few questions: > 1. Is it possible for each qi4j module to add named queries. > One use case would be, if the client doesn't require module A, all > named queries associated with module A will not be added. No. Somewhere the Indexing/Querying services are being added. The meta-info is required to be added there. BUT, since I think it is possible for you to retrieve the ServiceDescriptor after the creation of the Model, you can get the MetaInfo object and retrieve the NamedQueries and add to it. Note it is not thread-safe. Alternatively, you keep the NamedQueries instance around and pass it to your assemblers to add their named queries to it. It becomes a bootstrap issue... > 2. Named query syntax validation. Can this be done during application > startup and if the application is in development mode? Well, since Sesame doesn't support the equivalent of PreparedStatement, the syntax is parsed every time as it is. Potentially, we can optimize that parsing by creating the TupleQuery early, but that requires the connection to remain open (often not a problem, but still needs to be 'handled' for network failures). Otherwise, not sure what you are fishing for? > 3. Is it possible to do this without handwritten the query? e.g. Use > query builder API? > e.g. we gained refactoring capabilities. Not error prone and > somewhat future proof, e.g. if we're not going for sparql in the > future. Well, this is the regular Query API you want. Named Query support is only an additional feature, when the current Query API can't support the query given, or for instance when other RDF sources are collaborating in the query (which I think is now possible). >> But for OrderBy, the story is much more complicated, and I have >> currently not reached a satisfactory solution. > > Agree. Perhaps we just have to leave this to the user. > if they supplied handwritten sparql, we can't be expected to know whether > they have done the required "join" to perform order by etcs. So, it seems that both you and Rickard are Ok with this handicapped approach. Cheers -- Niclas Hedhman, Software Developer http://www.qi4j.org - New Energy for Java I live here; http://tinyurl.com/2qq9er I work here; http://tinyurl.com/2ymelc I relax here; http://tinyurl.com/2cgsug _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

