It would be really great to have a way to save results (and queries). As I
already mentioned, I try to set up a system where users can interactively fill
in values into pre-defined #ask queries by using userfriendly forms.

If for example a form allows to select a country and the start and end year of a
 time period to select articles describing events (maybe earthquakes in an
earthquake wiki) which happened in that country during that time, it is easy to
query for events e.g. in Germany between 1920 and 1935.

But what if someone wants events which happened in Germany between 1920 and 1935
and between 1970 and 1980 as well as in France between 2000 and 2005? This
flexibility is difficult with such predefined forms. I suppose it wouldn't be
too difficult to write an #ask query in Special:Ask specifically for such a
query if one is familiar with the syntax but for normal users it would probably
be too complex to get it right.

I started to extended my SMW installation to allow to specify a name for a query
and the result is stored in a separate database table under that name. One can
execute a query form repeatedly and specify if a new result should be combined
with the previous result (either by union or intersect or simply replace it) and
than the result is stored again. That allows (for the above example) to simply
execute the query three times and select in the form each time different
paramters (Germany/1920/1935, Germany/1970/1980, France/200/2005) and define
during the second and third execution that the result set should be added to the
previous result. 

In another form one could query events by their strength and than combine that
result by intersection with the combined result from the first form to get only
strong or weak events during that time periods in that countries. 
That possibility to combine results makes it quite flexible even with simple
predefined forms/queries and a user can ask more complex questions in several
steps (a bit like the 'drill down' principle also used by Yaron Koren in his
Semantic Drilldown extension or (in a non-wiki context) by Biomart on 
ensembl.org).

It is however not always easy to keep such modifications working through new SMW
releases and therefore having an official way to save queries and results would
be much more preferable.
Gu

>Quoting Markus Krötzsch <[EMAIL PROTECTED]>:
> > On Dienstag, 22. April 2008, Sergey Chernyshev wrote:
> > It brings the question of savable queries - I wrote about this idea in
> > context of performance if you remember. In two words, it might make sense
> > to create special namespace for saved queries - where each page will
> define
> > a query and then that page serves as a name shortcut that can be used
> > instead of the full syntax. I use this approach in my Widgets extension:
> > http://www.mediawiki.org/wiki/Extension:Widgets - SMW can use it in
> various
> > places, e.g. as argument to {{#ask}} (instead of full query), as arguments
> > to RSS/iCal and other exporters and so on. This will relief developers
> from
> > URL issues (and also as I mentioned in last post, might be usable for
> > restricting querying functionality if combined with namespace
> permissions).
> >
> > Let me know what you think - I'll be happy to discuss in more detail if
> > needed.
> 
> I think that would be feasible, but I also hear concerns from people saying 
> that SMW gets too large/complex. I am not sure what would be best. Another 
> option for short URIs would be to create an internal ID for queries that is 
> then used instead of the lengthy query in URL parameters. That would also be 
> useful for caching query results, but it does not have the extra control 
> feature (namespace permission -- btw. how would I best do that? We still did 
> not open talk pages on s-mw.org :-( ). On the other hand, it safes you a 
> namespace, and adding a namespace for queries that are then transcluded is 
> always possible anyway if that kind of control is desired (this just fails 
> for Special:Ask, but again the cached query ID would solve that too). We 
> would just need to restrict SMW queries to certain namespaces.



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to