lenskit

Connecting lenskit 3.0 data access model to jdbc


I am building a recommender engine for our ecommerce application. The easiest way is to deploy the recommender system to java web server and implement a REST API for it.

I am trying to get the data from the database directly, but I didn't find any documentation that can help me to connect lenskit 3.0 to JDBC.

Can anyone please explain how to connect the lenskit to database and how to customize Rating.class, User.class and Item.class so it can contain the user country and city, and show whether the item is in stock or not ?


Solution

  • In LensKit 3, the way to work with custom data is to directly use Entity objects. Users, items, and ratings, are just entities; the User, Item, and Rating classes are view classes that provide convenience access to common attributes, but the base Entity interface allows you to use arbitrary attributes. The data model is documented at https://lenskit.gitbooks.io/lenskit-manual/basics/data-model.html; it is also possible to create your own view classes, but this is not currently documented.

    To use JDBC, you will need to reimplement the DataAccessObject interface on top of JDBC. Building a reference implementation of this functionality is on the TODO list, but has not yet been done.