The lib.json file contains configuration that identifies the Java packages with user-defined functions for RAQL. It can also optionally contain configuration that identifies the specific classes and methods in these packages and the function names to map to methods.
Note: It is a best practice to configure methods and function names using annotations in the Java classes directly. If you choose to use lib.json configuration instead, you should omit the annotations in your Java classes for user-defined functions.
The following example includes method and function mapping configuration along with the required package configuration information:
{
"exportedFuncs": {
"annotatedPackages":[
"com.MyOrg.raqlUdf",
"com.MyOrg.aggregate.raqlUdf",
"com.MyOrg.window.raqlUdf" ],
"classes":[
{ "name": "com.MyOrg.raqlUDF.MyStringFuncs",
"funcs":[ {"method": "replace" },
{ "name": "capitalize", "method": "upper"} ] },
{ "name": "com.MyOrg.aggRaqlUdf.KurtosisFunction",
"funcs": [ {"name": "kurtosis" ] }
]
}
}