Family¶
Family¶
-
class
dlkit.services.relationship.Family(provider_manager, catalog, runtime, proxy, **kwargs)¶ Bases:
dlkit.osid.objects.OsidCatalog,dlkit.osid.sessions.OsidSessionA
Familyrepresents a collection of relationships.Like all OSID objects, a
Familyis identified by itsIdand any persisted references should use theId.-
get_family_record(family_record_type)¶ Gets the famly record corresponding to the given
FamilyrecordType.This method is used to retrieve an object implementing the requested record. The
family_record_typemay be theTypereturned inget_record_types()or any of its parents in aTypehierarchy wherehas_record_type(family_record_type)istrue.Parameters: family_record_type ( osid.type.Type) – the type of family record to retrieveReturns: the family record Return type: osid.relationship.records.FamilyRecordRaise: NullArgument–family_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failure occurredRaise: Unsupported–has_record_type(family_record_type)isfalsecompliance: mandatory – This method must be implemented.
-
Relationship Lookup Methods¶
Family.family_id¶Gets the
FamiltIdassociated with this session.
Returns: the Family Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
Family.family¶Gets the
Familyassociated with this session.
Returns: the family Return type: osid.relationship.FamilyRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.can_lookup_relationships()¶Tests if this user can perform
Relationshiplookups.A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a
PermissionDenied. This is intended as a hint to an application that may not offer lookup operations to unauthorized users.
Returns: falseif lookup methods are not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
Family.use_comparative_relationship_view()¶The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.
This view is used when greater interoperability is desired at the expense of precision.
compliance: mandatory – This method is must be implemented.
Family.use_plenary_relationship_view()¶A complete view of the
Relationshipreturns is desired.Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.
compliance: mandatory – This method is must be implemented.
Family.use_federated_family_view()¶Federates the view for methods in this session.
A federated view will include relationships in families which are children of this family in the family hierarchy.
compliance: mandatory – This method is must be implemented.
Family.use_isolated_family_view()¶Isolates the view for methods in this session.
An isolated view restricts retrievals to this family only.
compliance: mandatory – This method is must be implemented.
Family.use_effective_relationship_view()¶Only relationships whose effective dates are current are returned by methods in this session.
compliance: mandatory – This method is must be implemented.
Family.use_any_effective_relationship_view()¶All relationships of any effective dates are returned by all methods in this session.
compliance: mandatory – This method is must be implemented.
Family.get_relationship(relationship_id)¶Gets the
Relationshipspecified by itsId.
Parameters: relationship_id ( osid.id.Id) – theIdof theRelationshipto retrieveReturns: the returned RelationshipReturn type: osid.relationship.RelationshipRaise: NotFound– noRelationshipfound with the givenIdRaise: NullArgument–relationship_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_by_ids(relationship_ids)¶Gets a
RelationshipListcorresponding to the givenIdList.
Parameters: relationship_ids ( osid.id.IdList) – the list ofIdsto retrieveReturns: the returned Relationship listReturn type: osid.relationship.RelationshipListRaise: NotFound– anIdwas not foundRaise: NullArgument–relationship_idsisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_by_genus_type(relationship_genus_type)¶Gets a
RelationshipListcorresponding to the given relationship genusTypewhich does not include relationships of types derived from the specifiedType.
Parameters: relationship_genus_type ( osid.type.Type) – a relationship genus typeReturns: the returned Relationship listReturn type: osid.relationship.RelationshipListRaise: NullArgument–relationship_genus_typeisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_by_parent_genus_type(relationship_genus_type)¶Gets a
RelationshipListcorresponding to the given relationship genusTypeand include any additional relationships with genus types derived from the specifiedType.
Parameters: relationship_genus_type ( osid.type.Type) – a relationship genus typeReturns: the returned Relationship listReturn type: osid.relationship.RelationshipListRaise: NullArgument–relationship_genus_typeisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_by_record_type(relationship_record_type)¶Gets a
RelationshipListcontaining the given relationship recordType.
Parameters: relationship_record_type ( osid.type.Type) – a relationship record typeReturns: the returned RelationshipListReturn type: osid.relationship.RelationshipListRaise: NullArgument–relationship_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_on_date(from_, to)¶Gets a
RelationshipListeffective during the entire given date range inclusive but not confined to the date range.
Parameters:
- from (
osid.calendaring.DateTime) – starting date- to (
osid.calendaring.DateTime) – ending dateReturns: the relationships
Return type:
osid.relationship.RelationshipListRaise:
InvalidArgument–from is greater than toRaise:
NullArgument–fromortoisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_for_source(source_id)¶Gets a
RelationshipListcorresponding to the given peerId.
Parameters: source_id ( osid.id.Id) – a peerIdReturns: the relationships Return type: osid.relationship.RelationshipListRaise: NullArgument–source_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_for_source_on_date(source_id, from_, to)¶Gets a
RelationshipListcorresponding to the given peerIdand effective during the entire given date range inclusive but not confined to the date range.
Parameters:
- source_id (
osid.id.Id) – a peerId- from (
osid.calendaring.DateTime) – starting date- to (
osid.calendaring.DateTime) – ending dateReturns: the relationships
Return type:
osid.relationship.RelationshipListRaise:
InvalidArgument–from is greater than toRaise:
NullArgument–source_id, from,ortoisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_by_genus_type_for_source(source_id, relationship_genus_type)¶Gets a
RelationshipListcorresponding to the given peerIdand relationship genus ``Type.Relationships`` of any genus derived from the given genus are returned.
In plenary mode, the returned list contains all of the relationships corresponding to the given peer, including duplicates, or an error results if a relationship is inaccessible. Otherwise, inaccessible
Relationshipsmay be omitted from the list and may present the elements in any order including returning a unique set.In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.
Parameters:
- source_id (
osid.id.Id) – a peerId- relationship_genus_type (
osid.type.Type) – a relationship genus typeReturns: the relationships
Return type:
osid.relationship.RelationshipListRaise:
NullArgument–source_idorrelationship_genus_typeisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_by_genus_type_for_source_on_date(source_id, relationship_genus_type, from_, to)¶Gets a
RelationshipListcorresponding to the given peerIdand relationship genusTypeand effective during the entire given date range inclusive but not confined to the date range.
Parameters:
- source_id (
osid.id.Id) – a peerId- relationship_genus_type (
osid.type.Type) – a relationship genus type- from (
osid.calendaring.DateTime) – starting date- to (
osid.calendaring.DateTime) – ending dateReturns: the relationships
Return type:
osid.relationship.RelationshipListRaise:
InvalidArgument–from is greater than toRaise:
NullArgument–source_id, relationship_genus_type, fromortoisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_for_destination(destination_id)¶Gets a
RelationshipListcorresponding to the given peerId.
Parameters: destination_id ( osid.id.Id) – a peerIdReturns: the relationships Return type: osid.relationship.RelationshipListRaise: NullArgument–destination_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_for_destination_on_date(destination_id, from_, to)¶Gets a
RelationshipListcorresponding to the given peerIdwith a starting effective date in the given range inclusive.
Parameters:
- destination_id (
osid.id.Id) – a peerId- from (
osid.calendaring.DateTime) – starting date- to (
osid.calendaring.DateTime) – ending dateReturns: the relationships
Return type:
osid.relationship.RelationshipListRaise:
InvalidArgument–from is greater than toRaise:
NullArgument–destination_id, from,ortoisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_by_genus_type_for_destination(destination_id, relationship_genus_type)¶Gets a
RelationshipListcorresponding to the given peerIdand relationship genus ``Type.Relationships`` of any genus derived from the given genus are returned.
In plenary mode, the returned list contains all of the relationships corresponding to the given peer, including duplicates, or an error results if a relationship is inaccessible. Otherwise, inaccessible
Relationshipsmay be omitted from the list and may present the elements in any order including returning a unique set.In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.
Parameters:
- destination_id (
osid.id.Id) – a peerId- relationship_genus_type (
osid.type.Type) – a relationship genus typeReturns: the relationships
Return type:
osid.relationship.RelationshipListRaise:
NullArgument–destination_idorrelationship_genus_typeisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_by_genus_type_for_destination_on_date(destination_id, relationship_genus_type, from_, to)¶Gets a
RelationshipListcorresponding to the given peerIdand relationship genusTypeand effective during the entire given date range inclusive but not confined to the date range.
Parameters:
- destination_id (
osid.id.Id) – a peerId- relationship_genus_type (
osid.type.Type) – a relationship genus type- from (
osid.calendaring.DateTime) – starting date- to (
osid.calendaring.DateTime) – ending dateReturns: the relationships
Return type:
osid.relationship.RelationshipListRaise:
InvalidArgument–from is greater than toRaise:
NullArgument–destination_id, relationship_genus_type, fromortoisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_for_peers(source_id, destination_id)¶Gets a
RelationshipListcorresponding to the given peerIds.
Parameters:
- source_id (
osid.id.Id) – a peerId- destination_id (
osid.id.Id) – a related peerIdReturns: the relationships
Return type:
osid.relationship.RelationshipListRaise:
NullArgument–source_idordestination_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_for_peers_on_date(source_id, destination_id, from_, to)¶Gets a
RelationshipListcorresponding to the given peerIdsand effective during the entire given date range inclusive but not confined to the date range.
Parameters:
- source_id (
osid.id.Id) – a peerId- destination_id (
osid.id.Id) – a related peerId- from (
osid.calendaring.DateTime) – starting date- to (
osid.calendaring.DateTime) – ending dateReturns: the relationships
Return type:
osid.relationship.RelationshipListRaise:
InvalidArgument–fromis greater thantoRaise:
NullArgument–source_id, destination_id, fromortoisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_by_genus_type_for_peers(source_id, destination_id, relationship_genus_type)¶Gets a
RelationshipListcorresponding between the given peerIdsand relationship genus ``Type.Relationships`` of any genus derived from the given genus are returned.
In plenary mode, the returned list contains all of the relationships corresponding to the given peer or an error results if a relationship is inaccessible. Otherwise, inaccessible
Relationshipsmay be omitted from the list.In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.
Parameters:
- source_id (
osid.id.Id) – a peerId- destination_id (
osid.id.Id) – a related peerId- relationship_genus_type (
osid.type.Type) – a relationship genus typeReturns: the relationships
Return type:
osid.relationship.RelationshipListRaise:
NullArgument–source_id, destination_id,orrelationship_genus_typeisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.get_relationships_by_genus_type_for_peers_on_date(source_id, destination_id, relationship_genus_type, from_, to)¶Gets a
RelationshipListeffective during the entire given date range inclusive but not confined to the date range.
Parameters:
- source_id (
osid.id.Id) – a peerId- destination_id (
osid.id.Id) – a related peerId- relationship_genus_type (
osid.type.Type) – a relationship genus type- from (
osid.calendaring.DateTime) – starting date- to (
osid.calendaring.DateTime) – ending dateReturns: the relationships
Return type:
osid.relationship.RelationshipListRaise:
InvalidArgument–from is greater than toRaise:
NullArgument–source_id, destination_id, relationship_genus_type, fromortoisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.relationships¶Gets all
Relationships.
Returns: a list of RelationshipsReturn type: osid.relationship.RelationshipListRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Relationship Query Methods¶
Family.family_idGets the
FamiltIdassociated with this session.
Returns: the Family Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
Family.familyGets the
Familyassociated with this session.
Returns: the family Return type: osid.relationship.FamilyRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.use_federated_family_view()Federates the view for methods in this session.
A federated view will include relationships in families which are children of this family in the family hierarchy.
compliance: mandatory – This method is must be implemented.
Family.use_isolated_family_view()Isolates the view for methods in this session.
An isolated view restricts retrievals to this family only.
compliance: mandatory – This method is must be implemented.
Family.can_search_relationships()¶Tests if this user can perform
Relationshipsearches.A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a
PermissionDenied. This is intended as a hint to an application that may opt not to offer search operations to unauthorized users.
Returns: falseif search methods are not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
Family.relationship_query¶Gets a relationship query.
Returns: the relationship query Return type: osid.relationship.RelationshipQuerycompliance: mandatory – This method must be implemented.
Family.get_relationships_by_query(relationship_query)¶Gets a list of
Relationshipsmatching the given relationship query.
Parameters: relationship_query ( osid.relationship.RelationshipQuery) – the relationship queryReturns: the returned RelationshipListReturn type: osid.relationship.RelationshipListRaise: NullArgument–relationship_queryisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–relationship_queryis not of this servicecompliance: mandatory – This method must be implemented.
Relationship Admin Methods¶
Family.family_idGets the
FamiltIdassociated with this session.
Returns: the Family Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
Family.familyGets the
Familyassociated with this session.
Returns: the family Return type: osid.relationship.FamilyRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.can_create_relationships()¶Tests if this user can create
RelationshipsA return of true does not guarantee successful authorization.A return of false indicates that it is known creating a
Relationshipwill result in aPermissionDenied. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
Returns: falseifRelationshipcreation is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
Family.can_create_relationship_with_record_types(relationship_record_types)¶Tests if this user can create a single
Relationshipusing the desired record types.While
RelationshipManager.getRelationshipRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificRelationship. Providing an empty array tests if aRelationshipcan be created with no records.
Parameters: relationship_record_types ( osid.type.Type[]) – array of relationship record typesReturns: trueifRelationshipcreation using the specified recordTypesis supported,falseotherwiseReturn type: booleanRaise: NullArgument–relationship_record_typesisnullcompliance: mandatory – This method must be implemented.
Family.get_relationship_form_for_create(source_id, destination_id, relationship_record_types)¶Gets the relationship form for creating new relationships.
A new form should be requested for each create transaction.
Parameters:
- source_id (
osid.id.Id) –Idof a peer- destination_id (
osid.id.Id) –Idof the related peer- relationship_record_types (
osid.type.Type[]) – array of relationship record typesReturns: the relationship form
Return type:
osid.relationship.RelationshipFormRaise:
NotFound–source_idordestination_idis not foundRaise:
NullArgument–source_idordestination_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failureRaise:
Unsupported– unable to get form for requested recod typescompliance: mandatory – This method must be implemented.
Family.create_relationship(relationship_form)¶Creates a new
Relationship.
Parameters: relationship_form ( osid.relationship.RelationshipForm) – the form for thisRelationshipReturns: the new RelationshipReturn type: osid.relationship.RelationshipRaise: IllegalState–relationship_formalready used in a create transactionRaise: InvalidArgument– one or more of the form elements is invalidRaise: NullArgument–relationship_formisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–relationship_formdid not originate fromget_relationship_form_for_create()compliance: mandatory – This method must be implemented.
Family.can_update_relationships()¶Tests if this user can update
Relationships.A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a
Relationshipwill result in aPermissionDenied. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
Returns: falseifRelationshipmodification is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
Family.get_relationship_form_for_update(relationship_id)¶Gets the relationship form for updating an existing relationship.
A new relationship form should be requested for each update transaction.
Parameters: relationship_id ( osid.id.Id) – theIdof theRelationshipReturns: the relationship form Return type: osid.relationship.RelationshipFormRaise: NotFound–relationship_idis not foundRaise: NullArgument–relationship_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.update_relationship(relationship_form)¶Updates an existing relationship.
Parameters: relationship_form ( osid.relationship.RelationshipForm) – the form containing the elements to be updatedRaise: IllegalState–relationship_formalready used in an update transactionRaise: InvalidArgument– the form contains an invalid valueRaise: NullArgument–relationship_formisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–relationship_formdid not originate fromget_relationship_form_for_update()compliance: mandatory – This method must be implemented.
Family.can_delete_relationships()¶Tests if this user can delete
Relationships.A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a
Relationshipwill result in aPermissionDenied. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
Returns: falseifRelationshipdeletion is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
Family.delete_relationship(relationship_id)¶Deletes a
Relationship.
Parameters: relationship_id ( osid.id.Id) – theIdof theRelationshipto removeRaise: NotFound–relationship_idnot foundRaise: NullArgument–relationship_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Family.can_manage_relationship_aliases()¶Tests if this user can manage
Idaliases forRelationships.A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a
PermissionDenied. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
Returns: falseifRelationshipaliasing is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
Family.alias_relationship(relationship_id, alias_id)¶Adds an
Idto aRelationshipfor the purpose of creating compatibility.The primary
Idof theRelationshipis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another relationship, it is reassigned to the given relationshipId.
Parameters:
- relationship_id (
osid.id.Id) – theIdof aRelationship- alias_id (
osid.id.Id) – the aliasIdRaise:
AlreadyExists–alias_idis already assignedRaise:
NotFound–relationshipnot foundRaise:
NullArgument–relationship_idoralias_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.