Skip to content
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

Add morph filter-Functions without conditionals #600

Open
TobiasNx opened this issue Jan 17, 2022 · 2 comments
Open

Add morph filter-Functions without conditionals #600

TobiasNx opened this issue Jan 17, 2022 · 2 comments

Comments

@TobiasNx
Copy link
Contributor

TobiasNx commented Jan 17, 2022

Morph has:

contains, not-contains, equals, not-equals, blacklist, whitelist
that can operate directly on a certain value.

Fix only has filter for that. Otherwise you have to create an if-conditional to remove fields that are not matching.

e.g.

  if all_match("language", "Mehrsprachig")
    remove_field("language")
  end

This is too complicated in my opinion.

It should be:
not-equals("language", "Mehrsprachig")

We should adopt the morph filter functions.

@fsteeg
Copy link
Member

fsteeg commented Feb 3, 2022

See also boolean and control flow operators in Catmandu.

@TobiasNx
Copy link
Contributor Author

TobiasNx commented Jan 8, 2025

By now I think the filter mechanisms can be done sufficiently by conditionals + remove_field. Only blacklist and whitelist could be conditionals that would be interesting, but also could be constructed via lookup with delete option and exists conditional.

@TobiasNx TobiasNx closed this as completed Jan 8, 2025
@TobiasNx TobiasNx reopened this Jan 8, 2025
@blackwinter blackwinter transferred this issue from metafacture/metafacture-fix Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants