Queries

Relationship Query

class dlkit.relationship.queries.RelationshipQuery

Bases: dlkit.osid.queries.OsidRelationshipQuery

This is the query for searching relationships.

Each method match specifies an AND term while multiple invocations of the same method produce a nested OR.

match_source_id(peer, match)

Matches a relationship peer.

Parameters:
  • peer (osid.id.Id) – peer Id to match
  • match (boolean) – true for a positive match, false for a negative match
Raise:

NullArgumentpeer is null

compliance: mandatory – This method must be implemented.

source_id_terms
match_destination_id(peer, match)

Matches the other relationship peer.

Parameters:
  • peer (osid.id.Id) – peer Id to match
  • match (boolean) – true for a positive match, false for a negative match
Raise:

NullArgumentpeer is null

compliance: mandatory – This method must be implemented.

destination_id_terms
match_same_peer_id(match)

Matches circular relationships to the same peer.

Parameters:match (boolean) – true for a positive match, false for a negative match

compliance: mandatory – This method must be implemented.

same_peer_id_terms
match_family_id(family_id, match)

Sets the family Id for this query.

Parameters:
  • family_id (osid.id.Id) – a family Id
  • match (boolean) – true for a positive match, false for a negative match
Raise:

NullArgumentfamily_id is null

compliance: mandatory – This method must be implemented.

family_id_terms
supports_family_query()

Tests if a FamilyQuery is available.

Returns:true if a family query is available, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

family_query

Gets the query for a family.

Multiple retrievals produce a nested OR term.

Returns:the family query
Return type:osid.relationship.FamilyQuery
Raise:Unimplementedsupports_family_query() is false

compliance: optional – This method must be implemented if ``supports_family_query()`` is ``true``.

family_terms
get_relationship_query_record(relationship_record_type)

Gets the relationship query record corresponding to the given Relationship record Type.

Multiple record retrievals produce a nested OR term.

Parameters:relationship_record_type (osid.type.Type) – a relationship record type
Returns:the relationship query record
Return type:osid.relationship.records.RelationshipQueryRecord
Raise:NullArgumentrelationship_record_type is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure occurred
Raise:Unsupportedhas_record_type(relationship_record_type) is false

compliance: mandatory – This method must be implemented.

Family Query

class dlkit.relationship.queries.FamilyQuery

Bases: dlkit.osid.queries.OsidCatalogQuery

This is the query interface for searching for families.

Each method specifies an AND term while multiple invocations of the same method produce a nested OR.

match_relationship_id(relationship_id, match)

Matches a relationship Id.

Parameters:
  • relationship_id (osid.id.Id) – a relationship Id
  • match (boolean) – true for a positive match, false for a negative match
Raise:

NullArgumentrelationship_id is null

compliance: mandatory – This method must be implemented.

relationship_id_terms
supports_relationship_query()

Tests if a relationship query is available.

Returns:true if a relationship query is available, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

relationship_query

Gets the query interface for a relationship.

Returns:the relationship query
Return type:osid.relationship.RelationshipQuery
Raise:Unimplementedsupports_relationship_query() is false

compliance: optional – This method must be implemented if ``supports_relationship_query()`` is ``true``.

match_any_relationship(match)

Matches families with any relationship.

Parameters:match (boolean) – true to match families with any relationship, false to match families with no relationship

compliance: mandatory – This method must be implemented.

relationship_terms
match_ancestor_family_id(family_id, match)

Sets the family Id for this query to match families that have the specified family as an ancestor.

Parameters:
  • family_id (osid.id.Id) – a family Id
  • match (boolean) – true for a positive match, false for a negative match
Raise:

NullArgumentfamily_id is null

compliance: mandatory – This method must be implemented.

ancestor_family_id_terms
supports_ancestor_family_query()

Tests if a FamilyQuery is available.

Returns:true if a family query interface is available, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

ancestor_family_query

Gets the query interface for a family.

Multiple retrievals produce a nested OR term.

Returns:the family query
Return type:osid.relationship.FamilyQuery
Raise:Unimplementedsupports_ancestor_family_query() is false

compliance: optional – This method must be implemented if ``supports_ancestor_family_query()`` is ``true``.

match_any_ancestor_family(match)

Matches families with any ancestor.

Parameters:match (boolean) – true to match families with any ancestor, false to match root families

compliance: mandatory – This method must be implemented.

ancestor_family_terms
match_descendant_family_id(family_id, match)

Sets the family Id for this query to match families that have the specified family as a descednant.

Parameters:
  • family_id (osid.id.Id) – a family Id
  • match (boolean) – true for a positive match, false for a negative match
Raise:

NullArgumentfamily_id is null

compliance: mandatory – This method must be implemented.

descendant_family_id_terms
supports_descendant_family_query()

Tests if a FamilyQuery is available.

Returns:true if a family query interface is available, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

descendant_family_query

Gets the query interface for a family.

Multiple retrievals produce a nested OR term.

Returns:the family query
Return type:osid.relationship.FamilyQuery
Raise:Unimplementedsupports_descendant_family_query() is false

compliance: optional – This method must be implemented if ``supports_descendant_family_query()`` is ``true``.

match_any_descendant_family(match)

Matches families with any decendant.

Parameters:match (boolean) – true to match families with any decendants, false to match leaf families

compliance: mandatory – This method must be implemented.

descendant_family_terms
get_family_query_record(family_record_type)

Gets the family query record corresponding to the given Family record Type.

Multiple record retrievals produce a nested boolean OR term.

Parameters:family_record_type (osid.type.Type) – a family record type
Returns:the family query record
Return type:osid.relationship.records.FamilyQueryRecord
Raise:NullArgumentfamily_record_type is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure occurred
Raise:Unsupportedhas_record_type(family_record_type) is false

compliance: mandatory – This method must be implemented.