I am trying to understand the core category (aka taxonomy) module in Drupal 4.7x. Would this be a fair summary?

A category consists of a taxonomy and terms.

A taxonomy is the highest level (root) of a category.

A term is any subcategory below root level.

A vocabulary is the set of terms in a taxonomy ie a set of categories. The vocabulary has the same name as its taxonomy.

A simple vocabulary has all its terms on the level immediately below root. This would be an example of a category ("taxonomy1") with a simple vocabulary:

taxonomy1
-- term1
-- term2

A hierarchical tree of categories is possible when "multiple hierarchies" are enabled. The hierarchy has a taxonomy at its root. The next level down is a term. Subsequent lower levels are also terms.

Thus, this would be an example of a category ("taxonomy2") with a hierarchical vocbulary:

taxonomy2
-- term3
---- term4
---- term5

Comments

davidrf’s picture

Once you grasp this, it's a simple concept, but it's deceptively confusing to understand at first.

Terms are your most granular level categories. A term can be sub- another term. A group of terms is called a vocabulary. Taxonomy is just a name to describe the whole system of terms and vocabularies. It sounds more complex than just calling the whole functionality "categories" (even though that's the name of the menu link), but that's what it is.

Here's an example: A site I'm working on allows users to tag their images and blog posts in three ways: by location (a set of specific terms I've chosen), by topic (also a set of predetermined terms I've chosen) and by "other tags" (a freeform tagging field similar to Flickr, et. al.). In this situation, I have three vocabularies: location, topic and other tags. Under the vocabulary named "location", the various city names are terms. Ditto specific topic names under the vocabulary "topic". "Other tags" is also a vocabulary name, but the terms (if any) are defined by the user.

You associate vocabularies to specific nodes. For example, I may want people to have the option of tagging an image with a location tag, but perhaps not a forum post. It all depends on how many ways you want to be able to aggregate and deliver your users' posts.

(I hope this just didn't confuse you further.)

styro’s picture

You associate vocabularies to specific nodes.

You associate specific node types to vocabularies.

You associate specific terms to nodes.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

davidrf’s picture

You're absolutely right, of course. I should have re-read my post before I committed it. There's a big difference between nodes (at the risk of over-simplifying: individual posts) and node types, and I definitely meant the latter. My bad.

styro’s picture

Term - a category or tag or keyword ie what gets assigned to nodes. Terms can be children and parents of each other to create hierarchies. Terms are the only hierarchical part of the system.
Vocab - a collection of terms that share some sort of relationship with each other. The vocab isn't part of any hierarchy as such.
Taxonomy - the name of the whole system and the name of the module that implements it. This used to be the name of the menu item in the admin menu.
Category - the more recent "user friendly" name for Taxonomy and new name for the menu item. It was changed a couple of versions back because newbies seemed to be scared of the word "Taxonomy" - but the ambiguousness of the word "Category" seems to have created more confusion than it solved.

Vocabs and Terms are the only ones that are actual objects in Drupal.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

untrammelled’s picture

Thanks everyone.

My understanding is now this:

A category system is provided by the core "taxonomy" module, although the menu item is "category". The module is based on the concept of a taxonomy (classification system). The module enables content items (nodes) to be classified and tagged so that they can be processed (filtered, sorted, etc) before display on a page.

Term is the basic unit of classification. A term is the name of a category (a tag, a keyword). Terms can be children and parents of each other to form hierarchies. Terms are the only hierarchical part of the system.

A vocabulary is a set of terms (categories) that share some sort of relationship with each other.

Taxonomy is the name of the whole system and the name of the module that implements it.

You associate specific node types (eg "page", "story") with vocabularies when the vocabularies are created or edited (by eg "administer -> categories").

You associate specific terms with nodes (content items) when the nodes are created or edited (by eg "create content" or "administer -> content").

A simple vocabulary has no subcategories. The vocabulary is created with hierarchy "disabled". This is an example of a simple vocabulary containing two terms (categories):

simple vocabulary
-----------------
term1 
term2

A hierarchical tree of categories is possible if "single" or "multiple" hierarchy is enabled when the vocabulary is created. This is an example of a vocabulary with a single hierarchy containing three terms (one category with two subcategories):

single hierarchy
----------------
term3 
-term4 
-term5

Single and multiple hierarchies

I am still not sure of the difference between single and multiple hierarchies. I have created both, but they appear to behave exactly the same.

Chris

styro’s picture

in multi hierarchies, terms can have more than one parent. ie they can appear in more than one place in the tree while still being the same term.

eg:

term6
-term8
-term9
term7
-term8
-term10

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

untrammelled’s picture

Does that mean that in a single hierarchy, the same structure

term6
-term8
-term9
term7
-term8
-term10

would result in two different categories with the same name ("term8")?

Chris

styro’s picture

You are sort of right - the difference is that in the multi hierarchy term8 would be created in one step (by choosing two parents), while in your single hierarchy you'd need to create two different terms called term8. In the multi hierarchy 'the' term8 would appear in multiple places, in the single hierarchy those terms would have different ids and be different terms.

(it wouldn't be a good idea to have different terms sharing the same name though)

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

untrammelled’s picture

All clear! Thanks very much.

Chris