[Tagdb] DB Questions for Drupal Tagging by Other Users

Kent Bye kent at kentbye.com
Sun Aug 21 21:53:55 GMT 2005


Hey everyone.

Currently Drupal can add folksonomy tags to the node that a single 
author creates, but it's not yet possible to have other users internally 
add tags to other nodes created by other users.

I have a database question for specifying a special node-type in Drupal 
for tagging folksonomy data by other users.

I think that it'd be probably possible to do this using the "flexinode 
module," but I'm not sure if it would provide scalability problems since 
it spaces out the metadata across so many rows.

So I thought I'd give an example of what I see the current 
implementation would look like with flexinode, and ask the following 
questions:

Would the following setup work?
What would a better table setup be?
Is the way that Drupal tracks tags the most optimized and scalable?
What are other tables for indexing would be useful?

Here's a summary of third-party Drupal tagging, with a more detailed 
example below:
NODE: nid / type / title / uid
TERM_NODE: nid / tid -- [1st folksonomy tag]
TERM_NODE: nid / tid -- [2nd folksonomy tag]
TERM_NODE: nid / tid -- [3rd folksonomy tag]
TERM_DATA: tid / vid / name -- [1st folksonomy tag]
TERM_DATA: tid / vid / name -- [2nd folksonomy tag]
TERM_DATA: tid / vid / name -- [3rd folksonomy tag]
FLEXINODE_DATA: nid / field_id / textual_data / numeric_data / 
serialized_data -- [URL of object being tagged]
FLEXINODE_DATA: nid / field_id / textual_data / numeric_data / 
serialized_data -- [Additional Comments]

Thanks,
-Kent Bye
Director, The Echo Chamber Project
MetaThought Productions
http://www.echochamberproject.com

* * * * * * * * *
The following example shows how the author of blog entry / node #624 
(i.e. http://www.echochamberproject.com/node/624) titled "Vlog Episode 
#2" by user id #2 can currently store two folksonomy tags -- 
Collaboration (tid=20) & Folksonomy (tid=21)

For other users to add other folksonomy tags, then a special "flexinode" 
has to be created, which is shown after this example -- along with a 
reiteration of my question.

- - - - - - - - --
NODE:
[Row #1]
nid: 624
type: blog entry
title: Vlog Episode 1
uid: 2
- - - - - - - - --
TERM_NODE:
[Row #1]
nid: 624
tid: 20

[Row #2]
nid: 624
tid: 21
- - - - - - - - --
TERM_DATA:
[Row #1]
tid: 20
vid: 2  (i.e vocabulary id)
name: "Collaboration"

[Row #2]
tid: 21
vid: 2
name: "Folksonomy"
- - - - - - - - --

So above is how folksonomy tags are currently stored.

The proposal below shows how other users could store tags to a node 
within Drupal.

The flexinode is stored as a normal node that references a couple of 
other flexinode tables:

The following example shows how the flexinode node #599 could be used to 
tag node #283 by a  different user with the three different folksonomy 
tags -- Film (tid=73), Vlog (tid=106) & Folksonomy (tid=21)

- - - - - - - - --
NODE:
[Row #1]
nid: 599
type: flexinode-3
title: "Tags for node 624"
uid: 3
- - - - - - - - --
TERM_NODE:
[Row #1]
nid: 599
tid: 73

[Row #2]
nid: 599
tid: 106

[Row #3]
nid: 599
tid: 21
- - - - - - - - --
TERM_DATA:
[Row #1]
tid: 73
vid: 2  (i.e vocabulary id)
name: "Film"

[Row #2]
tid: 106
vid: 2
name: "Vlog"

[Row #3]
tid: 21
vid: 2
name: "Folksonomy"
- - - - - - - - --

*** So far this is the same as before, below are the flexinode tables 
that are different ***

- - - - - - - - --
FLEXINODE_TYPE:
[Row #1]
ctype: 3
Name: "Tag a Node"
Description: "This flexinode type is used for others to tag a node"
- - - - - - - - --
FLEXINODE_FIELD:
Row #1]
field_id: 19
ctype: 3
label: "URL / Node #"

[Row #2]
field_id: 19
ctype: 3
label: "Additional Comments"
- - - - - - - - - -
FLEXINODE_DATA
[Row #1]
nid:599
field_id: 19  [i.e. "URL / Node #"]
textual_data: NULL
numeric_data: 624
serialized_data: NULL

[Row #2]
nid:599
field_id: 20  [i.e. "Additional Comments"]
textual_data: "This URL is really great"
numeric_data: NULL
serialized_data: NULL
- - - - - - - - - -

Again, here are my QUESTIONS:
Would the described flexinode table setup work?
What would a better table setup be?
Is the way that Drupal tracks tags the most optimized and scalable?
What are other tables for indexing would be useful?

THANKS!
-Kent.



More information about the Tagdb mailing list