sparql.anything icon indicating copy to clipboard operation
sparql.anything copied to clipboard

Integrating static functions having arrays as arguments

Open luigi-asprino opened this issue 3 years ago • 0 comments

At the moment is pretty simple to integrate Java methods that have basic datatypes as arguments. It is not clear how to integrate methods that have arrays as argument. This was the case of CaseUtils.toCamelCase (see #121) which takes the string to be capitalised, a boolean which indicates if the first character has to be capitalised, an array of separator characters. I think that the natural way of invoking toCamelCase from SPARQL is toCamelCase("String to be camel cased", false, " ", "-") but:

  1. ReflectionFunctionFactory should be able to identify " " and "-" as array (instead of separated arguments)
  2. An ad-hoc NodeValueConverter should be implemented for converting sequences of arguments into (java) arrays

A greedy solution would be adopting a convention (e.g. json serialisation of the array) but I would avoid that.

luigi-asprino avatar Nov 29 '21 13:11 luigi-asprino