Liferay is a Gartner Magic Quadrant Leader for the Sixth Year! Find out why

Taxonomies

Taxonomies are a way of organizing and aggregating content.

Overview #

Traditionally in Liferay you have only one vocabulary with tags that you can use to classify your contents later search and aggregate them using this tags.

With the new taxonomy system implemented from Liferay Portal 5.2 you can have more than one vocabulary. You can create category trees vocabularies in order to tag your contents and classify them. The Tags Admin portlet has been redesigned and extended in order to support the hierarchical categories concept and now you can create taxonomies or folksonomies inside Liferay.

Taxonomies versus folksonomies #

The main difference between taxonomies and folksonomies is that in taxonomies a closed set of tags, which in Liferay are called "categories" are created and organized in a hierarchical way by the site administrator. Folksonomies are an open set of tags, which in Liferay are called "tags", that could be extended by the end user.

In order to support taxonomies when you create a new vocabulary you must specify if it is a folksonomy or not using the correct editor mode in Tags Admin portlet. The mode is selected using the buttons in the upper left corner just under the search field. For folksonomy, select the "Tag Sets" button, for taxonomy, select the "Categories" button.

In the next screenshot you can see a folksonomy created for tagging photos.

and in this other capture you can see how we have created a partial taxonomy with hierarchical categories to classify the different olympic games sports.

In order to build the tree you need to add categories and then you can drag and drop them to the correct parent category.

Using taxonomies in your portlets #

The taglibs used for folksonomies, have been extended with a new boolean folksonomy param. To display the tags with which users have classified their contents, set this param to true. As an example, to show folksonomy for a particular WebContent journal article, you could use

 
<liferay-ui:tags-summary className="<%= JournalArticle.class.getName() %>" classPK="<%=article.getResourcePrimKey()%>" folksonomy="true" /> }}}

in java code, you can get an array of user defined tags for a particular article with

String[] tagsEntries = TagsEntryLocalServiceUtil.getEntryNames(
  JournalArticle.class.getName(),
  article.getResourcePrimaryKey(),true);

Taxonomies (tags and categories) have permission settings and will not be accessible from portlet code if permissions are not set correctly.

Current limitations #

Right now the system does not support the searching using the full category tree (including the parents of the searched category). Also, it does not support hierarchies with more than one parent for a child node.

Related documents #

2 Attachments
50715 Views
Average (1 Vote)
The average rating is 3.0 stars out of 5.
Comments
Threaded Replies Author Date
Im very interested in this feature. I thing... Rocco Russo October 29, 2008 3:16 AM
Good point! It would be nice to support a... Jonas Yuan August 26, 2009 12:30 PM
Can you expand on the "param" concept in the... Chris Rocco December 30, 2008 9:07 AM
I am also confused,can anybodu explain "param"... Archi Madhu January 17, 2010 9:34 PM
I updated the entry with an example using the... Tim McGuire May 14, 2010 9:40 AM
Just a simple comment. This explains how to... Iñaki Paz Rey February 23, 2009 2:33 AM
There is something missing here. "So if you... Susan Lacis May 14, 2009 3:46 PM
Or is the word "the" a mistake? The sentence... Juha J November 10, 2009 11:13 AM
Can someone define vocabulary in the context of... Samuel Liu July 12, 2010 4:11 PM
Hello. I'm looking for the same answers. But I... Paulo Pacheco February 3, 2011 12:03 PM
thanks for this, i also read the docs in drupal... Don Baonguis April 20, 2011 3:53 PM
Hi. I've tried to add a property which value... Marcus Alves November 1, 2011 10:06 AM

Im very interested in this feature. I thing that Tags are only the first step to approach a sematic clasification of the contents. I'd like to kwon if in future will be possible to build a complete ontology. In this way all contents can be classified as instance and their properties can be used to navigate through the concept declared in the ontology.
Posted on 10/29/08 3:16 AM.
Can you expand on the "param" concept in the "using taxonomies in your portlets" section above?

Will this allow me to expose/select category tags via Asset Publisher? I can create Categories and Vocabularies, but can not select them via the asset publisher for display.

Q2: Are their any plans to deprecate the "Type" field in Journal and replace it with Category selection?

Thanks,
Chris
Posted on 12/30/08 9:07 AM.
Just a simple comment.
This explains how to create taxonomies, etc. but there is something I miss. What are the properties? How are they used?
Thanks,
Iñaki
Posted on 2/23/09 2:33 AM.
There is something missing here.

"So if you want the (WORD MISSING) to use categories for classifying your contents, you must use this param in order to show the use the correct visual component."
Posted on 5/14/09 3:46 PM.
Good point! It would be nice to support a sematic clasification of assets and to build a complete ontology, based on tags and taxonomies. Looking forward to seeing this feature, too.
Posted on 8/26/09 12:30 PM in reply to Rocky Russian.
Or is the word "the" a mistake? The sentence would make sense without it: "So if you want to use categories for classifying your contents, you must use this param in order to show the use the correct visual component."
Posted on 11/10/09 11:13 AM in reply to Susan L Lacis.
I am also confused,can anybodu explain "param" part?
Also these categories are used in only web contents?I mean can we use it for document library for classificaton?
Posted on 1/17/10 9:34 PM in reply to Chris Rocco.
I updated the entry with an example using the folksonomy param. I looked in the liferay source code in TagsSummaryTag.java
Posted on 5/14/10 9:40 AM in reply to Archi Madhu.
Can someone define vocabulary in the context of Liferay? What exactly is a vocabulary and what does it do? This isn't very well explained -- when I go to the category page and see "Add Vocabulary" as well as "Add Category," I ask two questions

1) What is a vocabulary? I haven't heard this used in the context of websites before.
2) What does it have to do with categories? I know what categories are, on the other hand.
Posted on 7/12/10 4:11 PM.
Hello.
I'm looking for the same answers. But I found nothing about it in my studies or the Wiki isn't easy to understand. I found some answers in the Drupal's forum. Here is the address: http://drupal.org/documentation/modules/taxonomy
Posted on 2/3/11 12:03 PM in reply to Samuel Liu.
thanks for this, i also read the docs in drupal site.. but STILL i dont know what is the purpose of the key/value pairs for the categories in liferay? :-(
Posted on 4/20/11 3:53 PM in reply to Paulo Blaschke Pacheco.
Hi. I've tried to add a property which value was a URL (sample: URL - www.brasil.gov.br ), but Liferay did not accept this. Anyone knows why this occurred? Thanks in advance.
Posted on 11/1/11 10:06 AM.