hyp report

37
B. Comp. Dissertation Design and Development of a Knowledge Community System By Le Phan Huu Bang Department of Computer Science School of Computing National University of Singapore 2008/2009

Upload: huu-bang

Post on 22-Mar-2016

229 views

Category:

Documents


0 download

DESCRIPTION

My HYP Report

TRANSCRIPT

Page 1: HYP Report

B. Comp. Dissertation

Design and Development of a

Knowledge Community System

By

Le Phan Huu Bang

Department of Computer Science

School of Computing

National University of Singapore

2008/2009

Page 2: HYP Report

2

B. Comp. Dissertation

Design and Development of a

Knowledge Community System

By

Le Phan Huu Bang

Department of Computer Science

School of Computing

National University of Singapore

2008/2009

Project Number: H022560

Advisor: Assoc Prof Poo Chiang Choon, Danny

Deliverables:

Report: 1 Volume

Program: 1 CD

Page 3: HYP Report

i

Abstract Today, when the technology is growing tremendously, knowledge has become a very

important part in our lives. The amount of knowledge that people need to obtain today is

more than ever before. As a result, being able to seek for the knowledge and information you

need in the fastest time is a critical but never easy task for every one of us.

In this project, we will try to design and develop a system to facilitate a Knowledge

Community (K-Comm) in which people can satisfy their needs of information and knowledge

in an easy and quick manner. The system will also serve as a knowledge-based social

network where individuals are encouraged and provided with a comfortable platform to share

and exchange their knowledge and expertise with other users.

We first do an online research and look for similar websites that have attempted to

either meet the demand of knowledge seeking or provide a social network platform to

facilitate exchanging of information for human relationship. After that, we come up with the

feature requirements and detailed specifications for the system that we are going to build.

Finally, we choose the appropriate framework and start the design and implementation of the

Knowledge Community System.

Subject Descriptors

C.2.1 Something

C.2.1 Something

Keywords

Knowledge Community, Knowledge Areas, Tacit Knowledge, Knowledge

Management, Social Network

Implementation Software and Hardware

PHP, Ubuntu Linux, Firefox

Page 4: HYP Report

ii

Acknowledgement I would like to express my sincerest gratitude to my supervisor, Dr. Poo Chiang Choon,

Danny, for his invaluable guidance. I appreciate him for his time, ideas and advices with me

throughout the work of this project.

Special thank to Mr. Lek Hsiang Hui, for sharing his knowledge and programming

techniques with me. This precious experience helped me a great deal in this project.

I also would like to express my appreciation to Mr Cai Shao Jiang for helping out in the

implementation of the User Profiling package of the system.

Finally, I wish to give credit to those who have in one way or another given support in

the completion of this project.

Page 5: HYP Report

iii

Table of Contents Abstract ............................................................................................................................. i

Acknowledgement ............................................................................................................ ii

Chapter 1 - Introduction ................................................................................................... 1

1.1 What is Knowledge ................................................................................................ 1

1.2 The Need of Knowledge Sharing ........................................................................... 1

1.3 Difficulties in Knowledge Sharing ......................................................................... 2

Chapter 2 - Literature Review .......................................................................................... 3

2.1 Yahoo and Google Answers ................................................................................... 3

2.2 Youtube .................................................................................................................. 3

2.3. Social Networks .................................................................................................... 3

2.4 Blogs and Forums ................................................................................................... 4

2.5 Knowledge Management Systems ......................................................................... 4

Chapter 3 - System Overview........................................................................................... 6

3.1 What is K-Comm .................................................................................................... 6

3.2 Features .................................................................................................................. 6

3.2.1 Social Network Features ................................................................................. 6

3.2.2 Knowledge-based Features .............................................................................. 6

3.3 System Components ............................................................................................... 7

3.3.1 The User Profiling Package ............................................................................. 7

3.3.2 The Questions and Answers Package .............................................................. 8

3.3.3 The User Interface ......................................................................................... 11

Chapter 4 - Implementation ............................................................................................ 13

4.1 Elgg Framework ................................................................................................... 13

4.1.1 What is Elgg .................................................................................................. 13

4.1.2 Elgg Engine ................................................................................................... 13

4.1.2 Mapping from Elgg to K-Comm ................................................................... 16

Page 6: HYP Report

iv

4.2 Core Library ......................................................................................................... 17

4.2.1 Question Class ............................................................................................... 18

4.2.2 Category Class ............................................................................................... 18

4.2.3 Answer Class ................................................................................................. 19

4.2.4 Integration...................................................................................................... 20

4.3 Widgets ................................................................................................................. 20

4.4 User Interface ....................................................................................................... 21

4.5 Skill Level System ................................................................................................ 21

4.5.1 Requirements ................................................................................................. 23

4.5.2 Unsuccessful Attempts .................................................................................. 24

4.5.3 Our Approach ................................................................................................ 25

Chapter 5 - Conclusion ................................................................................................... 27

5.1 Summary .............................................................................................................. 27

5.2 Difficulties and Limitations .................................................................................. 27

5.3 Recommendations for Further Work .................................................................... 27

References ...................................................................................................................... 29

Appendix ........................................................................................................................ 30

Functions provided for metadata ............................................................................ 30

Functions provided for annotations ........................................................................ 30

Page 7: HYP Report

1

Chapter 1 - Introduction Before we can come up with the detailed requirements for our K-Comm System, we

first need to understand and delineate the definition of knowledge that we are using. In

addition, we also have to identify the need of knowledge sharing in the society we are living

now. Finally, we will point out what remain as difficulties in the process of sharing and

looking for the knowledge that we want.

1.1 What is Knowledge Knowledge is defined in the Oxford English Dictionary as (i) expertise, and skills

acquired by a person through experience or education; the theoretical or practical

understanding of a subject, (ii) what is known in a particular field or in total; facts and

information or (iii) awareness or familiarity gained by experience of a fact or situation

(Wikipedia)

The knowledge we are going to deal with in this project is everything that a person

knows! It can be knowledge about a specific topic in a specialised field that the organization

is working on (e.g. How to create a Thread in Java) but it can also be knowledge about

general interest in which everyone is interested (e.g. Which bus can I take to go to NUS). It

can be both explicit and tacit knowledge. In general, we try to maximise and gather as much

as possible the knowledge potential of every individual in the organization or society

irrespective of the domains.

1.2 The Need of Knowledge Sharing To begin with, it is inevitable that any company needs knowledge to survive. Where

does the knowledge come from? It comes from individual member who works for the

company. As a result, most of the companies are likely to have a high interest in encouraging

their employees to share the knowledge that they have with other people in order to benefit

everyone and in turn benefit the company.

Moreover, in a company or a community, more often than not, there are many repetitive

questions that are being asked every day. People are asking repetitive questions again and

again because they do not know that other people have already had the answers for those

questions and the reason behind this is people are unwilling to share what they know.

Page 8: HYP Report

2

Therefore, if we can find a way to encourage people to share the knowledge that they possess

and then capture it in a system, we will be able to avoid the repetitive questions and hence

will save a lot of time and efforts.

Finally, knowledge is growing by sharing. If we do not share, our common knowledge

will not grow. In fact, many organizations often do not know what they actually know

because they fail to persuade their employees to share knowledge. When people leave the

organisation, their knowledge will walk out of the door with them. Therefore, encouraging

knowledge sharing is the only way to keep the knowledge sustaining and growing.

1.3 Difficulties in Knowledge Sharing One of the main difficulties in knowledge sharing is that people are reluctant to share

what they know with others. There are many reasons for this unwillingness. First of all,

people might find that they have spent a lot of time, efforts and even money to obtain their

knowledge. As a result, they feel unreasonable and lack of interest to share it with someone

else. Another widely held opinion is that people think their possession of knowledge has

some value and can bring them some certain advantages and even power over those who do

not have that knowledge. They tend to think that once they share it with someone else and the

others capture that knowledge, they will not have the advantages any more. Finally, it seems

to be a nature of human that people often do not trust each other. As a result, they are often

reluctant to share their knowledge with someone they do not know very well.

In order to overcome this reluctance, we need to reward people for their contribution in

the knowledge sharing process. We need to make more incentives to encourage them. Some

people prefer certain kind of recognition for their efforts and we can do that to persuade them

to open the door of their knowledge treasure. Finally, we can enhance the communication

channel between people and provide them with a comfortable and friendly environment to

work and collaborate with other people. This is to tighten up their relationship and help them

feel more secure to share the knowledge with their friends whom they feel trustable.

Page 9: HYP Report

3

Chapter 2 - Literature Review According to our research, there exist in the public domain similar systems but each of

them typically only serves for one or a few aspects that a knowledge seeker desires. There

were no single systems which can satisfy all the needs in general. K-Comm comes in and

tries to bridge the gaps between the existing systems as well as provide new features.

2.1 Yahoo and Google Answers Yahoo and Google Answers are a few of the sites which provide the closest features to

our K-Comm system. Both allow users to post questions and answers as well as provide the

mechanism to rate and give comments to the questions and answers, report abuse of the

system (e.g. posts that violates the terms and conditions, illegal questions, etc.). Yahoo

Answers even allows users to star a question, a very similar feature to our “Mark as

interesting question” function. Yahoo Answers have a better organization of the questions

where they not only classify questions and answers based on categories but they also

differentiate resolved and open questions.

Our K-Comm system also provides similar functions. In addition, we also evaluate and

monitor the quality of the knowledge of the answerers and assist the users in identifying those

people who are more likely to have a better answer. Moreover, we support other social

networking features such as friend relationship, blogs, forums, and so on.

2.2 Youtube Youtube started from a video sharing website. People come here to share their

entertainment and knowledge. However, things that a person can share on Youtube are

limited to those which can be transformed into a video format. Although this is an advantage

to some extent because sometimes it helps the users illustrate the idea better, there are a lot

more other types of information and knowledge that cannot be captured in video.

In K-Comm, we do not restrict users to any representation format of knowledge. People

have a choice to share either text only or video or audio contents. As a result, we can capture

a wider range of knowledge than what Youtube can support.

2.3. Social Networks Below is the list of social networks that we have visited and analysed:

Page 10: HYP Report

4

• Friendster: http://www.friendster.com

• Facebook: http://www.facebook.com

• Twitter: http://www.twitter.com

• MySpace: http://www.myspace.com

Most of the social network sites are focused on helping people keep in touch with their

friends and maintain the relationship between them. What people often share in social

networks are things that they do in their life and there is very little knowledge factor involved.

Our K-Comm system, on the contrary, focuses on the knowledge aspect. We are more

interested in the knowledge being shared among the system users. Although we also support

fundamental social networking features, those features are to facilitate and maintain a

comfortable and collaborative environment for the knowledge sharing process.

2.4 Blogs and Forums We have the similar features in K-Comm but we do not restrict ourselves to only blogs

and forums. In addition, while blogs and forums are often concerned about some certain areas

of interest, we are open to knowledge across different domains.

2.5 Knowledge Management Systems Similar to blogs and forums, Knowledge Management Systems are often used in a

restricted environment such as a company or organisation where relevant knowledge is

limited to certain specific fields. In addition, Knowledge Management Systems are also often

lack of the social network features.

The table below summarises the differentiating points of K-Comm over other similar

technologies:

Differentiating Points

Yahoo Answers / Google

Answers

K-Comm can evaluate the quality and contribution of

the answerers based on their answering history and

community ratings

Social Networks We are more focused on knowledge sharing rather

than personal relationship between users

Page 11: HYP Report

5

Blogs, Forums • We have similar features but they are more

knowledge sharing focused and not limited to

those features only

• Blogs and Forums typically pertain to a certain

area of interest while we are open to various

domains in K-Comm

Other Knowledge Management

Systems

We don’t restrict the knowledge to a specific domain.

Instead, we leverage users’ expertise across different

domains. In our K-Comm, each user is an expert and

has something to share

Page 12: HYP Report

6

Chapter 3 - System Overview

3.1 What is K-Comm We name our system K-Comm which stands for Knowledge Community. As the name

suggests, K-Comm is a knowledge-based social network. It provides most functions of

modern social network while still keeps its focus on knowledge sharing intention. You can

access the system at http://www.k-comm.tk

3.2 Features

3.2.1 Social Network Features

K-Comm has been equipped with most of the common features that a typical social

network site should support. You can write your own blog, join the discussions in the forums,

make friends with other users of the same interest, gather in groups to have a better

collaboration, maintain a good relationship with your friends in the network, and so on.

Altogether, these features help create a collaborative, interactive, and comfortable

environment for all the members to come and participate in the knowledge sharing process.

3.2.2 Knowledge-based Features

K-Comm is not another social network. The social network features in K-Comm only

acts as a fundamental environment to facilitate and motivate the users to exchange their

knowledge with other users in the network. In K-Comm, it is believed that every individual is

an expert and we try to utilise and maximise that potential in order to benefit all the members

of the network.

The utmost purpose that K-Comm aims to achieve is to provide the users with

knowledge-focused activities and features. The users can come to system to:

• Seek for answers to their questions

• Get linked to people who might have the answers to their questions

• Share knowledge with other people

• Collaborate with like-minded people

Overall, K-Comm attempts to become an expert directory constituted from every

individual who is an expert in a particular field.

Page 13: HYP Report

7

3.3 System Components

Figure 1: K-Comm System Components

The dimmed boxes represents components which are either not

implemented by the author or provided by the open source platform

The K-Comm system consists of two main components: the User Profiling package and

the Questions and Answers package. On top of that is the user interface that controls the look

and feel, the layout and the flow of the whole system.

3.3.1 The User Profiling Package

This package is responsible for capturing all the information which is related to the

users of the systems. Upon registration, the users will be asked a few sets of questions in

which they tell the system about their basic information (e.g. name, gender, contact number,

etc.); what are the fields and categories that they are interested in; their background and user

type. The User Profiling package will capture all of this information and make it ready to be

used by other components in the system.

K-Comm

User Profiling

Questions & Answers

Core Library

Q&A Display

Widgets

Rating System

Point System

Skill Level System

Social Networking

User Interface

Page 14: HYP Report

8

3.3.2 The Questions and Answers Package

This package is our central point to manage all the knowledge being shared by the users

of the system. It is responsible for assisting the users in sharing their potential knowledge as

well as looking for the knowledge or information they need in the fastest time. To be precise,

it provides the users with the following functions:

a) Ask and answer questions

The Questions and Answers Package allows users to ask and answer questions. The

questions and answers are classified in predefined categories. The predefined categories are

managed and maintained by the system administrators and by default have covered most of

the common areas of interest that the system users are likely to have. However, the users can

also give suggestions for new categories which have not been included in the system and

those categories will be added after being approved by the system administrators.

Not only the questions are structured into different categories, users can also add tags

into the questions to describe the questions more specifically. The questions can be searched

afterwards by both of their contents and the tags attached.

The system provides support for rich content which consequently means that the users

can post videos or any embedded widget in their questions and answers. (differentiate from

other service). Using this feature, the posters can give a more lively illustration and thus will

help the readers have a better understanding about the questions and answers being posted.

This function is provided by the core library and Q&A display. The core library models

the structure of the questions and answers being stored in the database while the Q&A

display component is responsible for pulling out the information from the database and

displaying it to the front end users.

b) Evaluate questions and answers

In order to encourage members of the society to contribute to the knowledge sharing

process, the system provides its users with the ability to rate the questions and answers. It can

be considered as the incentives for the questioners and answerers. All of the questions and

answers can be rated by other users except for the person who posted those questions and

answers. Users can also leave their comments for both questions and answers as necessary.

Page 15: HYP Report

9

Additionally, the person who asks a question can choose the best answer among the answers

posted.

The rating and comments from the users will help the system evaluate not only the

quality of the questions and answers but also the contributions and the level of knowledge of

other users. It then will be able to analyse and tell:

• What are the hottest questions

• What answers are more likely to have a better value over the others

• Who are more likely to have the expertise and ability to give good answers

In the knowledge sharing and seeking process, not only the quantity of knowledge

stored is important but the quality of the knowledge captured is also very critical. So it is

necessary for the system to be able to evaluate the knowledge being exchanged. In addition,

the system administrators can also get involved in the process by monitoring and filtering the

questions and answers in order to maintain the set of finest and most valuable knowledge.

These tasks are managed and controlled by the three components: the rating system, the point

system and the skill level system. The rating system is in charge of evaluating the questions

and answers. The point system takes care of the contributions of each individual user in the

knowledge sharing process. Finally, the skill level system analyses the quality of questions

and answers by each user and then evaluate the skill levels that they potentially possess.

Altogether, the three components work to ensure a good quality of the knowledge being

exchanged throughout the system.

c) Organise questions and answers

Knowledge exchange is a two way process. It is desirable that people come to use the

system not only to share the knowledge that they possess but also to look for the information

or knowledge that they want to know. In a real life situation, the amount of knowledge being

exchanged is often very large. Therefore, the system is expected to have some kind of

mechanism to help the users organize the set of questions and answers in a neat manner as

well as find the information they need as fast as possible.

In K-Comm, there are many ways for the users to locate the questions or answers they

want.

Page 16: HYP Report

10

The first way is to use the Search box. The users can enter some text into the Search

box as the search criteria and then the system will look for those questions or categories that

match the given search criteria. After that, a list of questions will be displayed in the Search

Results panel together with some brief information about the questions (such as title, category,

date and time, author and number of answers) so that the users can further filter which

question they would like to look into details. The method is illustrated as in the figure below.

Figure 2: Search box

Another way to look for the questions is to look at the Interesting and Latest tab in the

main page (after logging in). When the users register to the system, they will be asked what

the categories that they are interested in are. The system will capture this information and

automatically list all the questions in those categories in the Interesting tab. So when the users

log in to the system, they can have a glance at the questions that are posted in their areas of

interest. In a similar manner, the Latest tab will list all the questions which have been posted

recently. The illustration is as in the figure below

Figure 3: Interesting and Latest tabs

Page 17: HYP Report

11

In addition, they can always click on a tag or a category to go to the list of questions

that have the same tag attached or posted in that specific category.

Besides locating the questions, the users are also provided with a way to manage

different kinds of questions. For example, they can edit their own dashboard to display the

lists of recent questions, the questions that they have asked, the questions asked by their

friends, etc. These are called widgets and they can be customized, added or removed in the

dashboard of individual users.

Figure 4: Widgets

d) Other functionality

In addition to the knowledge-focused functions, the system also comes with all the

fundamental functions of a typical social networking system. For instance, the users also have

a blog; can manage their relationships with other friends in the network. They can also gather

into groups and create discussion forum.

In conclusion, the K-Comm system tries to facilitate the users with a good social

networking environment in order to encourage them to exchange their knowledge with other

users. The system also assists the users in locating the information they want as quickly as

possible and managing the questions in which they are interested in an easy and tidy manner.

3.3.3 The User Interface

The User Interface package controls the consistency of the look and feel of different

components throughout the system. We have made a lot of changes to the interface so that the

Page 18: HYP Report

12

system does not look like the default Elgg site. Moreover, it is important that we want to

confine to the convention of Web 2.0 in order to give the users a good impression and the

incentives to make use of the system. Some of the rules of thumb we try to follow when

designing the user interface are:

• Keep everything simple, intuitive and user friendly

• Achieve the effect “I can find what I want to find”

• Make it easy to use and learn

Page 19: HYP Report

13

Chapter 4 - Implementation In this chapter, we will first describe how we apply the open source framework to

correspond with the features that we want in the system. Then we will look into details the

implementation of each component in K-Comm.

The principle we apply in the implementation might give an impression that it is simple

and straight forward but the complexity lies on the integration part where we need to stick to

the guideline given by the Elgg framework.

4.1 Elgg Framework

4.1.1 What is Elgg

Elgg is a free and open source framework for social networks. It provides the necessary

functionality to allow you to run your own social networking site.

(http://docs.elgg.org/wiki/What_is_Elgg). It is developed in PHP language and can work with

MySQL database server. The version we are using is Elgg 1.1. The latest version now is Elgg

1.5 with a lot of changes in the core engine.

We choose Elgg as our development framework because of the following reasons:

• It is free and open source. It also works with PHP and MySQL which is also

free and open source environment.

• It provides fundamental functionality for a typical social networking site so that

we don’t need to waste time and efforts in building our system from scratch.

• The framework can be extended using customized plug in

We choose PHP as our development environment instead of .NET or JSP not only

because it is free but also because the PHP platform is considered as faster than that of .NET

or JSP. There is also more variety of available frameworks written in PHP for us to choose

from compared to .NET and JSP.

4.1.2 Elgg Engine

In this section, we will discuss about the underlying structure of the Elgg engine. It is

necessary that we understand how the framework works so that we can continue to build our

system features on top of it. Part of the technical points being discussed in this section is

referenced from the documentation on Elgg website (http://docs.elgg.org/wiki/Main_Page).

Page 20: HYP Report

14

However, the online documentation is very general and more often than not, it is not

sufficient for our implementation. Hence, this section also includes findings and conclusions

with which the author has come up during the trial and error and implementation process.

In this discussion of the Elgg engine, we will also mention about the pros and cons that

such structure brings about to our implementation.

We will start by looking at the Elgg Data Model which is illustrated as in the figure

below:

Figure 5: Elgg Data Model

In Elgg, the basic or atomic unit of data is called an entity (or ElggEntity as it is

referred to in the PHP code). So every access to the database should go through this layer of

abstraction rather than directly making SQL queries to the database. It is important to follow

this convention in order to ensure the integrity of the data model. Although Elgg provides us

with a few utility functions to work with the entities, sometimes they are not flexible enough

to suit our needs. For instance, it is not possible to use the utility functions provided by the

Elgg core engine to retrieve a list of entities in a sorted order (based on some criteria). As a

result, we will need to alternatively retrieve the list of entities and do a manual sorting on the

Page 21: HYP Report

15

list. The task will get more complicated and inefficient when the criteria involve several

attributes or aggregate functions. Another way to get around this problem is to add an

overloading utility function to the Elgg core engine to provide the same effect by altering the

SQL query being called. This approach is necessary as far as the efficiency of the operation is

concerned. However, we will have some compatible issues when upgrading the platform to a

newer version. As a result, in our implementation, we only touch the Elgg core engine when

efficiency is important. Otherwise, we use the first approach, that is, to do extra manual work

to achieve the effect.

Every other object in the system inherits the ElggEntity class. Four specialized types of

such classes have already been made to provide extra properties and methods for handling

different types of data easily. They are:

• ElggObject

Objects like blog posts, uploaded files and bookmarks

• ElggUser

Each user in the system

• ElggSite

Each site in a multiple site system within the same Elgg install

• ElggGroup

Multi-user collaborative systems

In our K-Comm system, most of the time we only make use of the ElggObject and

ElggUser and leave the ElggSite and ElggGroup untouched.

Each of the four specialized entities listed above come with their own distinguish

properties, for example ElggObject has a title and description while ElggUser has a username

and password and so on. Nevertheless, besides those properties, they also share common

properties which are inherited from the ElggEntity class:

• Globally Unique ID (GUID)

A unique ID to identify the object throughout the system

• Owner GUID

The ID of the object to which the current object belongs

• Site GUID

The site that the entity object belongs to

Page 22: HYP Report

16

• Access ID

The access permission of the entity object

• Subtype

An additional name to differentiate from other entity objects of the same type

In addition to the built-in properties provided, we can also add more information into

the entity object to describe it further by utilising the metadata and annotation attached to the

ElggEntity.

Both metadata and annotation can be used to extend and customize our entity objects.

However, what is not so clear from the Elgg documentation is the difference between these

two types of additional information and when we prefer using this to the other. Based on our

experience implementing the system, we have come to the following observations:

• The metadata can be used to store simple information such as tags, attribute ids,

etc. Under the hood, metadata is treated as a tag, and therefore it is searchable

and in fact most appropriate for the information that involves search operation.

• The annotation is often used to store more complicated information which adds

to the information provided by the entity. For example, ratings and comments

can be considered as annotation. You will prefer using annotation to metadata

when we want to make some aggregation calculations for the entity objects.

Elgg provides us with adequate functions to do such calculation on annotation.

(See the appendix)

4.1.2 Mapping from Elgg to K-Comm

In this section, we will discuss how we make use of the functions provided by Elgg to

implement the features of our K-Comm system. In other words, we are mapping from Elgg

available features to K-Comm features.

Besides the default social networking features provided by Elgg, we also leverage these

standard features and add more knowledge-focused functions to them. For example, on top of

the “friend” and “friend of” relationship support, we also build a widget called Friends’

Questions to help the users keep an update of their friends’ questions and answers more

easily.

Page 23: HYP Report

17

Elgg allows us to extend the system by creating customised plug-in. We have used this

plug-in support to build a number of components in our system. For example, the Questions

and Answers package is implemented as a plug-in. The user interface also customises the

look and feels of the system through plug-in and hence can be easily changed, enabled or

disabled.

Additionally, we also make a heavy use of the Elgg Data Model to make our K-Comm

system more object oriented as well as more portable and compatible. We use the metadata to

store the tags of the questions and annotations to keep track of users’ contributions and their

knowledge value estimation.

4.2 Core Library Although Elgg has an abstraction layer in its data model to prevent direct access to the

database layer, we still find that it is necessary to have a higher abstraction level so that when

we move the system from the current platform to another platform in the future, we do not

need to make modifications to the business logic. As a result, we introduce a wrapper for the

Elgg entity objects and since Elgg has already followed the object oriented model to some

extent, we also use this approach in our implementation.

All the wrapper class we introduce will extend the ElggEntity base class. Most of the

time they utilise the properties title and description inherited from the ElggEntity class but

they also add on additional information where necessary.

Figure 6: Wrapper Class Equation

ElggEntity

Additional information and utility functions

Relationship between objects

Wrapper Class

Page 24: HYP Report

18

4.2.1 Question Class

The Question class represents a question in the system. It utilises the standard

properties title and description of the ElggEntity object to store the title and the content of the

question. In addition, it also stores a list of tags that the users attach to the question in an

array and then put it in the metadata together with the entity. In a similar manner, the

category id and the count of page view information is also stored using the metadata.

The relationship between the Question class and the Category class is many to one.

Each question can belong to only one category (while one category can content many

questions). The Question class keeps a reference to the Category class by category id. So

given a Question entity object, we always know immediately which category it belongs to.

On the other hand, the relationship between the Question class and the Answer class is

one to many. Each question can have many answers. However one answer can only belong to

one question. We do not maintain a reference pointing from the Question class to the Answer

class. However, we have defined utility functions to retrieve the list of all answers that belong

to a particular question.

In addition to the metadata, each question is also attached with a Score object when it is

created. This is to recognise the contribution of a person when he or she asks a question by

rewarding them with some activity contribution points.

Finally, we use the widget model of Elgg to provide a handy tool for the users to

manage and organise their knowledge in the sharing process.

4.2.2 Category Class

The relationship between the Category class and the Question class has been described

in the section above. The similar relationship applies to the Answer class, too. Since the

Category class does not maintain a reference to Question and Answer class, we also define

utility functions to retrieve the list of all the answers or questions in a particular category.

In K-Comm, our category supports multi-level categories. That means we can have

nested categories ranging from general to specific. An example of the hierarchy can be found

below:

Page 25: HYP Report

19

Figure 7: Multi-level Hierarchy

To achieve this multi-level category support, we keep a parent id which is a reference

pointing from the current Category entity object to its parent category. The top level category

entities will have a parent id of -1. We can also retrieve a list of children category from the

current category by retrieving all the category entities that have the parent id equals to the id

of the current category.

4.2.3 Answer Class

The implementation of the Answer class is very similar to the Question class described

above.

Computers & IT

Computer Engineering

Computer Security

Database

Relational Database

MySQL

MS SQL

Oracle

DB2

Object Database

Flat Database

Programming

Java

C#

.NET

Travel

Asia

South East Asia

Singapore

Vietnam

...

East Asia

Japan

Korea

Europe

America

Australia

Africa

Page 26: HYP Report

20

4.2.4 Integration

After we have our wrapper class for all the entity objects that we want, we will need to

integrate it into the Elgg framework.

(Figure: how to inject)

First of all, we need to register the sub type (user defined type) of our classes to the

system when the Questions and Answers plug-in are loaded. This is to tell the system that we

have defined a new type of entity object and let the system know the location in which it can

find the definition of our classes. This registration is important because if we do not follow

this guideline, then whenever we try to retrieve an entity, say a question or answer, Elgg will

return an instance of the Elgg object instead of the wrapper class that we have defined. If that

happens, we will encounter problems which relate to the relationship between the classes. For

example, we will not be able to get the answer that belongs to a particular question.

After that, we need to register all the actions that relate to the sub types we have created.

Examples of the actions are creating a new question, deleting a question, editing a question,

etc.

Finally, we need to add the list of categories to the menu so that the users can easily

navigate through.

4.3 Widgets Widgets are an integral part of the user experience with Elgg. Using Elgg's powerful

widget API, it is possible to provide access to both internal and external content, through

widgets, on a user’s dashboard or profile. Widgets can be available for both the profile and

dashboard, or they can be exclusive to either or. (http://docs.elgg.org/wiki/Plugins/Widgets)

Following are some of the widgets provided in K-Comm

• Recent Questions

• My Questions

• Friends’ Questions

• Related Questions

Page 27: HYP Report

21

For each of the widget, we need to create a view and an edit page. The view page is

responsible for pulling out the information from the database and displaying it to the users

while the edit page is used to modify some settings for the widget.

4.4 User Interface The user interface of an Elgg system can be customized using theme. A theme is built

as a plug-in so that it can be easily distributed, customized, enabled or disabled.

We make use of the jQuery JavaScript Framework to achieve cool effects for our

system. For example, a tool tip will appear when you move your mouse over certain items

and it will display the description of that item. Another example is the modal dialog which

appears and allows you to enter your credentials and then let you log in to the system.

The User Interface package must override the standard header of Elgg in order to inject

additional JavaScript such as jQuery. This sounds like a simple way to do things but in fact, it

is unsafe because when you upgrade to a newer version of Elgg, the default header might

change and you will need to manually update it in your customised header. Currently there is

no work-around for this because this is the desired way of how Elgg framework works.

The package also provides two layouts for other components of the system to use. One

layout is used when the users have not logged in to the system and the other is used when the

users have logged in. We also modularised the package in order to make it easy to change the

layout, the CSS style sheet and JavaScript in the future when necessary.

4.5 Skill Level System Imagine that you are a user coming to the K-Comm system to look for some

information that you want, for example you want to find out some good car brand to buy.

After searching the system, you believe that nobody has asked some similar questions. So

you start to post your own question in the Home Asset category. One day later you come

back to the system to check for answers to your question and find that there are a lot of

people throwing the answers to your question. You are happy about it but very soon later, you

start to feel confused because you don’t know whose advice you should take since you are

new in this category and know very little about cars.

As a result, we would like to come up with an approach to assist the users in this

situation. In other words, we want to establish a mechanism to analyse and estimate the level

Page 28: HYP Report

22

of potential knowledge that each user probably possesses. After that, we will try to help other

users of the system to identify the people with a high potential of possessing a good level of

knowledge in some particular categories.

We will implement this mechanism in our Skill Level System. The idea is to monitor

the activities that a user takes part in when they are using the system. Based on the result of

activities, we can have estimation about how good they are at some specific categories. A

person can be good at these categories while not so good at the others. So we need to capture

this information at the category level.

For example, if a person has raised a lot of good questions in the Car category (we

consider the questions to be good based on the evaluation of other users through their rating).

He or she also has given a lot of answers which are rated as good by other users. Some of his

or her answers are even selected as the best answer by some questioner. Accordingly, we

have some good reasons to tell that this person might have a very good knowledge about cars.

If our analysis for the activities that John and Mary have participated in is as in the

chart above, we might want to come to the estimation that John is likely better than Mary in

the area of computers while Mary knows better about cars than John does.

0

5

10

15

20

25

John

Best Answers

Answer Count

Question Count

Answer Rating

Question Rating

0

5

10

15

20

25

Mary

Best Answers

Answer Count

Question Count

Answer Rating

Question Rating

Page 29: HYP Report

23

After we capture the skill level for John and Mary, we also need to make that

information available for other users. So we show the skill level of John and Mary in the

questions and answers that they have posted. As a result, when a user sees answers posted by

John in the Computer category, they will know that these answers are probably more accurate

and trustable (since John has a good expertise in this area). Similarly, in the Car category,

Mary’s answers are more likely to have a higher weight.

4.5.1 Requirements

Now the problem that we need to solve is to construct a function 𝑓𝑓 from the Cartesian

product of the sets of Category and User to the set of real number from 0 to 10:

𝑓𝑓:𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶 × 𝑈𝑈𝑈𝑈𝐶𝐶𝐶𝐶 ↦ [0. .10]

𝑓𝑓(𝑐𝑐𝐶𝐶𝐶𝐶𝑐𝑐𝑐𝑐,𝑢𝑢𝑈𝑈𝐶𝐶𝐶𝐶𝑐𝑐𝑐𝑐) = 𝑆𝑆𝑆𝑆𝑐𝑐𝑆𝑆𝑆𝑆 𝑆𝑆𝐶𝐶𝑙𝑙𝐶𝐶𝑆𝑆 𝐶𝐶𝑓𝑓 𝐶𝐶ℎ𝐶𝐶 𝑢𝑢𝑈𝑈𝐶𝐶𝐶𝐶 𝑐𝑐𝑖𝑖 𝐶𝐶ℎ𝐶𝐶 𝑐𝑐𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶

In addition, the function 𝑓𝑓 needs to be in terms of:

• The rating of questions and answers from the user in the particular category

• The total number of questions and answers from the user in the particular

category

• The number of answers from the user in the particular category which have been

selected as the best answer

While constructing the function 𝑓𝑓 and the Skill Level System, besides accuracy, we

also need to take into account the following practical requirements:

0 1 2 3 4 5 6 7 8 9

Mary

John

Skill Level for John and Mary

Car

Computer

Travel

Page 30: HYP Report

24

• If a person has some knowledge in a particular category, he or she should be

considered to have some knowledge in the parent category, too. For example, in

a user’s perspective, if I know about Java, it also means that I know about

Programming too.

• If a person has not logged in to the system for some time, when he logs in the

next time, his skill level should remain the same and not decline.

4.5.2 Unsuccessful Attempts

At first, we decided that initially, every user has a starting skill level for a particular

category. After that, whenever they take part in an activity (ask a question, answer a question,

answers selected as the best answer), then we will calculate a new skill level and that new

value will account for certain amount of the overall skill level that they have pertained so far.

The formula that we came up with is as follows:

𝐼𝐼𝑖𝑖𝑐𝑐𝐶𝐶𝑐𝑐𝐶𝐶𝑆𝑆 𝑂𝑂𝑆𝑆𝑐𝑐 𝑃𝑃𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶 = 3

𝑁𝑁𝐶𝐶𝑁𝑁 𝑃𝑃𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶 = 0.6 × 𝑂𝑂𝑆𝑆𝑐𝑐 𝑃𝑃𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶 + 0.4 × 𝑁𝑁𝐶𝐶𝑁𝑁 𝐸𝐸𝑈𝑈𝐶𝐶𝑐𝑐𝐸𝐸𝐶𝐶𝐶𝐶𝐶𝐶𝑐𝑐 𝑃𝑃𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶

𝑁𝑁𝐶𝐶𝑁𝑁 𝐸𝐸𝑈𝑈𝐶𝐶𝑐𝑐𝐸𝐸𝐶𝐶𝐶𝐶𝐶𝐶𝑐𝑐 𝑃𝑃𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶

= 0.1 × 𝑄𝑄𝑢𝑢𝐶𝐶𝑈𝑈𝐶𝐶𝑐𝑐𝐶𝐶𝑖𝑖 𝐶𝐶𝐶𝐶𝑢𝑢𝑖𝑖𝐶𝐶 + 0.1 × 𝐴𝐴𝑖𝑖𝑈𝑈𝑁𝑁𝐶𝐶𝐶𝐶 𝐶𝐶𝐶𝐶𝑢𝑢𝑖𝑖𝐶𝐶 + 0.2

× 𝐴𝐴𝑙𝑙𝐶𝐶 𝑄𝑄𝑢𝑢𝐶𝐶𝑈𝑈𝐶𝐶𝑐𝑐𝐶𝐶𝑖𝑖 𝑅𝑅𝐶𝐶𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶 + 0.3 × 𝐴𝐴𝑙𝑙𝐶𝐶 𝐴𝐴𝑖𝑖𝑈𝑈𝑁𝑁𝐶𝐶𝐶𝐶 𝑅𝑅𝐶𝐶𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶 + 0.3

× 𝐵𝐵𝐶𝐶𝑈𝑈𝐶𝐶 𝐴𝐴𝑖𝑖𝑈𝑈𝑁𝑁𝐶𝐶𝐶𝐶 𝐶𝐶𝐶𝐶𝑢𝑢𝑖𝑖𝐶𝐶

The good thing about this attempt is that by putting some weight to the Old Point and

New Estimated Point, we prevent the final skill level from increasing unboundedly.

However, this approach is not acceptable because it introduces a problem in which the skill

level of a user will remain unchanged or even decrease no matter how hard he or she try to

participate in the activities. This is because after some time, the current value of skill level is

too high compared to the maximum point that people can earn by participating in an activity.

You can argue that we can adjust the weight of the New Estimated Point. However, if you

give too much weight for the New Estimated Point, then it becomes very easy to improve

someone’s skill level. The consequence is everyone will eventually get roughly the same skill

level and the system will be unable to distinguish between good and not so good knowledge

sharer.

Page 31: HYP Report

25

We then modify the solution. Instead of keeping an old value for the skill level, we

leave it increasing. That is:

𝑆𝑆𝑆𝑆𝑐𝑐𝑆𝑆𝑆𝑆 𝐿𝐿𝐶𝐶𝑙𝑙𝐶𝐶𝑆𝑆 𝑃𝑃𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶

= 0.1 × 𝑄𝑄𝑢𝑢𝐶𝐶𝑈𝑈𝐶𝐶𝑐𝑐𝐶𝐶𝑖𝑖 𝐶𝐶𝐶𝐶𝑢𝑢𝑖𝑖𝐶𝐶 + 0.1 × 𝐴𝐴𝑖𝑖𝑈𝑈𝑁𝑁𝐶𝐶𝐶𝐶 𝐶𝐶𝐶𝐶𝑢𝑢𝑖𝑖𝐶𝐶 + 0.2

× 𝐴𝐴𝑙𝑙𝐶𝐶 𝑄𝑄𝑢𝑢𝐶𝐶𝑈𝑈𝐶𝐶𝑐𝑐𝐶𝐶𝑖𝑖 𝑅𝑅𝐶𝐶𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶 + 0.3 × 𝐴𝐴𝑙𝑙𝐶𝐶 𝐴𝐴𝑖𝑖𝑈𝑈𝑁𝑁𝐶𝐶𝐶𝐶 𝑅𝑅𝐶𝐶𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶 + 0.3

× 𝐵𝐵𝐶𝐶𝑈𝑈𝐶𝐶 𝐴𝐴𝑖𝑖𝑈𝑈𝑁𝑁𝐶𝐶𝐶𝐶 𝐶𝐶𝐶𝐶𝑢𝑢𝑖𝑖𝐶𝐶

However, to keep it unbounded, we normalise it by compared it to the maximum skill

level that has been achieved in the system. The skill level now give you an idea about how

good you are compared to others in the system instead of indicating an absolute value about

your knowledge expertise.

Nevertheless, this approach is not applicable in practice, either. The problem is if the

user does not log in to the system for some time while the rest users continue to participate in

the system regularly, that user’s skill level will be outdated compared to others. This does not

make sense because your knowledge can not decrease just because of your inactivity. The

level of activity of a user has already been captured by the Point System. The Skill Level

System should only focus on the quality of the knowledge being shared by a user in a

particular category.

4.5.3 Our Approach

After the failure of previous attempts, we came up with a new working approach. We

try to analyse the skill level of the user only after his work (asking or answering) has been

evaluated by other users. So the user’s skill level will not drop over time but it will only drop

if other users rate his questions or answers as bad.

The calculation of the skill level is as follows. If a user has asked questions in a

particular category but none of his questions have been rated, then he will get 0.5 for the

question part. Otherwise, the average of the rating of his questions will be used for his

question part. Similarly, if he has posted answers in the category but none of his answers

have been rated, then he will get 0.5 for the answer part. Otherwise, he will get the average of

the rating of his answers. Finally, the question part will account for 40% and the answer part

will account for 60% of the Q&A points. The reason for the ratio 4 : 6 is that when a person

is able to answer some questions in a category, it is more likely that he knows about the

category well than in the case he is asking a question in that category. In addition, we also

Page 32: HYP Report

26

take into account (with a light weight) the number of questions and answers that the user has

posted and the number of answers which have been selected as the best answers. The full

calculation formula is shown below:

𝑆𝑆𝑆𝑆𝑐𝑐𝑆𝑆𝑆𝑆 𝐿𝐿𝐶𝐶𝑙𝑙𝐶𝐶𝑆𝑆 = 0.1 ×𝑄𝑄𝑢𝑢𝐶𝐶𝑈𝑈𝐶𝐶𝑐𝑐𝐶𝐶𝑖𝑖 & 𝐴𝐴𝑖𝑖𝑈𝑈𝑁𝑁𝐶𝐶𝐶𝐶 𝑐𝑐𝐶𝐶𝑢𝑢𝑖𝑖𝐶𝐶

2+ 0.2 × 𝐵𝐵𝐶𝐶𝑈𝑈𝐶𝐶 𝐴𝐴𝑖𝑖𝑈𝑈𝑁𝑁𝐶𝐶𝐶𝐶𝑈𝑈 + 0.7 × 𝑄𝑄𝐴𝐴𝑃𝑃𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶𝑈𝑈

𝑄𝑄𝐴𝐴𝑃𝑃𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶𝑈𝑈 = 0.4 × 𝑄𝑄𝑢𝑢𝐶𝐶𝑈𝑈𝐶𝐶𝑐𝑐𝐶𝐶𝑖𝑖 𝑃𝑃𝐶𝐶𝐶𝐶𝐶𝐶 + 0.6 × 𝐴𝐴𝑖𝑖𝑈𝑈𝑁𝑁𝐶𝐶𝐶𝐶 𝑃𝑃𝐶𝐶𝐶𝐶𝐶𝐶

𝑄𝑄𝑢𝑢𝐶𝐶𝑈𝑈𝐶𝐶𝑐𝑐𝐶𝐶𝑖𝑖 𝑃𝑃𝐶𝐶𝐶𝐶𝐶𝐶 = � 0.5 𝑐𝑐𝑓𝑓 𝑖𝑖𝐶𝐶 𝑞𝑞𝑢𝑢𝐶𝐶𝑈𝑈𝐶𝐶𝑐𝑐𝐶𝐶𝑖𝑖𝑈𝑈 𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝑐𝑐𝐴𝐴𝑙𝑙𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶 𝐶𝐶𝑓𝑓 𝐶𝐶𝐶𝐶𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶𝑈𝑈, 𝐶𝐶𝐶𝐶ℎ𝐶𝐶𝐶𝐶𝑁𝑁𝑐𝑐𝑈𝑈𝐶𝐶

𝐴𝐴𝑖𝑖𝑈𝑈𝑁𝑁𝐶𝐶𝐶𝐶 𝑃𝑃𝐶𝐶𝐶𝐶𝐶𝐶 = � 0.5 𝑐𝑐𝑓𝑓 𝑖𝑖𝐶𝐶 𝐶𝐶𝑖𝑖𝑈𝑈𝑁𝑁𝐶𝐶𝐶𝐶𝑈𝑈 𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝑐𝑐𝐴𝐴𝑙𝑙𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶 𝐶𝐶𝑓𝑓 𝐶𝐶𝐶𝐶𝐶𝐶𝑐𝑐𝑖𝑖𝐶𝐶𝑈𝑈, 𝐶𝐶𝐶𝐶ℎ𝐶𝐶𝐶𝐶𝑁𝑁𝑐𝑐𝑈𝑈𝐶𝐶

If the category has sub categories, then the skill level will be the balance of the category

itself and its children:

𝐹𝐹𝑐𝑐𝑖𝑖𝐶𝐶𝑆𝑆 𝑆𝑆𝑆𝑆𝑐𝑐𝑆𝑆𝑆𝑆 𝐿𝐿𝐶𝐶𝑙𝑙𝐶𝐶𝑆𝑆 (𝐶𝐶) = 0.7 × 𝑆𝑆𝑆𝑆𝑐𝑐𝑆𝑆𝑆𝑆𝐿𝐿𝐶𝐶𝑙𝑙𝐶𝐶𝑆𝑆(𝐶𝐶) + 0.3 × 𝐴𝐴𝑙𝑙𝐶𝐶(𝐶𝐶.𝐶𝐶ℎ𝑐𝑐𝑆𝑆𝑐𝑐𝐶𝐶𝐶𝐶𝑖𝑖)

In order to avoid calculation overhead, we will not carry out the calculation every time

we want to display the skill level value. Instead, we will store the final value and display it

when necessary. We only make an update of the constituent components of the function

(question and answer count, average rating, number of best answers) and calculate again

when the user participates in a new activity.

Page 33: HYP Report

27

Chapter 5 - Conclusion

5.1 Summary In this project, we have specified and formalised the specifications that the Knowledge

Community system should have. We then studied the existing similar systems that are

available and the interesting features that we might want to include in K-Comm. We also

designed the basic structure for our system and identify the fundamental constituent

components. After that, we analysed the open source Elgg framework and found out how to

make use of it to implement our system. Finally, we started to build the essential components

of K-Comm.

5.2 Difficulties and Limitations Although the components of the system that we have implemented are those essential

and fundamental components and there is still room for improvement, we at least have

formed a concrete shape of the system which we want to build. We also constructed the basic

foundation for the system which then can be easily extended and customised on top of it.

From now on, other people can continue the work based on what we have so far.

The nature of this project is more on implementation. In fact, the difficulties are on the

implementation part. Although Elgg framework is available and ready for use, integration

work is not easy to be done because they are lack of an adequate documentation.

Understanding how the framework works is not trivial and looking for the current methods to

call is sometimes difficult without the help of documentation. On top of that, although PHP is

a fast environment, it is not a very friendly environment for development. In particular, we

find it very hard to do debugging in PHP environment, especially with a big system like K-

Comm. More often than not, it takes a couple of hours to discover a small mistake.

Putting this together with the time constraints, the result of the project is limited to

building the basic platform for the K-Comm system. This open opportunity for more research

and implementation work to be done in the future.

5.3 Recommendations for Further Work In the future, we can do research on how to analyse the questions and answers being

posted by using natural language processing techniques. This will help in automatic analysing

Page 34: HYP Report

28

and understanding the knowledge being shared in the system. We can also study the

relationship between the tags attached to different questions. Furthermore, we can come up

with different ways to represent and organise the questions and answers.

Page 35: HYP Report

29

References Agarwal, N.K. and Poo, D.C.C. (2006). Capturing tacit knowledge across different domains:

Knowledge Community (K-Comm).

Bonnie Montano (2004). Innovations of knowledge management. IRM Press (March 22,

2005).

http://www.techcrunch.com/wp-content/wlsn_comparison_chart.html

http://www.sim.edu.sg/mbs/pub/mag/mbs_pub_mag_list.cfm?ID=1877&mnuid=92

http://www.aijc.com.ph/KM_site/docs/Annex%203.pdf

http://www.aijc.com.ph/KM_site/docs/Annex%203.pdf

http://www.150jahre.ethz.ch/program/ethvisionen/tag_der_universitaeten/programm/kleiber.p

df

http://net.educause.edu/ir/library/pdf/erm0350.pdf

http://www.tfhrc.gov/pubrds/novdec99/km.htm

http://www.gurteen.com/gurteen/gurteen.nsf/id/ksculture

http://lnweb90.worldbank.org/oed/oeddoclib.nsf/DocUNIDViewForJavaSearch/D9E389E741

4BE9DE85256DC600572CA0/$file/knowledge_eval_literature_review.pdf

Page 36: HYP Report

30

Appendix

Functions provided for metadata

Source: http://docs.elgg.org/wiki/Engine/DataModel/Metadata

function create_metadata(

$entity_guid, // The GUID of the parent entity

$name, // The name of the metadata (eg 'tags')

$value, // The metadata value

$value_type, // Currently either 'string' or 'int'

$owner_guid, // The owner of the metadata

$access_id = 0, // The access restriction

$allow_multiple = false // Do we have more than one value?

)

function get_metadata_byname (

$entity_guid,

$meta_name )

function get_metadata_for_entity (

$entity_guid

)

Functions provided for annotations

Source: http://docs.elgg.org/wiki/Engine/DataModel/Annotations

function annotate(

$name, // The name of the annotation type (eg 'comment')

$value, // The value of the annotation

$access_id = 0, // The access level of the annotation

$owner_id = 0, // The annotation owner, defaults to current user

Page 37: HYP Report

31

$vartype = "" // 'string' or 'integer'

)

$annotations = $entity->getAnnotations(

$name, // The type of annotation

$limit, // The number to return

$offset, // Any indexing offset

$order, // 'asc' or 'desc' (default 'asc')

);

function elgg_view_comments(ElggEntity $entity)