1118 rql = 'DELETE X %s Y WHERE X eid %%(x)s' % rtype |
1118 rql = 'DELETE X %s Y WHERE X eid %%(x)s' % rtype |
1119 else: |
1119 else: |
1120 rql = 'DELETE Y %s X WHERE X eid %%(x)s' % rtype |
1120 rql = 'DELETE Y %s X WHERE X eid %%(x)s' % rtype |
1121 if scleanup: |
1121 if scleanup: |
1122 # source cleaning: only delete relations stored locally |
1122 # source cleaning: only delete relations stored locally |
1123 rql += ', NOT Y cw_source S, S name %(source)s' |
1123 rql += ', NOT (Y cw_source S, S name %(source)s)' |
1124 session.execute(rql, {'x': eid, 'source': sourceuri}, |
1124 try: |
1125 build_descr=False) |
1125 session.execute(rql, {'x': eid, 'source': sourceuri}, |
|
1126 build_descr=False) |
|
1127 except: |
|
1128 self.exception('error while cascading delete for entity %s ' |
|
1129 'from %s. RQL: %s', entity, sourceuri, rql) |
1126 self.system_source.delete_info(session, entity, sourceuri, extid) |
1130 self.system_source.delete_info(session, entity, sourceuri, extid) |
1127 |
1131 |
1128 def locate_relation_source(self, session, subject, rtype, object): |
1132 def locate_relation_source(self, session, subject, rtype, object): |
1129 subjsource = self.source_from_eid(subject, session) |
1133 subjsource = self.source_from_eid(subject, session) |
1130 objsource = self.source_from_eid(object, session) |
1134 objsource = self.source_from_eid(object, session) |