|
|||||||||
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 failMethod Detail |
---|
public int add(Instance instance)
add
in class ConceptNet
instance
- Instance
public void addInstance(InstanceMetaItem item)
public int addInstance(Instance instance, short clusterId)
public boolean close()
close
in class ConceptNet
public Result commit()
The operations like induct, add, update, remove, etc., does not affect the concept-net unless it is committed.
commit
in class ConceptNet
Result
public <K extends java.lang.Comparable<K>> Result createIndex(java.lang.String typeName, java.lang.String attributeName, K dataType)
createIndex
in class ConceptNet
K
- data type objecttypeName
- type nameattributeName
- attribute namedataType
- data type
Result
public Result dropIndex(Type type, java.lang.String attributeName)
dropIndex
in class ConceptNet
type
- Type objectattributeName
- attribute name
Result
public Type getType(java.lang.String name)
getType
in class ConceptNet
name
- type name
Type
public boolean hasType(java.lang.String name)
hasType
in class ConceptNet
name
- type name
public Result induct(Type type)
induct
in class ConceptNet
type
- Type
Type
public Query query()
query
in class ConceptNet
Query
public void reInitializeNetFiles(java.lang.String backupName)
backupName
- name of the backuppublic Result remove(Instance instance)
remove
in class ConceptNet
instance
- Instance
Result
public Result remove(int instanceId)
Instance
from
the concept-nets.
remove
in class ConceptNet
instanceId
- instance's id
Result
public void showStaistics()
showStaistics
in class ConceptNet
public Result update(Instance instance)
update
in class ConceptNet
instance
- Instance
Result
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |