Infinitely deep facet/term combinations
We sometimes wonder whether or not the facet/term combinations should be infinitely deep.
As of right now the facet/term combinations are simple two-dimensional hierarchies. Examples include:
- Audience/Freshman
- Audience/Sophomore
- Audience/Junior
- Tools/Dictionaries
- Tools/Catalogs
- Tools/Indexes
- Formats/Books
- Formats/Journals
- Formats/Movies
These two-dimensional hierarchies work, most of the time, but what do you do when it comes to subjects? This works just fine, as far as it goes:
- Subjects/Astronomy
- Subjects/Mathematics
- Subjects/Literature
- Subjects/Music
To make a subjects hierarchy deeper you can start to list things in an inverted order. I call this Library Speak:
- Subjects/Literature, English
- Subjects/Literature, French
- Subjects/Literature, Spanish
Such an approach can quickly get out of hand, especially when you want to list things as English Literature of the 20th Century, not Literature, English (20th Century). Incidentally, the addition of “20th Century” is not a subject but a time period. You could create a facet called time periods and a term called “20th Century”. A better example would be Elizabethan Literature.
To over come this problem, the database could be redesigned. The facets table could have four fields instead of three:
- facet id
- facet name
- facet note
- parent id
In such a scenario there is no need for a terms table. Root facets (terms) would have a parent id of 0. All other facets (terms) would have a parent id of some other facet. For example, here is how a hierarchical list of subjects might be created:
| id | name | note | parent id |
|---|---|---|---|
| 1 | Subjects | Aboutness | 0 |
| 2 | Literature | Writing | 1 |
| 3 | Astronomy | Stars | 1 |
| 4 | English Literature | Writing from the UK | 2 |
| 5 | French Literature | Writing from France | 2 |
Re-implementing the facet/term structure in this way would be a lot of work. It would change the database as well as the Perl API. Migrating applications from the current version of MyLibrary to another would be difficult. Moreover, how often do we really need infinitely deep hierarchies?
This is a possible problem to be solved.
Discussion Area - Leave a Comment
You must be logged in to post a comment.