Tag Archives: tags

Mises Tagging Overview

The framework used to tag pages on Mises.org is a tagging library I developed to tag any kind of content on Mises.org.  The tag library references GUID‘s assigned to all objects in the Mises.org databases.
It tracks users by username or IP address as well as the date that each tag was added.  It includes spam/bad word filtering and has some simple tag rewriting to automatically correct misspelled words and incomplete names.  For a simple tag example, see business cycle.

Update: Mises Tagging is now an open source project!  See the project page for details.

Architecture overview:

Database layer:

The database schema gives a good indication of the
data-access layer:

Tag Schema

Stored procedures:

UI Layer:

The interface is organized into self-contained user
controls.

  • TagCloud.ascx – a tag cloud for the given document
    Example: http://mises.org/resources/3250  (Sroll down)
  • EditTags.ascx – an editable list of tagged
    documents and a user-specific tag cloud.
    Example: http://mises.org/mymises/
    (You’ll have to register at Mises.com tag some documents first.)
  • TaggingStats.ascx – global tagging statistics
    Example: http://mises.org/clouds.aspx#stats

Management:

  • DocumentTags.ascx – an editable list of tags for a particular
    document
  • Tags.aspx: delete tags, delete all tags by a particular user
    and search/replace tags

The MisesBot:

You might have noticed that 99% of all tags are entered by
the MisesBot.  The bot is an application
that uses the meta tags collected by the MetaParser (detailed in a future post)
as well as other available metadata to add tags to document.

Thanks to:

  • Cloud Control for ASP.Net – displays a list of hyperlinks in
    varying styles depending on a weight.
  • Toxi – the inspiration for the tag schema
  • Freetag, an Open Source Tagging / Folksonomy module for
    PHP/MySQL applications – the inspiration for the business logic layer
  • Community Server –  Inspired the tag browser interface and provided the banned words list.

To do:

  • Did you notice the TagAuthority field in the tag
    schema?  A future version of the MisesBot
    will automatically determine the “authoritative” document for each tag.
  • Automatically mark up content.  If we know the authoritative document for a
    tag, we can automatically link to it when that tag appears in the document text.
  • Improving the “related tags” algorithm.  I could use some help with this:

Here is the query to get related tags.  The problem is that it currently ranks tags according to their total popularity, not their “related-ness.”

CREATE
PROCEDURE [dbo].[TagGetRelatedTags]
        @Tag VARCHAR(70)
AS
BEGIN
        DECLARE
                @TagId int
                SET @TagId =
                        (SELECT TagId FROM Tag WHERE Tag = @Tag)
                        SELECT  TOP 30 Tag.Tag,
                                COUNT(TagMap.TagId) AS 'Count'
                        FROM    TagMap
                        INNER JOIN Tag
                        ON      TagMap.TagId    = Tag.TagId
                        WHERE   [TagMap].TagId <> @TagId
                            AND (TagMap.TagId  IN
                                (SELECT DISTINCT TagId
                                FROM    TagMap
                                WHERE (ObjectId IN
                                        (SELECT ObjectId FROM TagMap WHERE (TagId = @TagId)))
                                )
                                )
                        GROUP BY TagMap.TagId,
                                Tag.Tag
                        ORDER BY 'Count' DESC
                END