I know, there is the term merge module (http://drupal.org/project/term_merge) that allows you to merge terms within a vocabulary - but is there any way of merging terms across vocabularies or, idealy, merge two vocabularies?

Comments

dman’s picture

For a one-off like this, you will be best to just do it in SQL. Nothing tricky.

UPDATE term_data SET VID = {target vid} WHERE VID = {old vid}

... totally safe.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

joris.verschueren’s picture

I would like to do the same - have term x in vocabulary X and in vocabulary Y at the same time - but I am completely illiterate when it comes to SQL. would you please be so kind as to give this a bit more explanation?

thanks in advance,

Joris

dman’s picture

No, you can't have one term in two vocabularies. That's totally wrong. Vocabularies are different axes, like "location" and "color". You should not try to set up a situation where you have a location called "green" or a color called "North". If you are trying to build that, you will go mad.

The pseudocode above is to merge two vocabs into one. Whoch could be useful if you made too many vocabs at first, but now realize they should be grouped together, and possibly structured.

Using any MySQL interface - commandline, phpMyAdmin or MySQLtools, you just enter

UPDATE term_data SET vid = 3 WHERE vid = 7;

where 3 is the id of the vocabulary you want to keep as the main one, and 7 is the one you want to merge into it.
It'll keep all the tags and settings you've given them so far, but may need a bit of shifting around if you are need ing heirarchy.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

joris.verschueren’s picture

thanks for the explanations.

I guess I grasp better why it is impossible to do what I want, but just allow me to explain how I came to my question, because I don't find it that illogical that a term may be located at the intersection of two axes (vocabularies)
for example a term="news from X", this term would fit in the vocabulary news and in the vocabulary X. I agree that, to stick with the logic of non-intersecting categories, this can indeed be solved by applying a combination of two terms (e.g. "X/news" and "news/ from X") from two distinct vocabularies instead of having a single term. on my site however, there will be a large amount of nodes with this combination, or, in other words: located at this intersection. the spatial metaphor is very fitting, because navigation is entirely based on taxonomy and I would want people to find these nodes from all directions.
(A third advantage would be that you could have subcategories for this particular term ("news from X" about "term 1" etc), but at such a level it could well become a bit too complex for a human brain to maintain.)

Anyway, I don't think I'm the only one who's encountering this, I've seen others asking the same or similar questions, so the issue could perhaps deserve some consideration by taxonomists - who'll probably explain again that I'm talking myself into trouble.

kind regards,

Joris

dman’s picture

You have identified that the correct way to handle this is with multiple tagging.

A node can still be at the intersection of the two axes, but there is not a single term named to represent that intersection, just a pair of info.

Cartesian co-ords are as similar as two axes can get, but they are used because with just 10 gridlines each way (think terms) they can represent 100 points. Continue to think that way. Naming each point would get tedious quickly.

And adding a third axis, rather than being a headache, is even easier!
"News about Shopping in Antwerp" or "Short Stories about Travel in Tehran" become simple three-axis intersections. And of course, you can also index these terms individually, or even exclude some.

Adding navigation for these is not much tricker than adding navigation to single-vocab terms.
It's possible that some folk still don't get it, or even that they think the granular approach is more complex.
These simple folk may also object to counting ceiling tiles by multiplication as being overly complicated when just going 1,2,3...100 would get you there.
Yes, deciding to use multiplication requires just a little bit more cleverness than just counting ... but as soon as you see the trick, you can solve any number of further problems.

Using taxonomy vocabularies properly is like that. :-) . Once you "get it" you'll see why creating a 'term' for a combination of disparate topics would be silly.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

joris.verschueren’s picture

thanks for taking time to answer. the nail is driven down

kindest regards,

Joris

ryantollefson’s picture

For Drupal 7 it should be taxonomy_term_data. In 7 just "term_data" doesn't exist.

UPDATE taxonomy_term_data SET vid = 3 WHERE vid = 7;

NancyDru’s picture

Well Dan beat me to it. It definitely looks safe, except you need to ensure that both have the same hierarchy, synonym, and related settings. This will leave the FROM vocabulary empty, so you can then delete it.

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

Anonymous’s picture

That was very helpful!

giorgio79’s picture

What about duplicate terms? Identical terms existing in both vocabs? :)

mpaler’s picture

see original question...