Many-to-many hierarchical facets

20 views
Skip to first unread message

David Rickard

unread,
Sep 11, 2008, 1:48:54 PM9/11/08
to XTF Users List
We're experimenting with XTF 2.1.
Our metadata includes a two-level "subject" field, with many-to-many
relationships between parent and child subjects. We're trying to find
a simple way to represent and index this structure.
For example: in our system, "Anthropology" has two parents,
"Humanities" and "Social Sciences". We experimented with metadata
files that had one subject tag per parent-child combo, thus:
<subject parent="Humanities">Anthropology</subject>
<subject parent="Social Sciences">Anthropology</subject>
Our prefilter converted those into:
<facet-subject>Humanities::Anthropology</facet-subject>
<facet-subject>Social Sciences::Anthropology</facet-subject>
Which indexed & faceted fine, but resulted in docHit displays like
this:
1 Title: eHRAF World Cultures
Publisher: Human Relations Area Files, Inc.
Published: 2008
Subjects: Anthropology | Anthropology

We've considered altering the metadat to something like this:
<subject parentA="Humanities" parentB="Social
Sciences">Anthropology</subject>
but we're not certain how to loop through the attributes (we'd like a
general system in case the metadata team hits us with a multi-level
hierarchy).
Any ideas on how to do a "parentA,parentB,...parentN" system?
Alternately, is there a way to display only distinct subjects in the
docHit section?

caxtonian

unread,
Sep 12, 2008, 4:46:12 AM9/12/08
to XTF Users List
Hi David

I think this is tough one as it is generally advised that because of
issues like this that terms are unique within facets.

best

Adrian

Martin Haye

unread,
Sep 15, 2008, 1:43:05 PM9/15/08
to xtf-...@googlegroups.com
Hi David,

It's should be fairly easy to show only unique subjects. I've used
<xsl:for-each-group> to do things like this. I think what you want to end up
generating from the prefilter is:

<subject>Anthropology</subject>
<facet-subject>Humanities::Anthropology</facet-subject>
<facet-subject>Social Sciences::Anthropology</facet-subject>

That way the facets will show as you want, but the subject will only be
listed once. Alternately you could modify the resultFormatter to do the
for-each-group on the display side instead of the indexing side.

--Martin
Reply all
Reply to author
Forward
0 new messages