|
25 | 25 | import org.metafacture.framework.annotations.In; |
26 | 26 | import org.metafacture.framework.annotations.Out; |
27 | 27 | import org.metafacture.framework.helpers.DefaultStreamPipe; |
| 28 | +import org.metafacture.mangling.DuplicateObjectFilter; |
28 | 29 | import org.metafacture.mangling.StreamFlattener; |
| 30 | +import org.metafacture.triples.AbstractTripleSort.Compare; |
29 | 31 | import org.metafacture.triples.StreamToTriples; |
30 | 32 | import org.metafacture.triples.TripleFilter; |
| 33 | +import org.metafacture.triples.TripleSort; |
31 | 34 |
|
32 | 35 | import java.io.IOException; |
33 | 36 |
|
|
37 | 40 | * |
38 | 41 | * @author Tobias Bülte |
39 | 42 | */ |
40 | | -@Description("Finds all paths that have values that match the given pattern. Allows for regex. These paths can be used in a Fix to address fields.") |
| 43 | +@Description("Finds all paths that have values that match the given pattern. Allows for regex. These paths can be used in a Fix to address fields.") // checkstyle-disable-line ClassDataAbstractionCoupling |
41 | 44 | @In(StreamReceiver.class) |
42 | 45 | @Out(String.class) |
43 | 46 | @FluxCommand("find-fix-paths") |
@@ -67,11 +70,15 @@ public FindFixPaths(final String objectPattern) { |
67 | 70 | protected void onSetReceiver() { |
68 | 71 | final TripleFilter tripleFilter = new TripleFilter(); |
69 | 72 | tripleFilter.setObjectPattern(objectPattern); |
| 73 | + final TripleSort tripleSort = new TripleSort(); |
| 74 | + tripleSort.setBy(Compare.PREDICATE); |
70 | 75 | fix |
71 | 76 | .setReceiver(new StreamFlattener()) |
72 | 77 | .setReceiver(new StreamToTriples()) |
73 | 78 | .setReceiver(tripleFilter) |
| 79 | + .setReceiver(tripleSort) |
74 | 80 | .setReceiver(new ObjectTemplate<>("${p}\t|\t${o}")) |
| 81 | + .setReceiver(new DuplicateObjectFilter<>()) |
75 | 82 | .setReceiver(getReceiver()); |
76 | 83 | } |
77 | 84 |
|
|
0 commit comments