631 if eidto is None: |
631 if eidto is None: |
632 # checking constraint for an attribute relation |
632 # checking constraint for an attribute relation |
633 restriction = 'S eid %(s)s, ' + self.restriction |
633 restriction = 'S eid %(s)s, ' + self.restriction |
634 args, ck = {'s': eidfrom}, 's' |
634 args, ck = {'s': eidfrom}, 's' |
635 else: |
635 else: |
636 restriction =rql = 'S eid %(s)s, O eid %(o)s, ' + self.restriction |
636 restriction = 'S eid %(s)s, O eid %(o)s, ' + self.restriction |
637 args, ck = {'s': eidfrom, 'o': eidto}, ('s', 'o') |
637 args, ck = {'s': eidfrom, 'o': eidto}, ('s', 'o') |
638 rql = 'Any %s WHERE %s' % (self.mainvars, restriction) |
638 rql = 'Any %s WHERE %s' % (self.mainvars, restriction) |
639 if self.distinct_query: |
639 if self.distinct_query: |
640 rql = 'DISTINCT ' + rql |
640 rql = 'DISTINCT ' + rql |
641 return session.unsafe_execute(rql, args, ck, build_descr=False) |
641 return session.unsafe_execute(rql, args, ck, build_descr=False) |