iitb.con.net
Class ConceptNet

java.lang.Object
  extended by iitb.con.net.ConceptNet
Direct Known Subclasses:
FileConceptNet

public abstract class ConceptNet
extends java.lang.Object

ConceptNet abstracts and manages the Type and Instance in the concept-nets.
It provides methods to add, update, and remove the types and instances in the concept-nets.
It also provides a high level retrieval support through Query object.

See Also:
Type, Instance, Entity, Relation

Constructor Summary
ConceptNet()
           
 
Method Summary
abstract  int add(Instance instance)
          Adds the Instance to the concept-nets.
abstract  boolean close()
          Closes the concept-net.
abstract  Result commit()
          Commits the changes to the concept-net.
abstract
<K extends java.lang.Comparable<K>>
Result
createIndex(java.lang.String typeName, java.lang.String attributeName, K dataType)
          Creates the index for the specified type attribute.
abstract  Result dropIndex(Type type, java.lang.String attributeName)
          Drops the index for the specified type attribute.
static java.lang.String getConceptNetDir()
          Returns the concept-net directory
static java.lang.String getConceptNetName()
          Returns the concept-net name along with path
abstract  Type getType(java.lang.String name)
          Returns the existing Type from the concept-nets.
Returns NULL, if Type does not exists.
abstract  boolean hasType(java.lang.String name)
          Returns true if the type with the same name exists in the concept-net
abstract  Result induct(Type type)
          Inducts the Type to the concept-nets.
abstract  Query query()
          Returns the Query object.
abstract  Result remove(Instance instance)
          Removes the existing Instance from the concept-nets.
abstract  Result remove(int instanceId)
          Removes the existing Instance from the concept-nets.
abstract  void showStaistics()
          Display the statistical information about the concept-net.
abstract  Result update(Instance instance)
          Updates the Instance to the concept-nets.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConceptNet

public ConceptNet()
Method Detail

add

public abstract int add(Instance instance)
Adds the Instance to the concept-nets.

Parameters:
instance - Instance item.
Returns:
instance id

close

public abstract boolean close()
Closes the concept-net.

Returns:
true on success

commit

public abstract Result commit()
Commits the changes to the concept-net.

The operations like induct, add, update, remove, etc., does not affect the concept-net unless it is committed.

Returns:
Result

createIndex

public abstract <K extends java.lang.Comparable<K>> Result createIndex(java.lang.String typeName,
                                                                       java.lang.String attributeName,
                                                                       K dataType)
Creates the index for the specified type attribute.

Type Parameters:
K - data type object
Parameters:
typeName - type name
attributeName - attribute name
dataType - data type
Returns:
Result

dropIndex

public abstract Result dropIndex(Type type,
                                 java.lang.String attributeName)
Drops the index for the specified type attribute.

Parameters:
type - Type object
attributeName - attribute name
Returns:
Result

getConceptNetDir

public static java.lang.String getConceptNetDir()
Returns the concept-net directory

Returns:
concept-net directory as string

getConceptNetName

public static java.lang.String getConceptNetName()
Returns the concept-net name along with path

Returns:
concept-net name

getType

public abstract Type getType(java.lang.String name)
Returns the existing Type from the concept-nets.
Returns NULL, if Type does not exists.

Parameters:
name - type name
Returns:
Type

hasType

public abstract boolean hasType(java.lang.String name)
Returns true if the type with the same name exists in the concept-net

Parameters:
name - type name
Returns:
boolean - true if type exists

induct

public abstract Result induct(Type type)
Inducts the Type to the concept-nets.

Parameters:
type - Type item.
Returns:
Result

query

public abstract Query query()
Returns the Query object. User can query the concept-net using the methods of the Query object.

Returns:
Query

remove

public abstract Result remove(Instance instance)
Removes the existing Instance from the concept-nets.

Parameters:
instance - Instance
Returns:
Result

remove

public abstract Result remove(int instanceId)
Removes the existing Instance from the concept-nets.

Parameters:
instanceId - instance's id
Returns:
Result

showStaistics

public abstract void showStaistics()
Display the statistical information about the concept-net.


update

public abstract Result update(Instance instance)
Updates the Instance to the concept-nets. Returns status as false if Instance does not exists.

Parameters:
instance - Instance item.
Returns:
Result