diff --git a/application/database/db.py b/application/database/db.py index 3e4c0b293..7e0e9f87b 100644 --- a/application/database/db.py +++ b/application/database/db.py @@ -422,17 +422,17 @@ def link_CRE_to_Node(self, CRE_id, node_id, link_type): @classmethod def gap_analysis(self, name_1, name_2): base_standard = NeoStandard.nodes.filter(name=name_1) - + blacklist = [["Cross-cutting concerns"]] path_records_all, _ = db.cypher_query( """ OPTIONAL MATCH (BaseStandard:NeoStandard {name: $name1}) OPTIONAL MATCH (CompareStandard:NeoStandard {name: $name2}) OPTIONAL MATCH p = shortestPath((BaseStandard)-[*..20]-(CompareStandard)) WITH p - WHERE length(p) > 1 AND ALL(n in NODES(p) WHERE n:NeoCRE or n = BaseStandard or n = CompareStandard) + WHERE length(p) > 1 AND ALL(n in NODES(p) WHERE (n:NeoCRE or n = BaseStandard or n = CompareStandard) AND NOT n.name in $blacklist) RETURN p """, - {"name1": name_1, "name2": name_2}, + {"name1": name_1, "name2": name_2, "blacklist": blacklist}, resolve_objects=True, ) @@ -442,10 +442,10 @@ def gap_analysis(self, name_1, name_2): OPTIONAL MATCH (CompareStandard:NeoStandard {name: $name2}) OPTIONAL MATCH p = shortestPath((BaseStandard)-[:(LINKED_TO|CONTAINS)*..20]-(CompareStandard)) WITH p - WHERE length(p) > 1 AND ALL(n in NODES(p) WHERE n:NeoCRE or n = BaseStandard or n = CompareStandard) + WHERE length(p) > 1 AND ALL(n in NODES(p) WHERE (n:NeoCRE or n = BaseStandard or n = CompareStandard) AND NOT n.name in $blacklist) RETURN p """, - {"name1": name_1, "name2": name_2}, + {"name1": name_1, "name2": name_2, "blacklist": blacklist}, resolve_objects=True, )