Hi Thomas,

thanks for the work (and good to hear the SpieleWiki runs on the new version)! 
We agree and also would prefer the full negation patch. Our current roadmap 
is to finish 1.0 first, which mainly hinges upon the inclusion (or 
reimplementation) of the {{#ask}}-patch and some further fixes (service 
links, Type:Boolean). 

After that, we will go for new releases and new features. I would expect that 
your patch remains compatible for that time -- major changes of querying as 
in 0.7->1.0 are not scheduled so soon. What might be revisited, however, is 
the concrete syntax used for expressing negations. If I can manage to review 
your patch before 1.0, then I will certainly add it right away -- the fact 
that you successfully worked through our Storage API already impresses me 
quite a lot :-) And, given that you are one of the few people who ever 
actually read that code: we are also happy about any suggestions towards 
improving the storage performance.


Btw another possibility to work-around your problem for now could be to filter 
for the respective property values *on printout*. This is inefficient but OK 
as long as the result set is not too large. To do this, one would use a 
templated printout (format="template" template="...") and include an {{#if }} 
into the template that checks the conditions to decide whether or not to 
create any output. Note that one can also use format="template" for printing 
tables by setting intro="{|" and using a template that defines table-rows in 
wiki pipe syntax. It is also possible to use a template call for intro, so as 
to get styling parameters set. Of course it's as ugly as any advanced 
formatting in MediaWiki ...

Regards

Markus


On Dienstag, 20. November 2007, Thomas Bleher wrote:
> * Thomas Bleher <[EMAIL PROTECTED]> [2007-11-15 20:36]:
> > * Thomas Bleher <[EMAIL PROTECTED]> [2007-11-14 08:48]:
> > > 1) Implement negations in queries - then I could ask "(NOT
> > > maxTeilnehmer <= 9) AND (NOT minTeilnehmer >= 11)". I used this
> > > solution with SMW 0.7 (patch below), but looking at the 1.0RC2 code,
> > > I'm not quite sure how to implement it cleanly.
> >
> > I looked at the code again and tried to implement negation support. The
> > patch below adds a <n> </n> pair which negates the query in between. It
> > also adds a SMWNegation class (derived from SMWDescription), which
> > encapsulates the negation.
>
> OK, I took another stab at this, and in my limited tests the code works
> correctly now :)
>
> The code is online at http://pwiki.j-crew.de/wiki/Test, feel free to
> play around with it (it's just a test-wiki).
>
> Technical details:
> To work around the problems with INNER JOINs and negations, all INNER
> JOINs of the form "SELECT a INNER JOIN b ON a.c=b.d" are replaced by
> "SELECT a,b WHERE a.c=b.d". This may not be the most elegant solution,
> but the only workable I found.
>
> To make this work, addJoin now has an additional $where parameter.
>
> Beware: I still don't understand all the internals of query processing,
> so no guarantees for this code. I would really appreciate it if someone
> more knowledgeable than me would look over the code.
>
> Regards,
> Thomas



-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362        fax +49 (0)721 608 5998
[EMAIL PROTECTED]        www  http://korrekt.org

Attachment: pgpOQAo2Y6o9j.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Semediawiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to