Queries

Authorization Query

class dlkit.authorization.queries.AuthorizationQuery

Bases: dlkit.osid.queries.OsidRelationshipQuery

The query for authorizations.

match_explicit_authorizations(match)

Matches explciit authorizations.

Parameters:match (boolean) – true to match explicit authorizations, false to match implciit authorizations

compliance: mandatory – This method must be implemented.

explicit_authorizations_terms

Adds an Id to match explicit or implicitly related authorizations depending on matchExplicitAuthorizations().

Multiple Ids can be added to perform a boolean OR among them.

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

NullArgumentid is null

compliance: mandatory – This method must be implemented.

related_authorization_id_terms

Tests if an AuthorizationQuery is available.

Returns:true if an authorization query is available, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

Gets the authorization query.

Parameters:match (boolean) – true if a positive match, false for a negative match
Returns:the AuthorizationQuery
Return type:osid.authorization.AuthorizationQuery
Raise:Unimplementedsupports_related_authorization_query() is false

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

related_authorization_terms
match_resource_id(resource_id, match)

Matches the resource identified by the given Id.

Parameters:
  • resource_id (osid.id.Id) – the Id of the Resource
  • match (boolean) – true if a positive match, false for a negative match
Raise:

NullArgumentresource_id is null

compliance: mandatory – This method must be implemented.

resource_id_terms
supports_resource_query()

Tests if a ResourceQuery is available.

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

compliance: mandatory – This method must be implemented.

get_resource_query(match)

Gets the resource query.

Parameters:match (boolean) – true if a positive match, false for a negative match
Returns:the ResourceQuery
Return type:osid.resource.ResourceQuery
Raise:Unimplementedsupports_resource_query() is false

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

match_any_resource(match)

Matches authorizations that have any resource.

Parameters:match (boolean) – true to match authorizations with any resource, false to match authorizations with no resource

compliance: mandatory – This method must be implemented.

resource_terms
match_trust_id(trust_id, match)

Matches the trust identified by the given Id.

Parameters:
  • trust_id (osid.id.Id) – the Id of the Trust
  • match (boolean) – true if a positive match, false for a negative match
Raise:

NullArgumenttrust_id is null

compliance: mandatory – This method must be implemented.

match_any_trust_id(match)

Matches authorizations that have any trust defined.

Parameters:match (boolean) – true to match authorizations with any trust, false to match authorizations with no trusts

compliance: mandatory – This method must be implemented.

trust_id_terms
match_agent_id(agent_id, match)

Matches the agent identified by the given Id.

Parameters:
  • agent_id (osid.id.Id) – the Id of the Agent
  • match (boolean) – true if a positive match, false for a negative match
Raise:

NullArgumentagent_id is null

compliance: mandatory – This method must be implemented.

agent_id_terms
supports_agent_query()

Tests if an AgentQuery is available.

Returns:true if an agent query is available, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

get_agent_query(match)

Gets the agent query.

Parameters:match (boolean) – true if a positive match, false for a negative match
Returns:the AgentQuery
Return type:osid.authentication.AgentQuery
Raise:Unimplementedsupports_agent_query() is false

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

match_any_agent(match)

Matches authorizations that have any agent.

Parameters:match (boolean) – true to match authorizations with any agent, false to match authorizations with no agent

compliance: mandatory – This method must be implemented.

agent_terms
match_function_id(function_id, match)

Matches the function identified by the given Id.

Parameters:
  • function_id (osid.id.Id) – the Id of the Function
  • match (boolean) – true if a positive match, false for a negative match
Raise:

NullArgumentfunction_id is null

compliance: mandatory – This method must be implemented.

function_id_terms
supports_function_query()

Tests if a FunctionQuery is available.

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

compliance: mandatory – This method must be implemented.

get_function_query(match)

Gets the function query.

Parameters:match (boolean) – true if a positive match, false for a negative match
Returns:the FunctinQuery
Return type:osid.authorization.FunctionQuery
Raise:Unimplementedsupports_function_query() is false

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

function_terms
match_qualifier_id(qualifier_id, match)

Matches the qualifier identified by the given Id.

Parameters:
  • qualifier_id (osid.id.Id) – the Id of the Qualifier
  • match (boolean) – true if a positive match, false for a negative match
Raise:

NullArgumentqualifier_id is null

compliance: mandatory – This method must be implemented.

qualifier_id_terms
supports_qualifier_query()

Tests if a QualifierQuery is available.

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

compliance: mandatory – This method must be implemented.

get_qualifier_query(match)

Gets the qualiier query.

Parameters:match (boolean) – true if a positive match, false for a negative match
Returns:the QualifierQuery
Return type:osid.authorization.QualifierQuery
Raise:Unimplementedsupports_qualifier_query() is false

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

qualifier_terms
match_vault_id(vault_id, match)

Sets the vault Id for this query.

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

NullArgumentvault_id is null

compliance: mandatory – This method must be implemented.

vault_id_terms
supports_vault_query()

Tests if a VaultQuery is available.

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

compliance: mandatory – This method must be implemented.

vault_query

Gets the query for a vault.

Multiple retrievals produce a nested OR term.

Returns:the vault query
Return type:osid.authorization.VaultQuery
Raise:Unimplementedsupports_vault_query() is false

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

vault_terms
get_authorization_query_record(authorization_record_type)

Gets the authorization query record corresponding to the given Authorization record Type.

Multiple retrievals produce a nested OR term.

Parameters:authorization_record_type (osid.type.Type) – an authorization record type
Returns:the authorization query record
Return type:osid.authorization.records.AuthorizationQueryRecord
Raise:NullArgumentauthorization_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(authorization_record_type) is false

compliance: mandatory – This method must be implemented.

Vault Query

class dlkit.authorization.queries.VaultQuery

Bases: dlkit.osid.queries.OsidCatalogQuery

This is the query for searching vaults.

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

match_function_id(function_id, match)

Sets the function Id for this query.

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

NullArgumentfunction_id is null

compliance: mandatory – This method must be implemented.

function_id_terms
supports_function_query()

Tests if a FunctionQuery is available.

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

compliance: mandatory – This method must be implemented.

function_query

Gets the query for a function.

Multiple retrievals produce a nested OR term.

Returns:the function query
Return type:osid.authorization.FunctionQuery
Raise:Unimplementedsupports_function_query() is false

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

match_any_function(match)

Matches vaults that have any function.

Parameters:match (boolean) – true to match vaults with any function mapping, false to match vaults with no function mapping

compliance: mandatory – This method must be implemented.

function_terms
match_qualifier_id(qualifier_id, match)

Sets the qualifier Id for this query.

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

NullArgumentqualifier_id is null

compliance: mandatory – This method must be implemented.

qualifier_id_terms
supports_qualifier_query()

Tests if a QualifierQuery is available.

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

compliance: mandatory – This method must be implemented.

qualifier_query

Gets the query for a qualifier.

Multiple retrievals produce a nested OR term.

Returns:the qualifier query
Return type:osid.authorization.QualifierQuery
Raise:Unimplementedsupports_qualifier_query() is false

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

match_any_qualifier(match)

Matches vaults that have any qualifier.

Parameters:match (boolean) – true to match vaults with any qualifier mapping, false to match vaults with no qualifier mapping

compliance: mandatory – This method must be implemented.

qualifier_terms
match_authorization_id(authorization_id, match)

Sets the authorization Id for this query.

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

NullArgumentauthorization_id is null

compliance: mandatory – This method must be implemented.

authorization_id_terms
supports_authorization_query()

Tests if an AuthorizationQuery is available.

Returns:true if an authorization query is available, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

authorization_query

Gets the query for an authorization.

Multiple retrievals produce a nested OR term.

Returns:the authorization query
Return type:osid.authorization.AuthorizationQuery
Raise:Unimplementedsupports_authorization_query() is false

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

match_any_authorization(match)

Matches vaults that have any authorization.

Parameters:match (boolean) – true to match vaults with any authorization mapping, false to match vaults with no authorization mapping

compliance: mandatory – This method must be implemented.

authorization_terms
match_ancestor_vault_id(vault_id, match)

Sets the vault Id for this query to match vaults that have the specified vault as an ancestor.

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

NullArgumentvault_id is null

compliance: mandatory – This method must be implemented.

ancestor_vault_id_terms
supports_ancestor_vault_query()

Tests if a VaultQuery is available.

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

compliance: mandatory – This method must be implemented.

ancestor_vault_query

Gets the query for a vault.

Multiple retrievals produce a nested OR term.

Returns:the vault query
Return type:osid.authorization.VaultQuery
Raise:Unimplementedsupports_ancestor_vault_query() is false

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

match_any_ancestor_vault(match)

Matches vaults that have any ancestor.

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

compliance: mandatory – This method must be implemented.

ancestor_vault_terms
match_descendant_vault_id(vault_id, match)

Sets the vault Id for this query to match vaults that have the specified vault as a descendant.

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

NullArgumentvault_id is null

compliance: mandatory – This method must be implemented.

descendant_vault_id_terms
supports_descendant_vault_query()

Tests if a VaultQuery is available.

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

compliance: mandatory – This method must be implemented.

descendant_vault_query

Gets the query for a vault.

Multiple retrievals produce a nested OR term.

Returns:the vault query
Return type:osid.authorization.VaultQuery
Raise:Unimplementedsupports_descendant_vault_query() is false

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

match_any_descendant_vault(match)

Matches vaults that have any descendant.

Parameters:match (boolean) – true to match vaults with any Ddscendant, false to match leaf vaults

compliance: mandatory – This method must be implemented.

descendant_vault_terms
get_vault_query_record(vault_record_type)

Gets the vault query record corresponding to the given Vault record Type.

Multiple record retrievals produce a nested OR term.

Parameters:vault_record_type (osid.type.Type) – a vault record type
Returns:the vault query record
Return type:osid.authorization.records.VaultQueryRecord
Raise:NullArgumentvault_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(vault_record_type) is false

compliance: mandatory – This method must be implemented.