Profile. More...

#include <gprofile.h>

Inheritance diagram for GProfile:
[legend]

Public Member Functions

 GProfile (GSession *session, GUser *usr, tProfileType type, const R::RString name, bool s)
 
 GProfile (GSession *session, GUser *usr, tProfileType type, size_t id, size_t blockid, const R::RString name, size_t grpid, R::RDate a, R::RDate u, R::RDate c, bool s, double score, char level, size_t nbf)
 
virtual R::RCString GetClassName (void) const
 
int Compare (const GProfile &profile) const
 
tProfileType GetProfileType (void) const
 
GUserGetUser (void) const
 
bool IsSocial (void) const
 
R::RDate GetUpdated (void) const
 
R::RDate GetComputed (void) const
 
bool MustCompute (void) const
 
size_t GetGroupId (void) const
 
void SetGroup (size_t groupid)
 
R::RDate GetAttached (void) const
 
double GetConfidenceScore (void) const
 
char GetConfidenceLevel (void) const
 
double GetAgreementRatio (const GProfile *prof, size_t nbmin) const
 
double GetDisagreementRatio (const GProfile *prof, size_t nbmin) const
 
size_t GetNbAssessedDocs (void) const
 
R::RCursor< GFdbkGetFdbks (void) const
 
GFdbkGetFdbk (size_t docid) const
 
 ~GProfile (void)
 
- Public Member Functions inherited from GDescriptionObject< GProfile >
 GDescriptionObject (GSession *session, size_t id, size_t blockid, tObjType objtype, const R::RString &name)
 
void ReleaseVectors (void)
 
const GDescriptionoperator() (void) const
 
R::RConstCursor< GVectorGetVectors (void) const
 
const GVectorGetVector (GConcept *metaconcept) const
 
bool IsIn (const GConcept *concept) const
 
bool IsDefined (void) const
 
tObjState GetState (void) const
 
size_t GetId (void) const
 
size_t GetBlockId (void) const
 
virtual ~GDescriptionObject (void)
 
- Public Member Functions inherited from GObject
 GObject (GSession *session, size_t id, const R::RString &name, tObjType type)
 
 GObject (const GObject &obj)
 
void VerifyStatements (tStatementElement what, size_t size)
 
int Compare (const GObject &obj) const
 
int Compare (size_t id) const
 
int Search (const GObject &obj) const
 
int Search (const R::RString &name) const
 
GSessionGetSession (void) const
 
size_t GetId (void) const
 
void SetId (size_t id)
 
tObjType GetObjType (void) const
 
R::RCursor< GStatementGetObjs (const GStatement *obj, tStatementElement what)
 
virtual void HandlerNotFound (const R::RNotification &notification)
 
virtual ~GObject (void)
 
- Public Member Functions inherited from RObject
 RObject (const RString &name=RString::Null)
 
int Compare (const RObject &obj) const
 
RString GetName (void) const
 
void PostNotification (const hNotification handle)
 
void PostNotification (const RCString &name)
 
void PostNotification (const hNotification handle, T data)
 
void PostNotification (const RCString &name, T data)
 
void InsertObserver (tNotificationHandler handler, const hNotification handle, RObject *object)
 
void InsertObserver (tNotificationHandler handler, const RCString &name, RObject *object)
 
void InsertObserver (tNotificationHandler handler, const hNotification handle)
 
void InsertObserver (tNotificationHandler handler, const RCString &name)
 
void InsertObserver (tNotificationHandler handler, RObject *object)
 
void InsertObserver (tNotificationHandler handler)
 
void DeleteObserver (void)
 
void DeleteObserver (const hNotification handle, RObject *object)
 
void DeleteObserver (const RCString &name, RObject *object)
 
hNotification GetNotificationHandle (const RCString &name) const
 
RCString GetNotificationName (const hNotification handle) const
 
virtual ~RObject (void)
 

Static Public Member Functions

static tObjType GetType (void)
 
- Static Public Member Functions inherited from GDescriptionObject< GProfile >
static bool HasDesc (void)
 
- Static Public Member Functions inherited from GObject
static bool HasDesc (void)
 
static bool HasTree (void)
 

Private Member Functions

bool InsertFdbk (size_t docid, tFdbkType fdbk, const R::RDate &done)
 
void DeleteFdbk (size_t docid)
 
void Update (GDescription &desc)
 
void Clear (bool disk)
 
void ClearFdbks (void)
 
void WasUpdated (size_t docid)
 

Private Attributes

GUserUser
 
tProfileType Type
 
R::RContainer< GFdbk, true, true > Fdbks
 
bool Social
 
R::RDate Updated
 
R::RDate Computed
 
size_t GroupId
 
R::RDate Attached
 
double Score
 
char Level
 

Additional Inherited Members

- Protected Member Functions inherited from GDescriptionObject< GProfile >
virtual bool LoadVectors (void)
 
- Protected Attributes inherited from GDescriptionObject< GProfile >
tObjState State
 
- Protected Attributes inherited from GObject
GSessionSession
 
size_t Id
 
tObjType ObjType
 
R::RContainer< GStatement,
false, true > * 
Subjects
 
R::RContainer< GStatement,
false, false > * 
Predicates
 
R::RContainer< GStatement,
false, false > * 
Values
 
- Protected Attributes inherited from RObject
RString Name
 

Detailed Description

Profile.

The GProfile class provides a representation of a profile, i.e. a description of some knowledge attached to people. This can be an interest, an expertise, etc.

Each profile is associated to a set feedbacks on documents.

Constructor & Destructor Documentation

GProfile ( GSession session,
GUser usr,
tProfileType  type,
const R::RString  name,
bool  s 
)

Construct a new profile.

Parameters
sessionSession.
usrUser of the profile.
typeType of the profile.
nameName of the profile.
sSocial?
GProfile ( GSession session,
GUser usr,
tProfileType  type,
size_t  id,
size_t  blockid,
const R::RString  name,
size_t  grpid,
R::RDate  a,
R::RDate  u,
R::RDate  c,
bool  s,
double  score,
char  level,
size_t  nbf 
)

Construct a profile.

Parameters
sessionSession.
usrUser of the profile.
typeType of the profile.
idIdentifier of the profile.
blockidIdentifier of the block.
nameName of the profile.
grpidCommunity identifier.
aDate where it was attached.
uDate of the last updated.
cDate of the last computation.
sSocial?
scoreScore of the profile.
levelLevel of the profile.
nbfNumber of Feedbacks.
~GProfile ( void  )

Destructor of the profile. It is removed from its user and community.

Member Function Documentation

virtual R::RCString GetClassName ( void  ) const
virtual
Returns
the class name.

Reimplemented from GObject.

static tObjType GetType ( void  )
static

Give the type of the object.

Returns
otProfile
int Compare ( const GProfile profile) const

Compare two profiles by comparing their identifier.

See also
R::RContainer
Parameters
profileProfile.
Returns
int
tProfileType GetProfileType ( void  ) const
Returns
the type of the profile.
GUser* GetUser ( void  ) const

Get the user of the profile.

Returns
Pointer to the user.
bool IsSocial ( void  ) const

Look if the profile is social.

Returns
boolean value.
R::RDate GetUpdated ( void  ) const

Get the date of the last update of the profile. It may be the date of the latest document feedback or an update of one of the documents on which some feedback exists.

Returns
R::RDate.
R::RDate GetComputed ( void  ) const

Get the date of the last analysis of the profile.

Returns
R::RDate.
bool MustCompute ( void  ) const

Verify if the profile must be (re-)computed.

size_t GetGroupId ( void  ) const

Get the community holding the profile.

void SetGroup ( size_t  groupid)

Set the community holding the profile.

Parameters
groupidIdentifier of the group.
R::RDate GetAttached ( void  ) const

Get the date of the last attachment.

Returns
R::RDate.
double GetConfidenceScore ( void  ) const

The confidence score represent an absolute measure of the confidence of a given profile.

Returns
the confidence score of the profile.
char GetConfidenceLevel ( void  ) const

The confidence level represent a relative measure of the confidence of a given profile in comparison to all other profiles.

Returns
the confidence level of the profile.
double GetAgreementRatio ( const GProfile prof,
size_t  nbmin 
) const

Compute the agreement ratio between two profiles, i.e. the ratio between the number of documents assessed as relevant by both profiles, and the total number of documents assessed by both profiles.

Parameters
profSecond profile.
nbminMinimum number of common documents for a non null ratio.
double GetDisagreementRatio ( const GProfile prof,
size_t  nbmin 
) const

Compute the disagreement ratio between two profiles, i.e. the ratio between the number of documents assessed as relevant by one of the profiles and differently by the other one, and the total number of documents assessed by both profiles.

Parameters
profSecond profile.
nbminMinimum number of common documents for a non null ratio.
size_t GetNbAssessedDocs ( void  ) const

Get the number of assessed documents.

R::RCursor<GFdbk> GetFdbks ( void  ) const

Get a Cursor on the feedback for the profile.

GFdbk* GetFdbk ( size_t  docid) const

Get the feedback of the profile on a specific document.

Parameters
docidIdentifier of the document.
bool InsertFdbk ( size_t  docid,
tFdbkType  fdbk,
const R::RDate done 
)
private

Add a feedback to the list of the profile.

Parameters
docidIdentifier of the document.
fdbkFeedback type.
doneDate of the assessment.
Returns
true if it is a new feedback.
void DeleteFdbk ( size_t  docid)
private

Delete a feedback from the list of the profile.

Parameters
docidIdentifier of the document.
void Update ( GDescription desc)
private

Update the representation of the profile once a computation was done. The computed date and the status are updated.

If the profile is an internal one, the following steps are done:

  1. An 'hProfiles[oeAboutToBeUpdated]' notification is send.
  2. The references are updated.
  3. Existing in memory description is replaced.
  4. If necessary, the profile and its description are saved.
  5. An 'hProfiles[oeUpdated]' notification is send.

If the profile is an external one, its description is replaced.

Parameters
descDescription to assign.
Warning
The description is cleared by this method.
void Clear ( bool  disk)
private

Clear the information associated with the profile.

Parameters
diskClear the reference to the corresponding block on disk.
void ClearFdbks ( void  )
private

Clear the assessment of the profile.

void WasUpdated ( size_t  docid)
private

This method is call by a document when it was modified.

Parameters
docidIdentifier of the document.

Member Data Documentation

GUser* User
private

The owner of the profile.

tProfileType Type
private

Type of the profile.

R::RContainer<GFdbk,true,true> Fdbks
private

Documents assessed by profile.

bool Social
private

Determine if the profile is social, i.e. prefer to be grouped with someone also if the similarity is not evident rather to stay alone.

R::RDate Updated
private

Date of the update of the profile (new assessments).

R::RDate Computed
private

Date of last profile computing.

size_t GroupId
private

Identifier of the corresponding community.

R::RDate Attached
private

Date of the attachment of the profile into the community.

double Score
private

Confidence score (to maximize).

char Level
private

Confidence Level (to maximize).