SINTEF / dlite

DLite - a lightweight data-centric framework for semantic interoperability
https://SINTEF.github.io/dlite
MIT License
28 stars 5 forks source link

Cost function arguments #319

Open jesper-friis opened 2 years ago

jesper-friis commented 2 years ago

In the current implementation of dlite.mappings takes the cost function the same arguments as the mapping step it is a cost for. This means that data must be instantiated in order to calculate the cost. We probably don't want that!

It is probably more desirable if we can calculate all costs (and thereby determine the best mapping route) sorely from the triplestore. Hence, we should probably change the cost functions to have three arguments: the triplestore, the IRI of the start of the mapping step and the IRI of the end of the mapping step.

francescalb commented 2 years ago

Should we also give user defined costs as a optional argument?

jesper-friis commented 2 years ago

User-defined costs (either as a fixed value or as a cost function) should already be supported - not as optional argument, but provided in the knowledge base.

dlite.mappings.mapping_route() already supports dm:hasCost relations, which can be used to associate a user-defined cost to mapping steps involving a given function or that has a given ontological concept as target. The object of such a dm:hasCost relation can either be a number or the IRI of a cost function.

In the case that dm:hasCost refers to a cost function, the idea with this PR is to change the arguments passed to the cost function when it is evaluated. The aim is to be able to evaluate the costs purely from the triplestore. That could be very useful in OntoFlow.