Closed jitsedesmet closed 3 years ago
I'm wondering if we could also have scenarios where an extension functions
is actually an alias for a named function. In other words, a not known named function is actually equal to a known named function. This could happen? We should also have this behavior to be fully open world?
Ideas here: I would always opt to have the cache be a field in the evaluator.
How to handle the open world is a little different. There are different valid approaches.
string => Record<string, number>
.Record<string, string[]>
string => string
. We would recursively call callback until a we receive a type we know (in the cache or within sparqlee).Another thing to talk about in case of 1-4 is the amount of super types a type can have. We currently have only one super type per type but sparqlee uses a map instead of an array to handle super types. However, I would put a clear warning on using multiple (direct) super types with caution since it can create some unexpected behavior. I don't think sparqlee should test whether this is the case since that would require a lot of resources.
It might or might not be possible to have the callback be async.
These are 2 problems in 1 issue because they need to be implemented with much consideration with eachother. There has already been a lot of talking surrounding the cache part of this issue in #102 . To make sparqlee truly open world I think we still need to add the functionality of a user providing his own datatypes and making them have the known datatypes as a super type. This way those types can still be provided to functions expecting xsd datatypes due to subtype substitution.