-
Notifications
You must be signed in to change notification settings - Fork 7
Support custom functions #16
Comments
@wschella Could you give some (quick) pointers on how we could implement support for custom functions? Someone may work on this in the near future. |
Yes.
Note: It is likely it will be slightly more complicated regarding the type system and sync/async differentation. So you might need Expression.CustomAsyncOperator and Expression.CustomSyncOperator or something, where in a sync evaluator the async operators can not be handled, or can be handled blocking. A good interface regarding the configuration is important. |
Thanks for the input! |
NOTE to Self: A custom function in Algebra format looks like this:
I suspect we should use |
You're right! I now see I even left a todo there. sparqlee/lib/Transformation.ts Line 166 in 18c44c3
|
@wschella
I was wondering why we can't just use Expression.Named as a starting point? Maybe give another SimpleApplication (given by the user) as an argument to it's constructor. Is there a specific reason you where thinking of creating a new type? |
The terminology I used is not great, so it could make sense. Also I was a bit confused, my apologies. The TODO I mentioned there I put there likely because I think the spec allows overriding the functionality of the Named operators (which are functions like We should distinguish between these two cases (and check the spec to see if I'm right).
Now, since for overriding you likely want to tag the Expression.Named with a The question with these matters is always how much their execution differs from each other. On first glance, maybe not at all. But I can also imagine errors or logging should be handled differently. Anyway, I don't have strong opinions (nor the authority to have them), so do as you see fit 😄 |
Thanks for your input @wschella! Just to make sure we're aligned; the tag
In any case, I guess the injection point (for Comunica) for |
@rubensworks Yeah that sums it up. And I do think there is merit in keeping the injection point separate (but equal in config/type). You likely want different errors if something is wrong (e.g. |
Good point! |
Thank you for your clarification! I think I understand what you're saying. If I am uncertain about anything, I hope I an contact you again 😄 |
Definitely :) |
See https://www.w3.org/TR/sparql11-query/#extensionFunctions. Could be very useful to pass custom functions that SPARQL doesn't support.
The text was updated successfully, but these errors were encountered: