Gang,

I am working on the Named Query support and need a bit of feedback.

I have a bit of a problem whether a "Named Native Query" should be a
"full", "modifiable" or "sub" query of the underlying language.

"full" --> The query is written exactly as to be executed, and will
not be altered in any way. The query author is responsible for
correctness and developer responsible to use it in the right manner.
If this is chosen, then it is no point that the QueryBuilderFactory
returns a Query<type> from a newNamedQuery() method call, but a
Iterable<type> since all the access within the Query are not relevant.

"modifiable" --> The query is written as to be executed, but since
org.qi4j.api.query.Query is a representation of a re-executable query
with 'variables', 'first', 'max' and 'orderBy' alterations possible, I
could locate those clauses in the query and replace the values. There
seems to be no support in Sesame for the equivalent of
PreparedStatement (in SQL) which can be re-used over and over again
with different variables. This is clearly the most complicated case,
since the 'replacer' may misunderstand the query, unless a full SparQL
parser is made.

"semi" --> The query is only written as 'variableList',
'datasetClause' and 'whereClause', whereas the so called
'solutionModifier' is created via Query execution. 'solutionModifier'
must come at the end, making this fairly easy. 'dataSet' refers to the
RDF sources, and would allow NAMED sources other than the actual
Repository used for Qi4j indexing.


Anybody has any thoughts on this?


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

Reply via email to