dkpro / dkpro-uby

Framework for creating and accessing UBY resources – sense-linked lexical resources in standard UBY-LMF format
https://dkpro.github.io/dkpro-uby
Other
22 stars 3 forks source link

bug when loading Lexicons via LexicalResource: single Lexicon returned #131

Open judithek opened 9 years ago

judithek commented 9 years ago

SH: Running the following snippet on a 070-snapshot DB shows that the loading of Lexicon instances via LexicalResource does not work properly:

Uby uby = new Uby(dbConfig); LexicalResource lexicalResource = uby.getLexicalResource("UBY"); System.err.println(lexicalResource.getLexicons().size()); // prints 1 (not expected) System.err.println(uby.getLexicons().size()); // prints the correct number of lexicons (expected outcome)

Note that all lexicons are associated with the LexicalResource in the DB (lexicalResourceId="UBY").

Maybe some issue with the hibernate api/hibernate mappings?

ChM: Looked into that. The lexicons of a lexical resource are mapped as a list (i.e., a collection with a specific order as determined by the "idx" column). In the public UBY databases, this idx is 0 for all lexicons. Hibernate thus conflates all lexicons into one. For the upcoming release, we should make sure that the lexicons indexes are set incrementally during the database post-processing.

In later releases, we should change to mapping from list to set or bag, since the idx column is not really required. Actually, having a natural index for a lexicon does not make sense IMHO.