Hello Axel, > aehm... you won. :-) > It starts to look to me like that nesting in FILTERs doesn't really have > any advantages. Anybody arguments in favor of the FILTERed version? I'd prefer to not rewrite at all a BI query like select ?book ?p1 ?dp1 ?end1 where { ?offer1 :itm ?book ; :price ?p1 . OPTIONAL { ?offer1 :discountPrice ?dp1 ; :endDate ?end1 . filter ((?dp1/?p1 < 0.3) || ASK { ?offer2 :itm ?book ; :price ?p2 . OPTIONAL { ?offer2 :discountPrice ?dp2 ; :endDate ?end2 . filter (?end2 >= ?end1) } filter (?dp1/?p1 < ?dp2/?p2) } } ) } } because the semantics of FILTER in OPTIONAL is "interesting enough": it's hard to move the expression to some other place without affecting cardinality of the result set. Of course it is possible to replace left outer join with UNION but it easily doubles the length of the query for each OPTIONAL, mere 5 OPTIONALs would explode the query 32 times. Best Regards, Ivan Mikhailov OpenLink Software http://virtuoso.openlinksw.comReceived on Tuesday, 26 May 2009 16:19:53 UTC
This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:00:54 UTC