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

Chaining multiple functions to process input and return a single output #205

Open
jaxley opened this issue Nov 21, 2023 · 0 comments
Open

Comments

@jaxley
Copy link

jaxley commented Nov 21, 2023

Issue type: ❓ Question

When you use functions with conditions, you can use multiple functions and there are logical functions that can take the outputs of those functions and use them to compute the ultimate result.

However, it doesn't seem like there's a way to chain or pipe multiple functions together when using them to generate an object or subject. For example, I want to use grel:string_replace more than once on the same string to replace different inputs with different outputs - but I want them to accumulate and apply to the output of the previous function - not the raw input value again, like $(someinput)

I've tried naively just nesting a function in place of a constant in predicate/object mappings but that doesn't work as expected.

The FNO specification has what sound like these concepts - composition - where you could map outputs of one function to inputs of others. https://fno.io/spec/#composition. I have not seen examples of using this in either plain RML or yarrrml.

Are there ways of doing this? If not, it's seeming more likely that just writing code to do the mappings will be the most expressive and simplist way to get these kinds of transformations done as part of the mappings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant