com.flickrrecsys.db
Class DbTagCloud

java.lang.Object
  extended by com.flickrrecsys.db.DbTagCloud

public class DbTagCloud
extends java.lang.Object

Connecting to tag cloud

Author:
Hossein Ghodsi

Constructor Summary
DbTagCloud(java.lang.String path)
          Constructor which gets the connection to the database
 
Method Summary
 boolean anyTagExistForAUser(java.lang.String nsid)
          Check if the tag and user id already exist
 boolean checkExistingComOfTagAndNsid(java.lang.String nsid, int tid)
          Check if the combination of user id and a tag already exists
 void delete(java.lang.String nsid)
          Delete tag cloud by nsid
 java.util.Vector<Similarity> getSimilaritiesUsingTFIDF(java.util.Vector<java.lang.String> userToCompare, java.lang.String nsid)
          pass two user to this method and get the TF-IDF value of similarity
 void insert(java.lang.String nsid, int tid, int freq)
          Insert tag cloud individuals
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbTagCloud

public DbTagCloud(java.lang.String path)
Constructor which gets the connection to the database

Parameters:
path - to where the database details are
Method Detail

insert

public void insert(java.lang.String nsid,
                   int tid,
                   int freq)
            throws java.sql.SQLException,
                   java.security.NoSuchAlgorithmException,
                   java.io.UnsupportedEncodingException
Insert tag cloud individuals

Parameters:
nsid - user id from the flickr website
tid - tag id
freq - tag frequency
Throws:
java.sql.SQLException
java.security.NoSuchAlgorithmException
java.io.UnsupportedEncodingException

checkExistingComOfTagAndNsid

public boolean checkExistingComOfTagAndNsid(java.lang.String nsid,
                                            int tid)
                                     throws java.sql.SQLException
Check if the combination of user id and a tag already exists

Parameters:
nsid - user id from Flickr website
tid - tag id
Returns:
true / false
Throws:
java.sql.SQLException

getSimilaritiesUsingTFIDF

public java.util.Vector<Similarity> getSimilaritiesUsingTFIDF(java.util.Vector<java.lang.String> userToCompare,
                                                              java.lang.String nsid)
                                                       throws java.sql.SQLException
pass two user to this method and get the TF-IDF value of similarity

Parameters:
userToCompare - Vector of people be compared
nsid - user id from the Flickr website
Returns:
Vector of similarity
Throws:
java.sql.SQLException

anyTagExistForAUser

public boolean anyTagExistForAUser(java.lang.String nsid)
                            throws java.sql.SQLException
Check if the tag and user id already exist

Parameters:
nsid - user id from the flickr website
Returns:
true/false
Throws:
java.sql.SQLException

delete

public void delete(java.lang.String nsid)
            throws java.sql.SQLException
Delete tag cloud by nsid

Parameters:
nsid - user id from the flickr website
Throws:
java.sql.SQLException