The TON Categorization System

The TON Platform contains various types of content including Articles, Pages, Forums, Photos, Videos, Maps, Fishing/Hunting Reports, Calendar Events and more. The system was designed from the ground up to allow the TON Developers team to extend the content by creating new types.
The original challenge was the organization of TON Content both within a single TON Site and across the entire TON network of web sites. We wanted the ability for a site manager for Site A to be able to publish content not only to their site, but then allow other TON Site Administrators to find and leverage that content.
The key was developing an organization system that would group like content, but then be scaleable enough to handle any un-planned scenario.
The solution we developed was to create categorization in 4 primary "parts"
1. Channels and Categories
2. Geos (Places or Regions)
3. Tags
4. Special Series.
All content is then linked to these categorization areas, either by the user submitting the content, by default settings, or by an automated process.
Database Table Schema - Content
All content contains a shared table schema for this system that looks like this:
Channels and Categories
The TON Channels and Categories System uses a 3 level structure:
Channel
-> Category
-> Sub Category
Only the Channel is required. In TON, we have a channel named "Fishing" which contains all fishing related content. Beneath fishing, we have a set of categories, and beneath each category, we optionally have a set of sub categories.
The only requirement is that content is linked to, at a minimum, a Channel. Selecting Categories or SubCategories is optional.
Database Table Schema - Channels, Categories, SubCategories
Challenge #1 - Inner Joins on Content with no Category or Sub Category
We handled this by defaulting the PrimaryCategoryId and PrimarySubCategoryId to the value zero (0). Then, we created an entry in tblCategories and tblSubCategories with a primary key value of zero (0) and a title of "{None}". This ensures that joins from tblContent on these tables would always result in records being produced, and allowed us not to use left joins to create content views.
Challenge #2 - Which Category does this content belong in?
A flat category structure requires that you link an article or photo or video to a specific category. However, in many instances, content could be linked to more than 1 category or sub category. Our final decision to handle this scenario was the use of Tags. By using tags, we could have a scaleable categorization system that allows us to link like content using keywords in addition to a content's category.
For instance, an article on Walleye Ice Fishing could be linked to the Walleye category OR the Ice Fishing Category. This setup allows the user to link the content to the Ice Fishing category, but then tag it with they keyword Walleye. This way, we can still group all Walleye content together, regardless of category by simply querying the tags field.
The Tags field is setup as a varchar field, and the tags are keywords separated by spaces.
Challenge #3 - Is this content related to Minnesota? - North Dakota? -
The solution to this problem is utilizing a Geo "tag" of sorts that allows us to group content into specific regions or places. Our Geos System was designed to handle any type of place or region of the world whether it is political areas (counties / states) or more specific areas such as Bodies or Water, hunting units, etc.
All content can then be linked to a place in the world by selecting the appropriate Geo
Challenge #4 - Grouping content of different categories
We needed a way to group together content that may be spread across different categories or regions. For instance, if we ran a series of articles on a topic such as Game Preparation, these articles could be about big game, small game, waterfowl, etc. etc. Our solution was to create a Special Series key that allows us to link content to a single Series. For example, an author could write a series of articles, and then we could display that series of articles together, without worrying about what categories they are in. In addition, then these articles could appear within the site in the various sections, grouped together with other content on similar topics.
Conclusion
This is just a brief overview of the cateorization architecture of the TON Platform. We will write additional articles in the future on specific topics such as auto tagging, and how we developed the larger database schema and PHP Classes that handle the business logic.
The original challenge was the organization of TON Content both within a single TON Site and across the entire TON network of web sites. We wanted the ability for a site manager for Site A to be able to publish content not only to their site, but then allow other TON Site Administrators to find and leverage that content.
The key was developing an organization system that would group like content, but then be scaleable enough to handle any un-planned scenario.
The solution we developed was to create categorization in 4 primary "parts"
1. Channels and Categories
2. Geos (Places or Regions)
3. Tags
4. Special Series.
All content is then linked to these categorization areas, either by the user submitting the content, by default settings, or by an automated process.
Database Table Schema - Content
All content contains a shared table schema for this system that looks like this:
tblContent
ContentId (Primary Key - NOT NULL)
...various fields
PrimaryChannelId (INT NOT NULL)
PrimaryCategoryId (INT NOT NULL - DEFAULT VALUE 0)
PrimarySubCategoryId (INT NOT NULL - DEFAULT VALUE 0)
PrimaryGeoId (INT NOT NULL)
Tags (VARCHAR 255 NULL)
SpecialSeriesId (INT NULL)
...More Fields
Channels and Categories
The TON Channels and Categories System uses a 3 level structure:
Channel
-> Category
-> Sub Category
Only the Channel is required. In TON, we have a channel named "Fishing" which contains all fishing related content. Beneath fishing, we have a set of categories, and beneath each category, we optionally have a set of sub categories.
The only requirement is that content is linked to, at a minimum, a Channel. Selecting Categories or SubCategories is optional.
Database Table Schema - Channels, Categories, SubCategories
tblChannels
ChannelId
ChannelName
ChannelDescription
ChannelType (TINYINT) //0 = Non Public Channel)
tblCategories
CategoryId
CategoryName
CategoryDescription
ChannelId
tblSubCategories
SubCategoryId
SubCategoryName
SubCategoryDescription
CategoryId
Challenge #1 - Inner Joins on Content with no Category or Sub Category
We handled this by defaulting the PrimaryCategoryId and PrimarySubCategoryId to the value zero (0). Then, we created an entry in tblCategories and tblSubCategories with a primary key value of zero (0) and a title of "{None}". This ensures that joins from tblContent on these tables would always result in records being produced, and allowed us not to use left joins to create content views.
Challenge #2 - Which Category does this content belong in?
A flat category structure requires that you link an article or photo or video to a specific category. However, in many instances, content could be linked to more than 1 category or sub category. Our final decision to handle this scenario was the use of Tags. By using tags, we could have a scaleable categorization system that allows us to link like content using keywords in addition to a content's category.
For instance, an article on Walleye Ice Fishing could be linked to the Walleye category OR the Ice Fishing Category. This setup allows the user to link the content to the Ice Fishing category, but then tag it with they keyword Walleye. This way, we can still group all Walleye content together, regardless of category by simply querying the tags field.
The Tags field is setup as a varchar field, and the tags are keywords separated by spaces.
Challenge #3 - Is this content related to Minnesota? - North Dakota? -
The solution to this problem is utilizing a Geo "tag" of sorts that allows us to group content into specific regions or places. Our Geos System was designed to handle any type of place or region of the world whether it is political areas (counties / states) or more specific areas such as Bodies or Water, hunting units, etc.
All content can then be linked to a place in the world by selecting the appropriate Geo
Challenge #4 - Grouping content of different categories
We needed a way to group together content that may be spread across different categories or regions. For instance, if we ran a series of articles on a topic such as Game Preparation, these articles could be about big game, small game, waterfowl, etc. etc. Our solution was to create a Special Series key that allows us to link content to a single Series. For example, an author could write a series of articles, and then we could display that series of articles together, without worrying about what categories they are in. In addition, then these articles could appear within the site in the various sections, grouped together with other content on similar topics.
Conclusion
This is just a brief overview of the cateorization architecture of the TON Platform. We will write additional articles in the future on specific topics such as auto tagging, and how we developed the larger database schema and PHP Classes that handle the business logic.
Tags: content, ton, system, categorization, platform
More Tags: content not only to their site, Non Public Channel, Geos, manager for Site, site manager, author, PHP, Minnesota, North Dakota, PHP,
Region: Global
Categories: Hunting > Other Hunting
You must be signed in to comment on this Article
Digg
Facebook
MySpace
del.icio.us