mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mirko <idonthaveenoughinformat...@googlemail.com>
Subject Re: GenericJDBCDataModel problem (getItems, getUsers)
Date Thu, 05 Nov 2009 08:32:00 GMT
Hi Sean,
I used v0.1. I got the latest snapshot (0.3) now and saw that a lot  
changed in the meanwhile; things seem a bit more complicated now. I  
will switch to 0.3 but that seems to be more tricky to implement on my  
data (e.g. I currently use Strings, not longs, for items and users in  
my data). Probably it'll be easier to copy my data to an already  
implemented DB (MySQL) and process them there instead of customizing  
the DataModel to fit my DB.

But still:

> If you are using some SPARQL-in-SQL system then you must be  
> customizing a
> lot, at least the SQL queries.

As I understand the code, the GenericJDBCDatamodel works with any JDBC  
Datasource when adjusting the SQL_KEY values. Since my VirtuosoDB is a  
common JDBC javax.sql.Datasource it should not matter whether I send  
SQL or RDF-in-SQL, as long as the SQL ResultSets are of the expected  
structure. Would you agree on that? Or, what else do you think I do  
have to customize?

Thanks,
Mirko



>
>
> On Nov 4, 2009 5:04 PM, "Mirko" <idonthaveenoughinformation@googlemail.com 
> >
> wrote:
>
> Hi,
> I have problems with the GenericJDBCDataModel. For me, the functions
> getUsers() and getItems() return nothing, although the SQL queries  
> used in
> the functions definitely do return results. All other functions in the
> DataModel work as expected.
>
> The results of the queries used in getUsers() and getItems() look as
> follows:
>
> SQL result for GenericJDBCDataModel.GET_ITEMS_SQL_KEY:
>
> item_id
> ------------
> itemID_A
> itemID_B
> itemID_C
> itemID_D
> itemID_E
> ...
>
> SQL result for GenericJDBCDataModel.GET_USERS_SQL_KEY
>
> item_id         callret-1               user_id
> ----------------------------------------------
> itemID_A        1               userID_X
> itemID_B        1               userID_Y
> itemID_C        1               userID_Z
> ...
>
> I think these results should be correct (Preferences are always 1 in  
> my
> data). But the Iterables returned by both functions seem to be empty:
>
> GenericJDBCDataModel dm = new GenericJDBCDataModel(props);
> for ( Item item : dm.getItems()){
>       System.out.println(item.getID()); //Never reached
> }
> for ( User user : dm.getUsers()){
>       System.out.println(user.getID()); //Never reached
> }
>
>
> I should note that I query an OpenLink Virtuoso RDF store, which  
> uses SPARQL
> queries enclosed in SQL queries. That means that  'columns' and  
> 'tables' ,
> and thus the variables DEFAULT_PREFERENCE_TABLE,  
> DEFAULT_USER_ID_COLUMN,
> DEFAULT_ITEM_ID_COLUMN and DEFAULT_PREFERENCE_COLUMN of
> AbstractJDBCDataModel don't have any meaning. But as I understand  
> the code,
> they are not required when using the GenericJDBCDataModel.
>
> Is it possible that some exception is thrown 'silently' in the
> AbstractJDBCDataModel?
>
> I have no idea where to look for the prob, so thanks for any hints....
>
> Regards,
> Mirko


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message