net.firstpartners.rp.mid.category
Class BasicCategory

java.lang.Object
  extended by net.firstpartners.rp.mid.category.BasicCategory
All Implemented Interfaces:
ICategory

public class BasicCategory
extends java.lang.Object
implements ICategory

A Category is a set of Data. Many Categories make up a knowledgebase. This is a basic implementation of a Category

Author:
brownpa

Field Summary
protected  org.apache.log4j.Logger logger
          Logger for this class and subclasses
private  double m_categoryScore
          Direct score of the category
private  IDataExtractor m_extractor
          Extractor handler of the category
private  java.lang.String m_lastUpdate
          Time stamp for last category update
private  java.lang.String m_name
          Category name
private  java.lang.String m_original
          Original category location
private  java.lang.String m_uri
          Uri location of the category
 
Constructor Summary
BasicCategory(java.lang.String original, java.lang.String name, java.lang.String uri, IDataExtractor extractor)
          Creates a new BasicCategory object.
 
Method Summary
 void generateCategoryData(ICategoryManager manager)
          Construct the category 1.
 double getCalculatedScore()
          Get the calculated score of the category
 java.lang.String getCategoryName()
          Get the name of this Category
 double getCategoryScore()
          Get the category scroe
 IDataExtractor getDataSource()
          Get a Handle to the Datasource used when creating this Category
ie where we got the original data from
 java.lang.String getLastUpdate()
          Get the last update of the document
 java.lang.String getLocation()
          Get the category uri location
 java.lang.String getOriginalLocation()
          Get original location of the category
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.log4j.Logger logger
Logger for this class and subclasses


m_original

private java.lang.String m_original
Original category location


m_name

private java.lang.String m_name
Category name


m_uri

private java.lang.String m_uri
Uri location of the category


m_extractor

private IDataExtractor m_extractor
Extractor handler of the category


m_categoryScore

private double m_categoryScore
Direct score of the category


m_lastUpdate

private java.lang.String m_lastUpdate
Time stamp for last category update

Constructor Detail

BasicCategory

public BasicCategory(java.lang.String original,
                     java.lang.String name,
                     java.lang.String uri,
                     IDataExtractor extractor)
Creates a new BasicCategory object.

Parameters:
original - Original location
name - Category name
uri - URI of the information to be added
extractor - The extractor which will handle the information
Method Detail

generateCategoryData

public void generateCategoryData(ICategoryManager manager)
                          throws RpException
Construct the category 1. generate the tuple from the information using the extractor 2. store the information as RDF using the category store 3. add the information to the index

Parameters:
manager - Manager responsable for
Throws:
RpException - Error occur in process the information

getOriginalLocation

public java.lang.String getOriginalLocation()
Get original location of the category

Specified by:
getOriginalLocation in interface ICategory
Returns:
Original location of the category

getCategoryName

public java.lang.String getCategoryName()
Get the name of this Category

Specified by:
getCategoryName in interface ICategory
Returns:
Name of this category

getDataSource

public IDataExtractor getDataSource()
Get a Handle to the Datasource used when creating this Category
ie where we got the original data from

Specified by:
getDataSource in interface ICategory
Returns:
IDataExtractor

getLocation

public java.lang.String getLocation()
Get the category uri location

Specified by:
getLocation in interface ICategory
Returns:
Original location

getLastUpdate

public java.lang.String getLastUpdate()
Get the last update of the document

Specified by:
getLastUpdate in interface ICategory
Returns:
Last update for the document!

getCategoryScore

public double getCategoryScore()
Get the category scroe

Specified by:
getCategoryScore in interface ICategory
Returns:
The category score

getCalculatedScore

public double getCalculatedScore()
Get the calculated score of the category

Specified by:
getCalculatedScore in interface ICategory
Returns:
The calculated score