|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectiitb.con.net.ConceptNet
iitb.con.net.FileConceptNet
public class FileConceptNet
FileConceptNet extends and provides the implementation for the ConceptNet class.
It 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.
Type,
Instance,
Entity,
Relation| Field Summary | |
|---|---|
static java.lang.String |
BAK
|
| Constructor Summary | |
|---|---|
FileConceptNet(java.lang.String name,
java.lang.String mode)
Initializes the Concept-Net. |
|
| Method Summary | ||
|---|---|---|
int |
add(Instance instance)
Adds the instance to the concept-net. The instance can be EntityInstance or RelationInstance |
|
void |
addInstance(InstanceMetaItem item)
|
|
int |
addInstance(Instance instance,
short clusterId)
|
|
boolean |
close()
Closes the concept-net. |
|
Result |
commit()
Commits the changes to the concept-net. |
|
|
createIndex(java.lang.String typeName,
java.lang.String attributeName,
K dataType)
Creates Index of the specified type's attribute. |
|
Result |
dropIndex(Type type,
java.lang.String attributeName)
Drops the index for the specified type attribute. |
|
Type |
getType(java.lang.String name)
Returns the Type of specified name. |
|
boolean |
hasType(java.lang.String name)
Returns true if type exists in the concept-net |
|
Result |
induct(Type type)
Inducts Type into the concept-net |
|
Query |
query()
Returns the Query object. |
|
void |
reInitializeNetFiles(java.lang.String backupName)
Reinitializes the instances related files for clustering, defragementation purposes. |
|
Result |
remove(Instance instance)
Removes the instance from the concept-net. |
|
Result |
remove(int instanceId)
Removes the existing Instance from
the concept-nets. |
|
void |
showStaistics()
Display the statistical information about the concept-net. |
|
Result |
update(Instance instance)
Updates the instance in the concept-net. |
|
| Methods inherited from class iitb.con.net.ConceptNet |
|---|
getConceptNetDir, getConceptNetName |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String BAK
| Constructor Detail |
|---|
public FileConceptNet(java.lang.String name,
java.lang.String mode)
throws java.io.FileNotFoundException,
java.io.IOException
The Type Table and Instance Table are loaded into the memory and other necessary files are opened in the specified mode.
name - concept-net namemode - opening mode; can read (r) or read-write (rw)
java.io.FileNotFoundException - if concept-net does not exists then throws exception
java.io.IOException - if any file operations fail| Method Detail |
|---|
public int add(Instance instance)
add in class ConceptNetinstance - Instance
public void addInstance(InstanceMetaItem item)
public int addInstance(Instance instance,
short clusterId)
public boolean close()
close in class ConceptNetpublic Result commit()
The operations like induct, add, update, remove, etc., does not affect the concept-net unless it is committed.
commit in class ConceptNetResult
public <K extends java.lang.Comparable<K>> Result createIndex(java.lang.String typeName,
java.lang.String attributeName,
K dataType)
createIndex in class ConceptNetK - data type objecttypeName - type nameattributeName - attribute namedataType - data type
Result
public Result dropIndex(Type type,
java.lang.String attributeName)
dropIndex in class ConceptNettype - Type objectattributeName - attribute name
Resultpublic Type getType(java.lang.String name)
getType in class ConceptNetname - type name
Typepublic boolean hasType(java.lang.String name)
hasType in class ConceptNetname - type name
public Result induct(Type type)
induct in class ConceptNettype - Type
Typepublic Query query()
query in class ConceptNetQuerypublic void reInitializeNetFiles(java.lang.String backupName)
backupName - name of the backuppublic Result remove(Instance instance)
remove in class ConceptNetinstance - Instance
Resultpublic Result remove(int instanceId)
Instance from
the concept-nets.
remove in class ConceptNetinstanceId - instance's id
Resultpublic void showStaistics()
showStaistics in class ConceptNetpublic Result update(Instance instance)
update in class ConceptNetinstance - Instance
Result
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||