views:

144

answers:

3

Machine tags are more precise tags: http://www.flickr.com/groups/api/discuss/72157594497877875. They allow a user to basically tag anything as an object in the format object:property=value

Any tips on a rdbms schema that implements this? Just wondering if anyone has already dabbled with this. I imagine the schema is quite similar to implementing rdf triples in a rdbms

+1  A: 

Unless you start trying to get into some optimisation, you'll end up with a table with Object, Property and Value columns Each record representing a single triple.

Anything more complicated, I'd suggested looking the documentation for Jena, Sesame, etc.

Mat
A: 

I ended up implementing this schema

+1  A: 

If you want to continue with the RDBMS approach then the following schema might work

CREATE TABLE predicates (
  id INT PRIMARY KEY,
  namespace VARCHAR(255),
  localName VARCHAR(255)
) 

CREATE TABLE values (
  subject INT,
  predicate INT,
  value VARCHAR(255)
)

The table predicates holds the tag definitions and values the values.

But Mat is also right. If there are more requirements then it's probably feasible to use an RDF engine with SQL persistence support.

Timo Westkämper

related questions