Package biana :: Package BianaObjects :: Module UserEntitySet :: Class UserEntitySet
[hide private]
[frames] | no frames]

Class UserEntitySet

source code


Class that represents a set of user entities.

Instance Methods [hide private]
 
__init__(self, id, setIdUserEntity=None, listRelations=None, listLevelSetIdUserEntity=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_initialize_restrictions_dict(self) source code
 
addRestriction(self, restriction_type, restrictions) source code
 
setRestriction(self, restriction_type, restriction) source code
 
getRestrictions(self, restriction_type) source code
 
addTagToSelectedUE(self, tag)
Adds a tag to selected user entities in this set
source code
 
addTagToSelectedUER(self, tag)
Adds a tag to selected user entities in this set
source code
 
getTagLinkageDegree(self, tag)
Calculates the linkage degree of all nodes to "tag"
source code
 
get_user_entity_ids_by_linker_degree_cutoff(self, linker_degree_cutoff)
Get user entities having a linker degree equal or higher to a given cutoff.
source code
 
getUserEntitySecondaryTagLinkageDegree(self, userEntityID, tag)
Calculates a secondary linkage degree.
source code
 
getUserEntityTagLinkageDegree(self, userEntityID, tag) source code
 
getPathLengthNetwork(self, listUserEntityID, path_length_cutoff=10000)
Returns an undirected weighted networkx graph containing only nodes in listUserEntityID
source code
 
testfast_getUserEntityTagConnectedMetrics(self, userEntityIDList, tag) source code
 
_get_single_source_shortest_path(self, userEntityIDList) source code
 
getUserEntityTagConnectedMetrics(self, userEntityID, tag)
Test method
source code
 
has_user_entity(self, user_entity_id) source code
 
has_tag(self, userEntityID, tag) source code
 
relation_has_tag(self, userEntityRelationID, tag)
userEntityRelationID is a tuple (userEntityRelationA, userEntityRelationB) where userEntityRelationA <= userEntityRelationB
source code
 
hasTag(self, tag) source code
 
relationHasTag(self, tag) source code
 
get_user_entity_tags(self, user_entity_id) source code
 
get_external_entity_relation_tags(self, external_entity_relation_id) source code
 
get_user_entities_for_tag(self, tag) source code
 
get_external_entity_relations_for_tag(self, tag) source code
 
get_all_user_entity_tags(self) source code
 
get_all_user_entity_relation_tags(self) source code
 
getUserEntityGroups(self, userEntityID)
Returns the groups in which this user entity belongs
source code
 
get_group_user_entities(self, group_id)
Returns the user entities belonging to this group
source code
 
get_groups_ids(self)
Returns a collection of the ids of the groups (they should be external entity ids)
source code
 
has_group(self, group_id) source code
 
get_level(self) source code
 
getSize(self) source code
 
getNumberEdges(self) source code
 
getNetwork(self) source code
 
setNetwork(self, netw) source code
 
setIsNetworkCreated(self) source code
 
isNetworkCreated(self)
Checks if is_network_created is True or False #Checks if this user entity set contains any edge (so, if it contains any edge)
source code
 
selectUserEntitiesByTag(self, tagList) source code
 
selectUserEntityRelationsByTag(self, tagList) source code
 
inverse_user_entity_relations_selection(self)
Reverses the current selection of user entity relations
source code
 
select_user_entity_relations_between_two_subsets(self, user_entity_ids_list1, user_entity_ids_list2, types_list)
Selects the direct relations between the user entities belonging to the two lists
source code
 
select_user_entities(self, user_entity_id_list)
Selects a user entity in this user entity set
source code
 
selectUserEntityRelations(self, external_entity_relation_id_list)
Selects a user entity relation in this user entity set
source code
 
_get_user_entity_relation_id(self, node1, node2) source code
 
getSelectionSize(self) source code
 
getRelationSelectionSize(self) source code
 
clear_user_entity_selection(self) source code
 
clear_user_entity_relation_selection(self) source code
 
addUserEntityId(self, idUserEntity, level=0)
Adds a user entity to this user entity set to the level "level"
source code
 
setGroupsHierarchy(self, list_hierarchy)
"list_hierarchy" is a list [(group_id1, group_id2) in which group_id1 is child of group_id2
source code
 
addUserEntitiesToGroup(self, group_id, userEntityID, representative_userEntityID, group_type, parentGroupID=None)
One of the two user entities must belong to the network "parentGroupID" is used to store groups hierarchy
source code
 
get_external_entity_relation_participants(self, external_entity_relation_id) source code
 
addUserEntityRelation(self, idUserEntity1, idUserEntity2, externalEntityRelationID)
returns True if it has been added, or False if it existed previously a relation between idUserEntity1 and idUserEntity2
source code
 
_getRelationHash(self, userEntityID1, userEntityID2) source code
 
remove_node(self, nodeID) source code
 
remove_selected_relations(self) source code
 
get_external_entity_relation_ids(self, user_entity_id1, user_entity_id2) source code
 
remove_external_entity_relation(self, externalEntityRelationID) source code
 
remove_edge(self, nodeID1, nodeID2, externalEntityRelationID=None)
If externalEntityRelationID is None, remove all edges between these two nodes
source code
 
remove_unconnected_nodes(self) source code
 
getNodeLevelDict(self) source code
 
getNodeLevel(self, nodeID) source code
 
get_user_entity_ids(self, level=None)
"level" can be a number with the level or "last"
source code
 
getRelationIds(self) source code
 
getRelations(self, cardinality_check=False)
o cardinality_check: Boolean.
source code
 
getSelectedUserEntities(self) source code
 
getSelectedUserEntityRelations(self) source code
 
getRelationsOfSelectedUserEntities(self) source code
 
getRelationsBetweenGivenUserEntities(self, setIdUserEntity)
Fetchs interactions between all the user entities provided in the set Returns a set of tuples containing (id1, id2)
source code
 
getShortestPathBetween(self, idUserEntity1, idUserEntity2) source code
 
getAllPathsFrom(self, idUserEntity) source code
 
getUnionWithGivenUserEntitySet(self, objUserEntitySet, flagIncludeInteractions) source code
 
getIntersectionWithGivenUserEntitySet(self, objUserEntitySet, flagIncludeInteractions)
Interactions for intersection nodes are included if flagIncludeInteractions is selected
source code
 
get_node_degree(self, userEntityID) source code
 
get_unconnected_nodes(self) source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
_get_xml_header(self) source code
 
_get_xml_foot(self) source code
 
_get_xml(self, inner_content='') source code
 
_get_groups_xml(self, only_not_printed=False, group_identifiers={})
group_identfiers is a dictionary with the id of the node as a key and a name for the node
source code
 
_update_selected_external_ids_dict(self, attribute, selected_ext_id_name)
Updates self.selectedExternalIdsDict and self.selectedExtIdsLowerDict
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, id, setIdUserEntity=None, listRelations=None, listLevelSetIdUserEntity=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__

getTagLinkageDegree(self, tag)

source code 

Calculates the linkage degree of all nodes to "tag"

returns a dictionary node ids as keys and linkage degree as value

getUserEntitySecondaryTagLinkageDegree(self, userEntityID, tag)

source code 

Calculates a secondary linkage degree. It is defined as the mean of the linkage degree of the neighbors plus the node LD

getPathLengthNetwork(self, listUserEntityID, path_length_cutoff=10000)

source code 

Returns an undirected weighted networkx graph containing only nodes in listUserEntityID

Nodes are connected if exist a path between them, and weight of the edge consists in the length of shortest path

select_user_entity_relations_between_two_subsets(self, user_entity_ids_list1, user_entity_ids_list2, types_list)

source code 

Selects the direct relations between the user entities belonging to the two lists

For example, an interaction between a user entity in list 1 with an user entity in list 2 will be selected

An interaction between two user entities in list 1 won't be selected

"types" is a list of the relation types to be selected

select_user_entities(self, user_entity_id_list)

source code 

Selects a user entity in this user entity set

User entities in the list must exist in the set!!!

selectUserEntityRelations(self, external_entity_relation_id_list)

source code 

Selects a user entity relation in this user entity set

"external_entity_relation_id_list": is a list of external entity relation ids to select

getRelations(self, cardinality_check=False)

source code 

o cardinality_check: Boolean. Lowest userEntityId is returned as first element of the tuple; highest as second.

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)