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 nestedOR
.-
match_source_id
(peer, match)¶ Matches a relationship peer.
Parameters: - peer (
osid.id.Id
) – peerId
to match - match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–peer
isnull
compliance: mandatory – This method must be implemented.
- peer (
-
source_id_terms
¶
-
match_destination_id
(peer, match)¶ Matches the other relationship peer.
Parameters: - peer (
osid.id.Id
) – peerId
to match - match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–peer
isnull
compliance: mandatory – This method must be implemented.
- peer (
-
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 matchcompliance: 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 familyId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–family_id
isnull
compliance: mandatory – This method must be implemented.
- family_id (
-
family_id_terms
¶
-
supports_family_query
()¶ Tests if a
FamilyQuery
is available.Returns: true
if a family query is available,false
otherwiseReturn 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: Unimplemented
–supports_family_query()
isfalse
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
recordType
.Multiple record retrievals produce a nested
OR
term.Parameters: relationship_record_type ( osid.type.Type
) – a relationship record typeReturns: the relationship query record Return type: osid.relationship.records.RelationshipQueryRecord
Raise: NullArgument
–relationship_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failure occurredRaise: Unsupported
–has_record_type(relationship_record_type)
isfalse
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 nestedOR
.-
match_relationship_id
(relationship_id, match)¶ Matches a relationship
Id
.Parameters: - relationship_id (
osid.id.Id
) – a relationshipId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–relationship_id
isnull
compliance: mandatory – This method must be implemented.
- relationship_id (
-
relationship_id_terms
¶
-
supports_relationship_query
()¶ Tests if a relationship query is available.
Returns: true
if a relationship query is available,false
otherwiseReturn 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: Unimplemented
–supports_relationship_query()
isfalse
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 relationshipcompliance: 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 familyId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–family_id
isnull
compliance: mandatory – This method must be implemented.
- family_id (
-
ancestor_family_id_terms
¶
-
supports_ancestor_family_query
()¶ Tests if a
FamilyQuery
is available.Returns: true
if a family query interface is available,false
otherwiseReturn 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: Unimplemented
–supports_ancestor_family_query()
isfalse
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 familiescompliance: 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 familyId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–family_id
isnull
compliance: mandatory – This method must be implemented.
- family_id (
-
descendant_family_id_terms
¶
-
supports_descendant_family_query
()¶ Tests if a
FamilyQuery
is available.Returns: true
if a family query interface is available,false
otherwiseReturn 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: Unimplemented
–supports_descendant_family_query()
isfalse
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 familiescompliance: 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
recordType
.Multiple record retrievals produce a nested boolean
OR
term.Parameters: family_record_type ( osid.type.Type
) – a family record typeReturns: the family query record Return type: osid.relationship.records.FamilyQueryRecord
Raise: NullArgument
–family_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failure occurredRaise: Unsupported
–has_record_type(family_record_type)
isfalse
compliance: mandatory – This method must be implemented.
-