Download & Extend

Do something useful with related terms and synonyms

Project:Drupal core
Version:7.x-dev
Component:taxonomy.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

How do I utilize taxonomy's synonyms, relations, or descriptions? I can enter tons of useful data, but couldn't find a way to harvest it (display, or use in any other form).

What I want to do is, for example,

(1) use synonyms in Freetagging vocabularies - the synonyms should be expanded to the referencing terms, to provent duplicate items in the vocabulary;

(2) display relations betweens items of a vocabulary;

(3) display descriptions for items - I couldn't find any way to expose the discriptions withing Drupal, but found one contributed module that does this (Taxonomy context).

Is there any documentation or explanation regarding the use of these feature of Drupal's Taxonomy available?

Thanks & greetings, -asb

Comments

#1

bump

#2

Status:active» closed (fixed)

This type of question should be asked in the post installation forum or the developer mailing list. Also check the list of taxonomy modules here http://drupal.org/project/Modules/category/71.

#3

Status:closed (fixed)» active

@bernadotte: Great comment, really helpful...

At least (1) has been addressed in the meantime; the Synonym Collapsing module by cwgordon7 has been backported from D6 to D5, and maybe we'll see this in D7 core. So that part is solved.

(3) is still pretty unclear; a few modules popped up, allowing to expose bits from taxonomy's treasures to the user, but nothing robust that works well on largish vocabularies with a few thousand terms. If you need descriptions descriptions for your items, you might be better off to substitute taxonomy through cck node reference fields, pointing to a custom-made taxonomy-term-like content type. That allows us to enter usefull descriptions, display them, theme the output and even add images. If I remember right, someone started a module that could migrate the dead data from taxonomy partially into nodes ("opposite to the nat module").

(2) can be considered completely dark, at least for three years; IMHO there's still no way to display relations between the terms of a vocabulary with "related terms" enabled. It seems to be a data graveyard - unless starting to code function taxonomy_get_related($tid, $key = 'tid').

@Rowanw: This is IMHO not a post installation question since it directly applies to data entered into the taxonomy through Drupal core's user interface, but can not be displayed through Drupal core's user interface. If Drupal allows to enter data through an user interface, it needs to offer an user interface to display this data. If data like "related terms" can only be accessed through function taxonomy_get_related(), the user interface should at least warn site admins and users that they will be entering data that will be lost without (nonexisting) contributed modules or own coding (which is not an option for many users; we're using a CMS because we don't want or can't roll our own, right?).

However, I'm still hoping that stuff like "related terms" can be exposed to the user somehow, so I'm still considering this a support request for the core taxonomy module.

Regards, -asb

#4

Title:How do I utilize taxonomy's synonyms, relations, or descriptions?» Do something useful with related terms and synonyms
Version:5.7» 7.x-dev
Category:support request» feature request

Taxonomy module was introduced to core a long time ago, and not much happened to it since then (although I've been trying to correct that situation in Drupal 7). Synonyms and related terms are essential for supporting scientific taxonomies, but as you noted, they're not exposed anywhere in the core UI other than data entry. Similarly, at a recent taxonomy sprint organised by the Encyclopedia of Life, we found out that both the synomym and relationship handling isn't up to the task of supporting large, complex, biological taxonomies - so the Drupal users most likely to benefit from the functionality aren't actually using it. I see a few ways this could go:

* Move synonym collapsing into core - it's a useful feature for sites which want free-tagging but want to reduce duplicate terms.
* We recently added a hook_taxonomy_term_load() - which would let you grab the related terms and synonyms of a taxonomy term when it's initially loaded from the database - this will make it easier to do things like list related terms in a block when viewing a taxonomy/term page.
* Views 2 supports lists of taxonomy terms now - while I don't think synonyms and related terms are supported, patches to do so would probably be accepted - then you could list terms, with descriptions, and their synonyms and related terms, for example.

For descriptions - these have been used in RSS feeds for a long time - they're also dispalyed on the taxonomy/term pages by default in Drupal 6, so that one's answered.

Since having support for these, showing the forms in the UI, then not doing anything useful with them is somewhat contrary to what the rest of core does, and fairly confusing for people expecting their data to be used in some way, I'm going to reclassify this as a feature request and move it to Drupal 7.

#5

Hi catch,

thanks a lot for these clarifications!

After running into some other limitations of the taxonomy module in the past few months, I recently started to think about replacing parts of taxonomy through nodes. With CCK node reference fields, one can mimic quite a lot of taxonomy, plus one gets the full set of default features of a node (e.g. a taxonomy term can't be tagged with other terms; of course a node can, and it can relate to other "taxonodes"), plus the ability to extend such an "taxonode" with other CCK fields - and one gets rid of performance issues with largish vocabularies. However, that's another building lot ;)

Thanks again,
-asb

#6

Status:active» closed (won't fix)

It looks like this did not make D7

#526120: Remove related terms from core now that terms can have a term reference field

I was looking forward to improvements for related terms as I just started using them, hopefully there will be sg in contrib.

Until then, this is what I found for displaying related terms for example on vocab pages, that I will be using. This post shows how to display related terms in blocks for example:
#139814: Display terms synonyms and related terms

Or you can use this api call directly.
http://api.drupal.org/api/function/taxonomy_get_related

#7

From http://drupal.org/update/modules/6/7#related_terms (re: #526120: Remove related terms from core now that terms can have a term reference field):

Related terms was removed from taxonomy.module

All code referring to related terms has been removed from taxonomy.module. The taxonomy_term_relations table has been left in place to allow for an upgrade path for data. This functionality has been superceded by the Field API, which allows fields to be attached to terms, and provides a term reference field in core.

Not exactly what I was hoping for from my end-user point of view ;) I wasn't aware that the Encyclopedia of Life project has been such an total failure, I was still hoping that Drupal core would adapt to the requirements of more complex scientific (or bibliographic) taxonomies. Is there anything I could read about the outcomings of this project and the discovered limitations of core's taxonomy.module? Or have these limitations been resolved through the move to Field API in D7?

Thanks & greetings, -asb

#8

Field APi covers this now much better, and there's a UI for it with the Field UI module.

Short version is

1. Create a vocabulary
2. Create a 'taxonomy term' field and add it to that vocabulary.

Now you have terms, with a CCK field which references other terms - exactly the same as 'related terms', except with nicer forms, and you can easily display them on term pages or with views (when views is ported to Drupal 7 anyway).

So we didn't really drop a feature here, we just replaced it with a more flexible one.

#9

Thanks catch,

I think before worrying about related terms and synonyms in D7 and Views for D7 I will have to succeed in updating my sites to D6 first. Due to missing upgrade paths, abandoned modules and broken CCK widgets with crucial functionality I'm not sure if this will ever happen.

However, good luck with Taxonomy in D7! ;)

Greetings, -asb

nobody click here