We need a proper repository for property mapping functions and cost functions.
Currently they are just stored in a dict that have the IRI we assign the function as key and the function itself as value.
One solution could be to provide the mapping functions as Python modules that can be loaded via a simple plugin system using importlib. There will then be no need for serialisation of the function repo and it plugins could be either be included with the system using them or provided as verified pypi packages for safety.
The function repo plugin system could be implemented as a separate module in the triplestore subpackage. That would allow the triplestore to transparently use it under the hood, keeping the convenience of Triplestore.add_function().
We need a proper repository for property mapping functions and cost functions.
Currently they are just stored in a dict that have the IRI we assign the function as key and the function itself as value.
One solution could be to provide the mapping functions as Python modules that can be loaded via a simple plugin system using
importlib
. There will then be no need for serialisation of the function repo and it plugins could be either be included with the system using them or provided as verified pypi packages for safety.The function repo plugin system could be implemented as a separate module in the triplestore subpackage. That would allow the triplestore to transparently use it under the hood, keeping the convenience of Triplestore.add_function().