Skip to content

Commit 46bd20a

Browse files
committed
Updated forbidden chars
1 parent ef916d1 commit 46bd20a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

examples/pbe/transduction/knowledge_graph/kg_path_finder.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ def __exec_search_path_query__(query: str, wrapper: SPARQLWrapper) -> List[List[
8181
return []
8282

8383

84+
forbidden_chars = "+|!/<>"
85+
86+
8487
def find_paths_from_level(
8588
pairs: List[Tuple[str, str]],
8689
wrapper: SPARQLWrapper,
@@ -90,9 +93,7 @@ def find_paths_from_level(
9093
if level < 0:
9194
return []
9295
for inp, out in pairs:
93-
if "+" in inp or "|" in inp or ">" in inp or "<" in inp or "/" in inp:
94-
return []
95-
if "+" in out or "|" in out or ">" in out or "<" in out or "/" in out:
96+
if any(c in inp or c in out for c in forbidden_chars):
9697
return []
9798
d = level
9899
while d < max_distance:

0 commit comments

Comments
 (0)