iitb.con.query
Interface Query

All Known Implementing Classes:
ItemQuery

public interface Query


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
<K extends java.lang.Comparable<K>>
java.util.List<java.lang.Integer>
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 the specified instance id
 java.util.List<Instance> getInstances(java.util.List<java.lang.Integer> instanceIds)
          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
<K extends java.lang.Comparable<K>>
java.util.List<Instance>
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
 

Method Detail

close

void close()
           throws java.io.IOException
Closes the files that associated with the query object

Throws:
java.io.IOException - if file operation fails

getAllEntityInstanceIds

java.util.List<java.lang.Integer> getAllEntityInstanceIds()
Returns all the Entity Instances Id

Returns:
Instance Ids as List

getAllEntityInstances

java.util.List<EntityInstance> getAllEntityInstances()
Returns all the EntitiyInstances in the concept-net

Returns:
entity instance list
See Also:
EntityInstance

getAllEntityTypeIds

java.util.List<java.lang.Short> getAllEntityTypeIds()
Returns all entity type ids

Returns:
type ids as list

getAllInstanceIds

java.util.List<java.lang.Integer> getAllInstanceIds()
Returns all the Entity and Relation Instances Id

Returns:
Instance Ids as List

getAllRelationInstanceIds

java.util.List<java.lang.Integer> getAllRelationInstanceIds()
Returns all the Relation Instances Id

Returns:
Instance Ids as List

getAllRelationInstances

java.util.List<RelationInstance> getAllRelationInstances()
Returns all the RelationInstances in the concept-net

Returns:
relation instance list
See Also:
RelationInstance

getAllRelationTypeIds

java.util.List<java.lang.Short> getAllRelationTypeIds()
Returns all relation type ids

Returns:
type ids as list

getAllTypeIds

java.util.List<java.lang.Short> getAllTypeIds()
Returns all type ids

Returns:
type ids as list

getEntityInstances

java.util.List<EntityInstance> getEntityInstances(java.lang.Short typeId)
Returns all the entity instances of specified Type

Parameters:
typeId - type id
Returns:
Entity instance list of the given type
See Also:
EntityInstance

getEntityInstances

java.util.List<EntityInstance> getEntityInstances(java.lang.String typeName)
Returns all the entity instances of specified Type

Parameters:
typeName - type name
Returns:
Entity instance list of the given type
See Also:
EntityInstance

getInstance

Instance getInstance(int instanceId)
Returns the instance for the specified instance id

Parameters:
instanceId - instance id
Returns:
@link{Instance}

getInstanceIds

java.util.List<java.lang.Integer> getInstanceIds(short typeId)
Returns the instance ids for the specified Type id

Parameters:
typeId - type id
Returns:
instance ids of the relevant type

getInstanceIds

java.util.List<java.lang.Integer> getInstanceIds(java.lang.String typeName)
Returns the instance ids for the specified Type name

Parameters:
typeName - type name
Returns:
instance ids of the relevant type

getInstanceIds

<K extends java.lang.Comparable<K>> java.util.List<java.lang.Integer> 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.
Returns NULL, if Instance does not exists.

Parameters:
typeName - type name
attributeName - instance's attribute name
value - the attribute value
Returns:
instance ids as list

getInstanceMetaItem

InstanceMetaItem getInstanceMetaItem(int instanceId)
Returns the instance meta item of the specified instance id

Parameters:
instanceId - instance id
Returns:
InstanceMetaItem

getInstances

java.util.List<Instance> getInstances(java.util.List<java.lang.Integer> instanceIds)
Returns the instances for the specified instance id

Parameters:
instanceIds - list of instance ids
Returns:
@link{Instance}

getInstances

java.util.List<Instance> getInstances(java.lang.Short typeId)
Returns all the instances for the specified Type

Parameters:
typeId - type id
Returns:
instance list of the given type
See Also:
Instance

getInstances

java.util.List<Instance> getInstances(java.lang.String typeName)
Returns all the instances for the specified Type

Parameters:
typeName - type name
Returns:
instance list of the given type
See Also:
Instance

getInstances

<K extends java.lang.Comparable<K>> java.util.List<Instance> 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.
Returns NULL, if Instance does not exists.

Parameters:
typeName - type name
attributeName - instance's attribute name
value - the attribute value
Returns:
Instance list

getLeftEntityId

int getLeftEntityId(int relationInstanceId)
Returns the left associated entity id of the given relation id

Parameters:
relationInstanceId - relation instance id
Returns:
entity instance id

getRelatedInstanceIds

java.util.List<java.lang.Integer> getRelatedInstanceIds(int instanceId)
Returns the instance ids based on the relation association of the specified instance

Parameters:
instanceId - entity instance id
Returns:
entity instance ids which have relations with the specified instance

getRelatedInstanceIds

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

Parameters:
instanceId - entity instance id whose relations are to be fetched
relationTypeName - relation type name to filter the instance's relations
Returns:
Instance's relations Id as Integer List

getRelationIds

java.util.List<java.lang.Integer> getRelationIds(int instanceId)
Returns the associated relations Ids of an entity instance id

Parameters:
instanceId - entity instance id whose relations are to be fetched
Returns:
Instance's relations Id as Integer List

getRelationIds

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

Parameters:
instanceId - entity instance id whose relations are to be fetched
relationTypeName - relation type name to filter the instance's relations
Returns:
Instance's relations Id as Integer List

getRelationInstances

java.util.List<RelationInstance> getRelationInstances(java.lang.Short typeId)
Returns all the relation instances of specified Type

Parameters:
typeId - type id
Returns:
Relation instance list of the given type
See Also:
RelationInstance

getRelationInstances

java.util.List<RelationInstance> getRelationInstances(java.lang.String typeName)
Returns all the relation instances of specified Type

Parameters:
typeName - type name
Returns:
Relation instance list of the given type
See Also:
RelationInstance

getRightEntityId

int getRightEntityId(int relationInstanceId)
Returns the right associated entity id of the given relation id

Parameters:
relationInstanceId - relation instance id
Returns:
entity instance id

getType

Type getType(java.lang.String typeName)
Returns Type for the specified type name

Returns:
Type

getTypeId

short getTypeId(int instanceId)
Returns the type id of the specified instance

Parameters:
instanceId - instance id
Returns:
type id

getTypeId

short getTypeId(java.lang.String typeName)
Returns the type id of the specified type name

Parameters:
typeName - type name
Returns:
type id

getTypeName

java.lang.String getTypeName(short typeId)
Returns the type name for the specified type id

Parameters:
typeId - Type id
Returns:
type name
See Also:
Type