equal
deleted
inserted
replaced
152 # XXX remove aggregat from having |
152 # XXX remove aggregat from having |
153 # selection: only vocabulary entity |
153 # selection: only vocabulary entity |
154 for term in select.selection[:]: |
154 for term in select.selection[:]: |
155 select.remove_selected(term) |
155 select.remove_selected(term) |
156 # remove unbound variables which only have some type restriction |
156 # remove unbound variables which only have some type restriction |
157 for dvar in select.defined_vars.values(): |
157 for dvar in list(select.defined_vars.itervalues()): |
158 if not (dvar is filtered_variable or dvar.stinfo['relations']): |
158 if not (dvar is filtered_variable or dvar.stinfo['relations']): |
159 select.undefine_variable(dvar) |
159 select.undefine_variable(dvar) |
160 # global tree config: DISTINCT, LIMIT, OFFSET |
160 # global tree config: DISTINCT, LIMIT, OFFSET |
161 select.set_distinct(True) |
161 select.set_distinct(True) |
162 |
162 |
301 return None |
301 return None |
302 if rel.optional in (opt, 'both'): |
302 if rel.optional in (opt, 'both'): |
303 # optional relation |
303 # optional relation |
304 return ovar |
304 return ovar |
305 if all(rdef.cardinality[cardidx] in '1+' |
305 if all(rdef.cardinality[cardidx] in '1+' |
306 for rdef in rschema.rdefs.values()): |
306 for rdef in rschema.rdefs.itervalues()): |
307 # mandatory relation without any restriction on the other variable |
307 # mandatory relation without any restriction on the other variable |
308 for orel in ovar.stinfo['relations']: |
308 for orel in ovar.stinfo['relations']: |
309 if rel is orel: |
309 if rel is orel: |
310 continue |
310 continue |
311 if _may_be_removed(orel, schema, ovar) is None: |
311 if _may_be_removed(orel, schema, ovar) is None: |