Skip to content

Add draft for bug fix for list-fix-paths #686 #687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@
import org.metafacture.framework.annotations.In;
import org.metafacture.framework.annotations.Out;
import org.metafacture.framework.helpers.DefaultStreamPipe;
import org.metafacture.mangling.DuplicateObjectFilter;
import org.metafacture.mangling.StreamFlattener;
import org.metafacture.triples.AbstractTripleSort.Compare;
import org.metafacture.triples.StreamToTriples;
import org.metafacture.triples.TripleFilter;
import org.metafacture.triples.TripleSort;

import java.io.IOException;

Expand All @@ -37,7 +40,7 @@
*
* @author Tobias Bülte
*/
@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.")
@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
@In(StreamReceiver.class)
@Out(String.class)
@FluxCommand("find-fix-paths")
Expand Down Expand Up @@ -67,11 +70,15 @@ public FindFixPaths(final String objectPattern) {
protected void onSetReceiver() {
final TripleFilter tripleFilter = new TripleFilter();
tripleFilter.setObjectPattern(objectPattern);
final TripleSort tripleSort = new TripleSort();
tripleSort.setBy(Compare.PREDICATE);
fix
.setReceiver(new StreamFlattener())
.setReceiver(new StreamToTriples())
.setReceiver(tripleFilter)
.setReceiver(tripleSort)
.setReceiver(new ObjectTemplate<>("${p}\t|\t${o}"))
.setReceiver(new DuplicateObjectFilter<>())
.setReceiver(getReceiver());
}

Expand Down