Angel \”Java\” Lopez on Blog

January 25, 2013

SimpleTags (1) First Ideas

Filed under: JavaScript, NodeJs, Programming, SimpleTags — ajlopez @ 4:52 pm

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”.

So, some days ago, I started a new project, written in JavaScript/Node.js, named SimpleTags:

https://github.com/ajlopez/SimpleTags

From the readme:

var itemId = engine.createItem('http://nodejs.org', [ 'nodejs', 'javascript', 'engine', 'programming' ]);

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.

Keep tuned!

Angel “Java” Lopez

http://www.ajlopez.com

http://twitter.com/ajlopez

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Shocking Blue Green Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 57 other followers

%d bloggers like this: