Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tag hierarchies and handling of

Tags:

This is a real issue that applies on tagging items in general (and yes, this applies to StackOverflow too, and no, it is not a question about StackOverflow).

The whole tagging issue helps cluster similar items, whatever items they may be (jokes, blog posts, so questions etc). However, there (usually but not strictly) is a hierarchy of tags, meaning that some tags imply other tags too. To use a familiar example, the "c#" so tag implies also ".net"; another example, in a jokes database, a "blondes" tag implies the "derisive" tag, similarly to "irish" or "belge" or "canadian" etc depending on the joke's country origin.

How have you handled this, if you have, in your projects? I will supply an answer describing two different methods I have used in two separate cases (actually, the same mechanism but implemented in two different environments), but I am also interested not only on similar mechanisms, but also on your opinion on the hierarchy issue.

like image 711
tzot Avatar asked Sep 23 '08 12:09

tzot


People also ask

What is tag hierarchy?

Tag hierarchies are a way of grouping related tag types together. The main use of tag hierarchies is to configure the drill-down behaviour for tag based reports. The following sections describe how to design, create and use your tag hierarchies.

What is the purpose of tagging?

…of graffiti, known as “tagging,” which entailed the repeated use of a single symbol or series of symbols to mark territory. In order to attract the most attention possible, this type of graffiti usually appeared in strategically or centrally located neighbourhoods.


2 Answers

This is a tough question. The two extremes are an ontology (everything is hierarchical) and a folksonomy (tags have no hierarchy). I have answered this on WikiAnswers, with a reference to Clay Shirky's "Ontology is Overrated" article which claims you should set no hierarchy.

like image 120
Yuval F Avatar answered Oct 09 '22 22:10

Yuval F


Actually I would say that it is not so much a hierarchical system but a semantic net with felt distancies between tags meanings. What do I mean: mathematics is closer to experimental physics then to gardening.

Possibility to build such a net: Build pairs of tags and let people judge the perceived distance (using a measure like 1-10, meaning something like [synonyms, alike,...,antonyms], ...) and when searching, search for all tags within a certain distance.

Does a measure have to be equal distance if coming from the oposite direction ([a,b] close -> [b,a,] close)? Or does proximity imply [a,b] close and [b,c] close -> [a,b] close?

Maybe the first word will by default trigger another semantic field? If you start at "social worker", "analyst" ist near. If you start at "programmer", "analyst" is near as well. But starting at any of these points, you probably would not count the other as near ("sozial worker" is by no means close to "programmer").

You therefore would have only pairs judged and judged in both directions (in random order).

[TagRelations]
tagId integer
closeTagId integer
proximity integer

Example for selection of similar tags:

select closeTagId from TagRelations where tagId = :tagID and proximity < 3
like image 30
Ralph M. Rickenbach Avatar answered Oct 09 '22 20:10

Ralph M. Rickenbach