More than a decade ago, I wrote the basis of my personal site, based on having heterogeneous items (links, pages, etc..) classified into categories (a tree of categories). An item could be into more than one category, and one category could be an alias for another. But after using Delicious and Gmail, now I prefer to have items grouped by tags. And instead of having categories and category tree (like folders), I think that a more flexible organization could be based on predicates over tags: that is, instead of having a Category Programming –> C#, I could have a predicate that returns all items tagged with “programming” and “c#”. Sometimes, I need key-value tags, like “author:unclebob”, or “project:storm”.
From the readme:
An item has
data: Arbitrary value you supplied
tags: An array of tags. A tag could be a non-empty string or an object with only one property with non-empty value.
Once created, the item has an associated id, supplied by the engine.
The project has an in-memory model. A set of tags can be associated to an arbitrary data item. Usually, you don’t associate all customer data to a set of tags; instead, you could associate a customer id. The arbitrary data could reside in your database or it could an URL, or something else. The key feature is: you can associate an item to a set of tags, and retrieve items with given tags.
Think about this: you could have a huge link collection, and use SimpleTags to organize it. Or documents, instead of links. Or photos/images. You could use tagging for different purpose. It’s a powerful idea to be applied in many domains and scenarios.
I think to add a web site as a concrete use case, where you can add URLs and tag them, define “Categories” using tag predicates, explore the defined categories, and search items by tags. After this sample, I could implement something more concrete, like a tagged to-do list, or a list of tasks tagged by project, status (pending, closed, …), iteration, assignee, etc. I used a similar private app for tracking agile project backlog in one of my customers, and I feel it’s a good test bed case to be tackled by my tag engine project.
It could be used as an excuse to learn Express or to use my SimpleWeb project. In any case, it will be fun
As usual, SimpleTags code was written using TDD.
Angel “Java” Lopez