Monday, October 26, 2009

Representing Frequency

While reading about Tree of Porphyry (proposed by Ramon Lull in 1272) I learnt about the 10 questions that can be asked to any entities. But one thing that was missed out of this list is representing frequency. Suppose some process A takes place every 2 days. So we need to find a mechanism to represent the repetition and the frequency at which this occurs. Ramon Lull describes When as the question that can represent the date and time related attribute of the object.

What I propose is extending the 10 questions as listed in Tree of Porphyry and adding another question to the list How Often. The purpose of how often is to represent the frequency of a repetitive attribute of the object. It will have few sub attributes like a Value (How Much) and the Unit (What Kind). Together these will describe the nature of the repetition.

Until Next Time...!!!

Wednesday, October 21, 2009

Finding the Right Data Structure for Knowledge Representation

The most commonly used data structure today is the Row-based data structure where in one row represents details about an instance of an entity type. But in real-world the representation of an entity is not a flat structured. An object's representation contains several sub-attributes that those sub-attributes may have their own sub-attributes that make up the entire object (its attributes). But if we go by the row-based representation of the object we cannot represent the sub-attribute and their relation with the main object.

Consider an example where a Person has FirstName, Surname, Home Address (Street, Suburb, State, Post Code) and Work Address (Company Name, Street, Suburb, State, Post Code). If we use a row-based representation here then we find that our records look like this :

FirstName, Surname, HomeStreet, HomeState, HomePostCode, CompanyName, WorkStreet, WorkSuburb, WorkState, WorkPostCode.

The limitations here is unless we uniquely name the Street, PostCode, State attributes for both Home and Work Address we will not be able to distinguish their real meaning. On the other hand consider a Structure like this:
  - Name
    - First Name
    - SurName
  - Home Address
    - Street
    - Suburb
    - PostCode
    - State
  - Work Address
    - Street
    - Suburb
    - State
    - Post Code

By looking at this structure we can easily tell that the home Address is made up of 4 attributes and Work address is made up of 5 sub-attributes. These in-turn can have their sub attributes as well that will define them in more detail.

It is evident that the hierarchical data structure provides more flexibility and room to grow than the flat row-based structure for representing a real-world object.

Until Next Time...!!!