We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 548ae55 commit f9f48e9Copy full SHA for f9f48e9
pyrdf2vec/walkers/halk.py
@@ -147,7 +147,10 @@ def _post_extract(self, res: List[EntityWalks]) -> List[List[SWalk]]:
147
for i, vertex in enumerate(walk[1::2], 2):
148
if vertex not in rare_predicates:
149
obj = walk[i] if i % 2 == 0 else walk[i + 1]
150
- canonical_walk += [vertex, obj]
+ if self.with_reverse:
151
+ canonical_walk = [obj, vertex] + canonical_walk
152
+ else:
153
+ canonical_walk += [vertex, obj]
154
if len(canonical_walk) >= 3:
155
canonical_walks.append(tuple(canonical_walk))
156
if canonical_walks:
0 commit comments