Queries¶
Resource Query¶
-
class
dlkit.resource.queries.
ResourceQuery
¶ Bases:
dlkit.osid.queries.OsidObjectQuery
This is the query for searching resources.
Each method specifies an
AND
term while multiple invocations of the same method produce a nestedOR
.-
match_group
(match)¶ Matches resources that are also groups.
Parameters: match ( boolean
) –true
for a positive match,false
for a negative matchcompliance: mandatory – This method must be implemented.
-
group_terms
¶
-
match_demographic
(match)¶ Matches resources that are also demographics.
Parameters: match ( boolean
) –true
for a positive match,false
for a negative matchcompliance: mandatory – This method must be implemented.
-
demographic_terms
¶
-
match_containing_group_id
(resource_id, match)¶ Sets the group
Id
for this query to match resources within the given group.Parameters: - resource_id (
osid.id.Id
) – a resourceId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–resource_id
isnull
compliance: mandatory – This method must be implemented.
- resource_id (
-
containing_group_id_terms
¶
-
supports_containing_group_query
()¶ Tests if a
ResourceQuery
is available for querying containing groups.Returns: true
if a group resource query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
containing_group_query
¶ Gets the query for a a containing group.
Multiple retrievals produce a nested
OR
term.Returns: the resource query Return type: osid.resource.ResourceQuery
Raise: Unimplemented
–supports_containing_group_query()
isfalse
compliance: optional – This method must be implemented if ``supports_agent_query()`` is ``true``.
-
match_any_containing_group
(match)¶ Matches resources inside any group.
Parameters: match ( boolean
) –true
to match any containing group,false
to match resources part of no groupscompliance: mandatory – This method must be implemented.
-
containing_group_terms
¶
-
match_avatar_id
(asset_id, match)¶ Sets the asset
Id
for this query.Parameters: - asset_id (
osid.id.Id
) – the assetId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–asset_id
isnull
compliance: mandatory – This method must be implemented.
- asset_id (
-
avatar_id_terms
¶
-
supports_avatar_query
()¶ Tests if an
AssetQuery
is available.Returns: true
if an asset query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
avatar_query
¶ Gets the query for an asset.
Multiple retrievals produce a nested
OR
term.Returns: the asset query Return type: osid.repository.AssetQuery
Raise: Unimplemented
–supports_avatar_query()
isfalse
compliance: optional – This method must be implemented if ``supports_avatar_query()`` is ``true``.
-
match_any_avatar
(match)¶ Matches resources with any asset.
Parameters: match ( boolean
) –true
to match any asset,false
to match resources with no assetcompliance: mandatory – This method must be implemented.
-
avatar_terms
¶
-
match_agent_id
(agent_id, match)¶ Sets the agent
Id
for this query.Parameters: - agent_id (
osid.id.Id
) – the agentId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–agent_id
isnull
compliance: mandatory – This method must be implemented.
- agent_id (
-
agent_id_terms
¶
-
supports_agent_query
()¶ Tests if an
AgentQuery
is available.Returns: true
if an agent query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
agent_query
¶ Gets the query for an agent.
Multiple retrievals produce a nested
OR
term.Returns: the agent query Return type: osid.authentication.AgentQuery
Raise: Unimplemented
–supports_agent_query()
isfalse
compliance: optional – This method must be implemented if ``supports_agent_query()`` is ``true``.
-
match_any_agent
(match)¶ Matches resources with any agent.
Parameters: match ( boolean
) –true
to match any agent,false
to match resources with no agentcompliance: mandatory – This method must be implemented.
-
agent_terms
¶
-
match_resource_relationship_id
(resource_relationship_id, match)¶ Sets the resource relationship
Id
for this query.Parameters: - resource_relationship_id (
osid.id.Id
) – the resource relationshipId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–resource_relationship_id
isnull
compliance: mandatory – This method must be implemented.
- resource_relationship_id (
-
resource_relationship_id_terms
¶
-
supports_resource_relationship_query
()¶ Tests if a
ResourceRelationshipQuery
is available.Returns: true
if a resource relationship query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
resource_relationship_query
¶ Gets the query for aa resource relationship.
Multiple retrievals produce a nested
OR
term.Returns: the resource relationship query Return type: osid.resource.ResourceRelationshipQuery
Raise: Unimplemented
–supports_resource_relationship_query()
isfalse
compliance: optional – This method must be implemented if ``supports_resource_relationship_query()`` is ``true``.
-
match_any_resource_relationship
(match)¶ Matches resources with any resource relationship.
Parameters: match ( boolean
) –true
to match any resource relationship,false
to match resources with no relationshipcompliance: mandatory – This method must be implemented.
-
resource_relationship_terms
¶
-
match_bin_id
(bin_id, match)¶ Sets the bin
Id
for this query.Parameters: - bin_id (
osid.id.Id
) – the binId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–bin_id
isnull
compliance: mandatory – This method must be implemented.
- bin_id (
-
bin_id_terms
¶
-
supports_bin_query
()¶ Tests if a
BinQuery
is available.Returns: true
if a bin query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
bin_query
¶ Gets the query for a bin.
Multiple retrievals produce a nested
OR
term.Returns: the bin query Return type: osid.resource.BinQuery
Raise: Unimplemented
–supports_bin_query()
isfalse
compliance: optional – This method must be implemented if ``supports_bin_query()`` is ``true``.
-
bin_terms
¶
-
get_resource_query_record
(resource_record_type)¶ Gets the resource query record corresponding to the given
Resource
recordType
.Multiple retrievals produce a nested
OR
term.Parameters: resource_record_type ( osid.type.Type
) – a resource record typeReturns: the resource query record Return type: osid.resource.records.ResourceQueryRecord
Raise: NullArgument
–resource_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(resource_record_type)
isfalse
compliance: mandatory – This method must be implemented.
-
Bin Query¶
-
class
dlkit.resource.queries.
BinQuery
¶ Bases:
dlkit.osid.queries.OsidCatalogQuery
This is the query for searching bins.
Each method specifies an
AND
term while multiple invocations of the same method produce a nestedOR
.-
match_resource_id
(resource_id, match)¶ Sets the resource
Id
for this query.Parameters: - resource_id (
osid.id.Id
) – a resourceId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–resource_id
isnull
compliance: mandatory – This method must be implemented.
- resource_id (
-
resource_id_terms
¶
-
supports_resource_query
()¶ Tests if a
ResourceQuery
is available.Returns: true
if a resource query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
resource_query
¶ Gets the query for a resource.
Multiple retrievals produce a nested
OR
term.Returns: the resource query Return type: osid.resource.ResourceQuery
Raise: Unimplemented
–supports_resource_query()
isfalse
compliance: optional – This method must be implemented if ``supports_resource_query()`` is ``true``.
-
match_any_resource
(match)¶ Matches bins with any resource.
Parameters: match ( boolean
) –true
to match bins with any resource,false
to match bins with no resourcescompliance: mandatory – This method must be implemented.
-
resource_terms
¶
-
match_ancestor_bin_id
(binid, match)¶ Sets the bin
Id
for this query to match bins that have the specified bin as an ancestor.Parameters: - binid (
osid.id.Id
) – a binId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–bin_id
isnull
compliance: mandatory – This method must be implemented.
- binid (
-
ancestor_bin_id_terms
¶
-
supports_ancestor_bin_query
()¶ Tests if a
BinQuery
is available.Returns: true
if a bin query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
ancestor_bin_query
¶ Gets the query for a bin.
Multiple retrievals produce a nested
OR
term.Returns: the bin query Return type: osid.resource.BinQuery
Raise: Unimplemented
–supports_ancestor_bin_query()
isfalse
compliance: optional – This method must be implemented if ``supports_ancestor_bin_query()`` is ``true``.
-
match_any_ancestor_bin
(match)¶ Matches bins with any ancestor.
Parameters: match ( boolean
) –true
to match bins with any ancestor,false
to match root binscompliance: mandatory – This method must be implemented.
-
ancestor_bin_terms
¶
-
match_descendant_bin_id
(binid, match)¶ Sets the bin
Id
for this query to match bins that have the specified bin as a descendant.Parameters: - binid (
osid.id.Id
) – a binId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–bin_id
isnull
compliance: mandatory – This method must be implemented.
- binid (
-
descendant_bin_id_terms
¶
-
supports_descendant_bin_query
()¶ Tests if a
BinQuery
is available.Returns: true
if a bin query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
descendant_bin_query
¶ Gets the query for a bin.
Multiple retrievals produce a nested
OR
term.Returns: the bin query Return type: osid.resource.BinQuery
Raise: Unimplemented
–supports_descendant_bin_query()
isfalse
compliance: optional – This method must be implemented if ``supports_descendant_bin_query()`` is ``true``.
-
match_any_descendant_bin
(match)¶ Matches bins with any descendant.
Parameters: match ( boolean
) –true
to match bins with any descendant,false
to match leaf binscompliance: mandatory – This method must be implemented.
-
descendant_bin_terms
¶
-
get_bin_query_record
(bin_record_type)¶ Gets the bin query record corresponding to the given
Bin
recordType
.Multiple retrievals produce a nested
OR
term.Parameters: bin_record_type ( osid.type.Type
) – a bin record typeReturns: the bin query record Return type: osid.resource.records.BinQueryRecord
Raise: NullArgument
–bin_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(bin_record_type)
isfalse
compliance: mandatory – This method must be implemented.
-