|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectiitb.con.query.ItemQuery
public class ItemQuery
| Constructor Summary | |
|---|---|
ItemQuery(java.lang.String cnetDirName,
ItemTable<java.lang.String,java.lang.Short,Type> typeTable,
ItemTable<java.lang.Short,java.lang.Integer,InstanceMetaItem> instanceTable,
RelationTable relationTable)
Constructs the ItemQuery object and initializes with meta-information of concept-net |
|
| Method Summary | ||
|---|---|---|
void |
close()
Closes the files that associated with the query object |
|
java.util.List<java.lang.Integer> |
getAllEntityInstanceIds()
Returns all the Entity Instances Id |
|
java.util.List<EntityInstance> |
getAllEntityInstances()
Returns all the EntitiyInstances in the concept-net |
|
java.util.List<java.lang.Short> |
getAllEntityTypeIds()
Returns all entity type ids |
|
java.util.List<java.lang.Integer> |
getAllInstanceIds()
Returns all the Entity and Relation Instances Id |
|
java.util.List<java.lang.Integer> |
getAllRelationInstanceIds()
Returns all the Relation Instances Id |
|
java.util.List<RelationInstance> |
getAllRelationInstances()
Returns all the RelationInstances in the concept-net |
|
java.util.List<java.lang.Short> |
getAllRelationTypeIds()
Returns all relation type ids |
|
java.util.List<java.lang.Short> |
getAllTypeIds()
Returns all type ids |
|
java.util.List<EntityInstance> |
getEntityInstances(java.lang.Short typeId)
Returns all the entity instances of specified Type |
|
java.util.List<EntityInstance> |
getEntityInstances(java.lang.String typeName)
Returns all the entity instances of specified Type |
|
Instance |
getInstance(int instanceId)
Returns the instance for the specified instance id |
|
java.util.List<java.lang.Integer> |
getInstanceIds(short typeId)
Returns the instance ids for the specified Type id |
|
java.util.List<java.lang.Integer> |
getInstanceIds(java.lang.String typeName)
Returns the instance ids for the specified Type name |
|
|
getInstanceIds(java.lang.String typeName,
java.lang.String attributeName,
K value)
Returns the existing Instance ids from
the concept-nets.The instance id is retrieved based on the type with the specified attribute name and its value. |
|
InstanceMetaItem |
getInstanceMetaItem(int instanceId)
Returns the instance meta item of specified instance id |
|
java.util.List<Instance> |
getInstances(java.util.List<java.lang.Integer> idList)
Returns the instances for the specified instance id |
|
java.util.List<Instance> |
getInstances(java.lang.Short typeId)
Returns all the instances for the specified Type |
|
java.util.List<Instance> |
getInstances(java.lang.String typeName)
Returns all the instances for the specified Type |
|
|
getInstances(java.lang.String typeName,
java.lang.String attributeName,
K value)
Returns the existing Instance from
the concept-nets.The instance is retrieved based on the type with the specified attribute name and its value. |
|
int |
getLeftEntityId(int relationInstanceId)
Returns the left associated entity id of the given relation id |
|
java.util.List<java.lang.Integer> |
getRelatedInstanceIds(int instanceId)
Returns the instance ids based on the relation association of the specified instance |
|
java.util.List<java.lang.Integer> |
getRelatedInstanceIds(int instanceId,
java.lang.String relationTypeName)
Returns the related Instance ids for the specified entity instance id and filtered by relation type name |
|
java.util.List<java.lang.Integer> |
getRelationIds(int instanceId)
Returns the associated relations Ids of an entity instance id |
|
java.util.List<java.lang.Integer> |
getRelationIds(int instanceId,
java.lang.String relationTypeName)
Returns the associated relations Ids of an entity instance id and filtered by relation type name |
|
java.util.List<RelationInstance> |
getRelationInstances(java.lang.Short typeId)
Returns all the relation instances of specified Type |
|
java.util.List<RelationInstance> |
getRelationInstances(java.lang.String typeName)
Returns all the relation instances of specified Type |
|
int |
getRightEntityId(int relationInstanceId)
Returns the right associated entity id of the given relation id |
|
Type |
getType(java.lang.String typeName)
Returns Type for the specified type name |
|
short |
getTypeId(int instanceId)
Returns the type id of the specified instance |
|
short |
getTypeId(java.lang.String typeName)
Returns the type id of the specified type name |
|
java.lang.String |
getTypeName(short typeId)
Returns the type name for the specified type id |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ItemQuery(java.lang.String cnetDirName,
ItemTable<java.lang.String,java.lang.Short,Type> typeTable,
ItemTable<java.lang.Short,java.lang.Integer,InstanceMetaItem> instanceTable,
RelationTable relationTable)
throws java.io.FileNotFoundException,
java.io.IOException
cnetDirName - concept-net directory nametypeTable - type table referenceinstanceTable - instance table reference
java.io.FileNotFoundException - if concept-net file not found
java.io.IOException - if file operation fails| Method Detail |
|---|
public void close()
throws java.io.IOException
close in interface Queryjava.io.IOException - if file operation failspublic java.util.List<java.lang.Integer> getAllEntityInstanceIds()
getAllEntityInstanceIds in interface Querypublic java.util.List<EntityInstance> getAllEntityInstances()
getAllEntityInstances in interface QueryEntityInstancepublic java.util.List<java.lang.Short> getAllEntityTypeIds()
getAllEntityTypeIds in interface Querypublic java.util.List<java.lang.Integer> getAllInstanceIds()
getAllInstanceIds in interface Querypublic java.util.List<java.lang.Integer> getAllRelationInstanceIds()
getAllRelationInstanceIds in interface Querypublic java.util.List<RelationInstance> getAllRelationInstances()
getAllRelationInstances in interface QueryRelationInstancepublic java.util.List<java.lang.Short> getAllRelationTypeIds()
getAllRelationTypeIds in interface Querypublic java.util.List<java.lang.Short> getAllTypeIds()
getAllTypeIds in interface Querypublic java.util.List<EntityInstance> getEntityInstances(java.lang.Short typeId)
getEntityInstances in interface QuerytypeId - type id
EntityInstancepublic java.util.List<EntityInstance> getEntityInstances(java.lang.String typeName)
getEntityInstances in interface QuerytypeName - type name
EntityInstancepublic Instance getInstance(int instanceId)
getInstance in interface QueryinstanceId - instance id
public java.util.List<java.lang.Integer> getInstanceIds(short typeId)
getInstanceIds in interface QuerytypeId - type id
public java.util.List<java.lang.Integer> getInstanceIds(java.lang.String typeName)
getInstanceIds in interface QuerytypeName - type name
public <K extends java.lang.Comparable<K>> java.util.List<java.lang.Integer> getInstanceIds(java.lang.String typeName,
java.lang.String attributeName,
K value)
Instance ids from
the concept-nets.NULL, if Instance does not exists.
getInstanceIds in interface QuerytypeName - type nameattributeName - instance's attribute namevalue - the attribute value
public InstanceMetaItem getInstanceMetaItem(int instanceId)
getInstanceMetaItem in interface QueryinstanceId - instance's id
InstanceMetaItempublic java.util.List<Instance> getInstances(java.util.List<java.lang.Integer> idList)
getInstances in interface QueryidList - list of instance ids
public java.util.List<Instance> getInstances(java.lang.Short typeId)
getInstances in interface QuerytypeId - type id
Instancepublic java.util.List<Instance> getInstances(java.lang.String typeName)
getInstances in interface QuerytypeName - type name
Instance
public <K extends java.lang.Comparable<K>> java.util.List<Instance> getInstances(java.lang.String typeName,
java.lang.String attributeName,
K value)
Instance from
the concept-nets.NULL, if Instance does not exists.
getInstances in interface QuerytypeName - type nameattributeName - instance's attribute namevalue - the attribute value
Instance listpublic int getLeftEntityId(int relationInstanceId)
getLeftEntityId in interface QueryrelationInstanceId - relation instance id
public java.util.List<java.lang.Integer> getRelatedInstanceIds(int instanceId)
getRelatedInstanceIds in interface QueryinstanceId - entity instance id
public java.util.List<java.lang.Integer> getRelatedInstanceIds(int instanceId,
java.lang.String relationTypeName)
getRelatedInstanceIds in interface QueryinstanceId - entity instance id whose relations are to be fetchedrelationTypeName - relation type name to filter the instance's relations
public java.util.List<java.lang.Integer> getRelationIds(int instanceId)
getRelationIds in interface QueryinstanceId - entity instance id whose relations are to be fetched
public java.util.List<java.lang.Integer> getRelationIds(int instanceId,
java.lang.String relationTypeName)
getRelationIds in interface QueryinstanceId - entity instance id whose relations are to be fetchedrelationTypeName - relation type name to filter the instance's relations
public java.util.List<RelationInstance> getRelationInstances(java.lang.Short typeId)
getRelationInstances in interface QuerytypeId - type id
RelationInstancepublic java.util.List<RelationInstance> getRelationInstances(java.lang.String typeName)
getRelationInstances in interface QuerytypeName - type name
RelationInstancepublic int getRightEntityId(int relationInstanceId)
getRightEntityId in interface QueryrelationInstanceId - relation instance id
public Type getType(java.lang.String typeName)
getType in interface QueryType if exists, else nullpublic short getTypeId(int instanceId)
getTypeId in interface QueryinstanceId - instance id
public short getTypeId(java.lang.String typeName)
getTypeId in interface QuerytypeName - type name
public java.lang.String getTypeName(short typeId)
getTypeName in interface QuerytypeId - Type id
Type
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||