Queries

Asset Query

class dlkit.repository.queries.AssetQuery

Bases: dlkit.osid.queries.OsidObjectQuery, dlkit.osid.queries.OsidAggregateableQuery, dlkit.osid.queries.OsidSourceableQuery

This is the query for searching assets.

Each method specifies an AND term while multiple invocations of the same method produce a nested OR. The query record is identified by the Asset Type.

match_title(title, string_match_type, match)

Adds a title for this query.

Parameters:
  • title (string) – title string to match
  • string_match_type (osid.type.Type) – the string match type
  • match (boolean) – true for a positive match, false for a negative match
Raise:

InvalidArgumenttitle not of string_match_type

Raise:

NullArgumenttitle or string_match_type is null

Raise:

Unsupportedsupports_string_match_type(string_match_type) is false

compliance: mandatory – This method must be implemented.

match_any_title(match)

Matches a title that has any value.

Parameters:match (boolean) – true to match assets with any title, false to match assets with no title

compliance: mandatory – This method must be implemented.

title_terms
match_public_domain(public_domain)

Matches assets marked as public domain.

Parameters:public_domain (boolean) – public domain flag

compliance: mandatory – This method must be implemented.

match_any_public_domain(match)

Matches assets with any public domain value.

Parameters:match (boolean) – true to match assets with any public domain value, false to match assets with no public domain value

compliance: mandatory – This method must be implemented.

public_domain_terms

Adds a copyright for this query.

Parameters:
  • copyright (string) – copyright string to match
  • string_match_type (osid.type.Type) – the string match type
  • match (boolean) – true for a positive match, false for a negative match
Raise:

InvalidArgumentcopyright not of string_match_type

Raise:

NullArgumentcopyright or string_match_type is null

Raise:

Unsupportedsupports_string_match_type(string_match_type) is false

compliance: mandatory – This method must be implemented.

Matches assets with any copyright statement.

Parameters:match (boolean) – true to match assets with any copyright value, false to match assets with no copyright value

compliance: mandatory – This method must be implemented.

copyright_terms

Adds a copyright registration for this query.

Parameters:
  • registration (string) – copyright registration string to match
  • string_match_type (osid.type.Type) – the string match type
  • match (boolean) – true for a positive match, false for a negative match
Raise:

InvalidArgumentregistration not of string_match_type

Raise:

NullArgumentregistration or string_match_type is null

Raise:

Unsupportedsupports_string_match_type(string_match_type) is false

compliance: mandatory – This method must be implemented.

Matches assets with any copyright registration.

Parameters:match (boolean) – true to match assets with any copyright registration value, false to match assets with no copyright registration value

compliance: mandatory – This method must be implemented.

copyright_registration_terms
match_distribute_verbatim(distributable)

Matches assets marked as distributable.

Parameters:distributable (boolean) – distribute verbatim rights flag

compliance: mandatory – This method must be implemented.

distribute_verbatim_terms
match_distribute_alterations(alterable)

Matches assets that whose alterations can be distributed.

Parameters:alterable (boolean) – distribute alterations rights flag

compliance: mandatory – This method must be implemented.

distribute_alterations_terms
match_distribute_compositions(composable)

Matches assets that can be distributed as part of other compositions.

Parameters:composable (boolean) – distribute compositions rights flag

compliance: mandatory – This method must be implemented.

distribute_compositions_terms
match_source_id(source_id, match)

Sets the source Id for this query.

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

NullArgumentsource_id is null

compliance: mandatory – This method must be implemented.

source_id_terms
supports_source_query()

Tests if a ResourceQuery is available for the source.

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

compliance: mandatory – This method must be implemented.

source_query

Gets the query for the source.

Multiple queries can be retrieved for a nested OR term.

Returns:the source query
Return type:osid.resource.ResourceQuery
Raise:Unimplementedsupports_source_query() is false

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

match_any_source(match)

Matches assets with any source.

Parameters:match (boolean) – true to match assets with any source, false to match assets with no sources

compliance: mandatory – This method must be implemented.

source_terms
match_created_date(start, end, match)

Match assets that are created between the specified time period.

Parameters:
  • start (osid.calendaring.DateTime) – start time of the query
  • end (osid.calendaring.DateTime) – end time of the query
  • match (boolean) – true for a positive match, false for a negative match
Raise:

InvalidArgumentend is les than start

Raise:

NullArgumentstart or end is null

compliance: mandatory – This method must be implemented.

match_any_created_date(match)

Matches assets with any creation time.

Parameters:match (boolean) – true to match assets with any created time, false to match assets with no cerated time

compliance: mandatory – This method must be implemented.

created_date_terms
match_published(published)

Marks assets that are marked as published.

Parameters:published (boolean) – published flag

compliance: mandatory – This method must be implemented.

published_terms
match_published_date(start, end, match)

Match assets that are published between the specified time period.

Parameters:
  • start (osid.calendaring.DateTime) – start time of the query
  • end (osid.calendaring.DateTime) – end time of the query
  • match (boolean) – true for a positive match, false for a negative match
Raise:

InvalidArgumentend is les than start

Raise:

NullArgumentstart or end is null

compliance: mandatory – This method must be implemented.

match_any_published_date(match)

Matches assets with any published time.

Parameters:match (boolean) – true to match assets with any published time, false to match assets with no published time

compliance: mandatory – This method must be implemented.

published_date_terms
match_principal_credit_string(credit, string_match_type, match)

Adds a principal credit string for this query.

Parameters:
  • credit (string) – credit string to match
  • string_match_type (osid.type.Type) – the string match type
  • match (boolean) – true for a positive match, false for a negative match
Raise:

InvalidArgumentcredit not of string_match_type

Raise:

NullArgumentcredit or string_match_type is null

Raise:

Unsupportedsupports_string_match_type(string_match_type) is false

compliance: mandatory – This method must be implemented.

match_any_principal_credit_string(match)

Matches a principal credit string that has any value.

Parameters:match (boolean) – true to match assets with any principal credit string, false to match assets with no principal credit string

compliance: mandatory – This method must be implemented.

principal_credit_string_terms
match_temporal_coverage(start, end, match)

Match assets that whose coverage falls between the specified time period inclusive.

Parameters:
  • start (osid.calendaring.DateTime) – start time of the query
  • end (osid.calendaring.DateTime) – end time of the query
  • match (boolean) – true for a positive match, false for a negative match
Raise:

InvalidArgumentend is less than start

Raise:

NullArgumentstart or end is null

compliance: mandatory – This method must be implemented.

match_any_temporal_coverage(match)

Matches assets with any temporal coverage.

Parameters:match (boolean) – true to match assets with any temporal coverage, false to match assets with no temporal coverage

compliance: mandatory – This method must be implemented.

temporal_coverage_terms
match_location_id(location_id, match)

Sets the location Id for this query of spatial coverage.

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

NullArgumentlocation_id is null

compliance: mandatory – This method must be implemented.

location_id_terms
supports_location_query()

Tests if a LocationQuery is available for the provider.

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

compliance: mandatory – This method must be implemented.

location_query

Gets the query for a location.

Multiple queries can be retrieved for a nested OR term.

Returns:the location query
Return type:osid.mapping.LocationQuery
Raise:Unimplementedsupports_location_query() is false

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

match_any_location(match)

Matches assets with any provider.

Parameters:match (boolean) – true to match assets with any location, false to match assets with no locations

compliance: mandatory – This method must be implemented.

location_terms
match_spatial_coverage(spatial_unit, match)

Matches assets that are contained within the given spatial unit.

Parameters:
  • spatial_unit (osid.mapping.SpatialUnit) – the spatial unit
  • match (boolean) – true for a positive match, false for a negative match
Raise:

NullArgumentspatial_unit is null

Raise:

Unsupportedspatial_unit is not suppoted

compliance: mandatory – This method must be implemented.

spatial_coverage_terms
match_spatial_coverage_overlap(spatial_unit, match)

Matches assets that overlap or touch the given spatial unit.

Parameters:
  • spatial_unit (osid.mapping.SpatialUnit) – the spatial unit
  • match (boolean) – true for a positive match, false for a negative match
Raise:

NullArgumentspatial_unit is null

Raise:

Unsupportedspatial_unit is not suppoted

compliance: mandatory – This method must be implemented.

match_any_spatial_coverage(match)

Matches assets with no spatial coverage.

Parameters:match (boolean) – true to match assets with any spatial coverage, false to match assets with no spatial coverage

compliance: mandatory – This method must be implemented.

spatial_coverage_overlap_terms
match_asset_content_id(asset_content_id, match)

Sets the asset content Id for this query.

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

NullArgumentasset_content_id is null

compliance: mandatory – This method must be implemented.

asset_content_id_terms
supports_asset_content_query()

Tests if an AssetContentQuery is available.

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

compliance: mandatory – This method must be implemented.

asset_content_query

Gets the query for the asset content.

Multiple queries can be retrieved for a nested OR term.

Returns:the asset contents query
Return type:osid.repository.AssetContentQuery
Raise:Unimplementedsupports_asset_content_query() is false

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

match_any_asset_content(match)

Matches assets with any content.

Parameters:match (boolean) – true to match assets with any content, false to match assets with no content

compliance: mandatory – This method must be implemented.

asset_content_terms
match_composition_id(composition_id, match)

Sets the composition Id for this query to match assets that are a part of the composition.

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

NullArgumentcomposition_id is null

compliance: mandatory – This method must be implemented.

composition_id_terms
supports_composition_query()

Tests if a CompositionQuery is available.

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

compliance: mandatory – This method must be implemented.

composition_query

Gets the query for a composition.

Multiple queries can be retrieved for a nested OR term.

Returns:the composition query
Return type:osid.repository.CompositionQuery
Raise:Unimplementedsupports_composition_query() is false

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

match_any_composition(match)

Matches assets with any composition mappings.

Parameters:match (boolean) – true to match assets with any composition, false to match assets with no composition mappings

compliance: mandatory – This method must be implemented.

composition_terms
match_repository_id(repository_id, match)

Sets the repository Id for this query.

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

NullArgumentrepository_id is null

compliance: mandatory – This method must be implemented.

repository_id_terms
supports_repository_query()

Tests if a RepositoryQuery is available.

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

compliance: mandatory – This method must be implemented.

repository_query

Gets the query for a repository.

Multiple queries can be retrieved for a nested OR term.

Returns:the repository query
Return type:osid.repository.RepositoryQuery
Raise:Unimplementedsupports_repository_query() is false

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

repository_terms
get_asset_query_record(asset_record_type)

Gets the asset query record corresponding to the given Asset record Type.

Multiuple retrievals produce a nested OR term.

Parameters:asset_record_type (osid.type.Type) – an asset record type
Returns:the asset query record
Return type:osid.repository.records.AssetQueryRecord
Raise:NullArgumentasset_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(asset_record_type) is false

compliance: mandatory – This method must be implemented.

Asset Content Query

class dlkit.repository.queries.AssetContentQuery

Bases: dlkit.osid.queries.OsidObjectQuery, dlkit.osid.queries.OsidSubjugateableQuery

This is the query for searching asset contents.

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

match_accessibility_type(accessibility_type, match)

Sets the accessibility types for this query.

Supplying multiple types behaves like a boolean OR among the elements.

Parameters:
  • accessibility_type (osid.type.Type) – an accessibilityType
  • match (boolean) – true for a positive match, false for a negative match
Raise:

NullArgumentaccessibility_type is null

compliance: mandatory – This method must be implemented.

match_any_accessibility_type(match)

Matches asset content that has any accessibility type.

Parameters:match (boolean) – true to match content with any accessibility type, false to match content with no accessibility type

compliance: mandatory – This method must be implemented.

accessibility_type_terms
match_data_length(low, high, match)

Matches content whose length of the data in bytes are inclusive of the given range.

Parameters:
  • low (cardinal) – low range
  • high (cardinal) – high range
  • match (boolean) – true for a positive match, false for a negative match
Raise:

InvalidArgumentlow is greater than high

compliance: mandatory – This method must be implemented.

match_any_data_length(match)

Matches content that has any data length.

Parameters:match (boolean) – true to match content with any data length, false to match content with no data length

compliance: mandatory – This method must be implemented.

data_length_terms
match_data(data, match, partial)

Matches data in this content.

Parameters:
  • data (byte[]) – list of matching strings
  • match (boolean) – true for a positive match, false for a negative match
  • partial (boolean) – true for a partial match, false for a complete match
Raise:

NullArgumentdata is null

compliance: mandatory – This method must be implemented.

match_any_data(match)

Matches content that has any data.

Parameters:match (boolean) – true to match content with any data, false to match content with no data

compliance: mandatory – This method must be implemented.

data_terms
match_url(url, string_match_type, match)

Sets the url for this query.

Supplying multiple strings behaves like a boolean OR among the elements each which must correspond to the stringMatchType.

Parameters:
  • url (string) – url string to match
  • string_match_type (osid.type.Type) – the string match type
  • match (boolean) – true for a positive match, false for a negative match
Raise:

InvalidArgumenturl not of string_match_type

Raise:

NullArgumenturl or string_match_type is null

Raise:

Unsupportedsupports_string_match_type(url) is false

compliance: mandatory – This method must be implemented.

match_any_url(match)

Matches content that has any url.

Parameters:match (boolean) – true to match content with any url, false to match content with no url

compliance: mandatory – This method must be implemented.

url_terms
get_asset_content_query_record(asset_content_record_type)

Gets the asset content query record corresponding to the given AssetContent record Type.

Multiple record retrievals produce a nested OR term.

Parameters:asset_content_record_type (osid.type.Type) – an asset content record type
Returns:the asset content query record
Return type:osid.repository.records.AssetContentQueryRecord
Raise:NullArgumentasset_content_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(asset_content_record_type) is false

compliance: mandatory – This method must be implemented.

Composition Query

class dlkit.repository.queries.CompositionQuery

Bases: dlkit.osid.queries.OsidObjectQuery, dlkit.osid.queries.OsidContainableQuery, dlkit.osid.queries.OsidOperableQuery, dlkit.osid.queries.OsidSourceableQuery

This is the query for searching compositions.

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

match_asset_id(asset_id, match)

Sets the asset Id for this query.

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

NullArgumentasset_id is null

compliance: mandatory – This method must be implemented.

asset_id_terms
supports_asset_query()

Tests if an AssetQuery is available.

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

compliance: mandatory – This method must be implemented.

asset_query

Gets the query for an asset.

Multiple retrievals produce a nested OR term.

Returns:the asset query
Return type:osid.repository.AssetQuery
Raise:Unimplementedsupports_asset_query() is false

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

match_any_asset(match)

Matches compositions that has any asset mapping.

Parameters:match (boolean) – true to match compositions with any asset, false to match compositions with no asset

compliance: mandatory – This method must be implemented.

asset_terms
match_containing_composition_id(composition_id, match)

Sets the composition Id for this query to match compositions that have the specified composition as an ancestor.

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

NullArgumentcomposition_id is null

compliance: mandatory – This method must be implemented.

containing_composition_id_terms
supports_containing_composition_query()

Tests if an CompositionQuery is available.

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

compliance: mandatory – This method must be implemented.

containing_composition_query

Gets the query for a composition.

Multiple retrievals produce a nested OR term.

Returns:the composition query
Return type:osid.repository.CompositionQuery
Raise:Unimplementedsupports_containing_composition_query() is false

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

match_any_containing_composition(match)

Matches compositions with any ancestor.

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

compliance: mandatory – This method must be implemented.

containing_composition_terms
match_contained_composition_id(composition_id, match)

Sets the composition Id for this query to match compositions that contain the specified composition.

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

NullArgumentcomposition_id is null

compliance: mandatory – This method must be implemented.

contained_composition_id_terms
supports_contained_composition_query()

Tests if an CompositionQuery is available.

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

compliance: mandatory – This method must be implemented.

contained_composition_query

Gets the query for a composition.

Multiple retrievals produce a nested OR term.

Returns:the composition query
Return type:osid.repository.CompositionQuery
Raise:Unimplementedsupports_contained_composition_query() is false

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

match_any_contained_composition(match)

Matches compositions that contain any other compositions.

Parameters:match (boolean) – true to match composition with any descendant, false to match leaf compositions

compliance: mandatory – This method must be implemented.

contained_composition_terms
match_repository_id(repository_id, match)

Sets the repository Id for this query.

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

NullArgumentrepository_id is null

compliance: mandatory – This method must be implemented.

repository_id_terms
supports_repository_query()

Tests if a RepositoryQuery is available.

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

compliance: mandatory – This method must be implemented.

repository_query

Gets the query for a repository.

Multiple queries can be retrieved for a nested OR term.

Returns:the repository query
Return type:osid.repository.RepositoryQuery
Raise:Unimplementedsupports_repository_query() is false

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

repository_terms
get_composition_query_record(composition_record_type)

Gets the composition query record corresponding to the given Composition record Type.

Multiple retrievals produce a nested OR term.

Parameters:composition_record_type (osid.type.Type) – a composition record type
Returns:the composition query record
Return type:osid.repository.records.CompositionQueryRecord
Raise:NullArgumentcomposition_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(composition_record_type) is false

compliance: mandatory – This method must be implemented.

Repository Query

class dlkit.repository.queries.RepositoryQuery

Bases: dlkit.osid.queries.OsidCatalogQuery

This is the query for searching repositories.

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

match_asset_id(asset_id, match)

Sets the asset Id for this query.

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

NullArgumentasset_id is null

compliance: mandatory – This method must be implemented.

asset_id_terms
supports_asset_query()

Tests if an AssetQuery is available.

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

compliance: mandatory – This method must be implemented.

asset_query

Gets the query for an asset.

Multiple retrievals produce a nested OR term.

Returns:the asset query
Return type:osid.repository.AssetQuery
Raise:Unimplementedsupports_asset_query() is false

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

match_any_asset(match)

Matches repositories that has any asset mapping.

Parameters:match (boolean) – true to match repositories with any asset, false to match repositories with no asset

compliance: mandatory – This method must be implemented.

asset_terms
match_composition_id(composition_id, match)

Sets the composition Id for this query.

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

NullArgumentcomposition_id is null

compliance: mandatory – This method must be implemented.

composition_id_terms
supports_composition_query()

Tests if a CompositionQuery is available.

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

compliance: mandatory – This method must be implemented.

composition_query

Gets the query for a composition.

Multiple retrievals produce a nested OR term.

Returns:the composition query
Return type:osid.repository.CompositionQuery
Raise:Unimplementedsupports_composition_query() is false

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

match_any_composition(match)

Matches repositories that has any composition mapping.

Parameters:match (boolean) – true to match repositories with any composition, false to match repositories with no composition

compliance: mandatory – This method must be implemented.

composition_terms
match_ancestor_repository_id(repository_id, match)

Sets the repository Id for this query to match repositories that have the specified repository as an ancestor.

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

NullArgumentrepository_id is null

compliance: mandatory – This method must be implemented.

ancestor_repository_id_terms
supports_ancestor_repository_query()

Tests if a RepositoryQuery is available.

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

compliance: mandatory – This method must be implemented.

ancestor_repository_query

Gets the query for a repository.

Multiple retrievals produce a nested OR term.

Returns:the repository query
Return type:osid.repository.RepositoryQuery
Raise:Unimplementedsupports_ancestor_repository_query() is false

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

match_any_ancestor_repository(match)

Matches repositories with any ancestor.

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

compliance: mandatory – This method must be implemented.

ancestor_repository_terms
match_descendant_repository_id(repository_id, match)

Sets the repository Id for this query to match repositories that have the specified repository as a descendant.

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

NullArgumentrepository_id is null

compliance: mandatory – This method must be implemented.

descendant_repository_id_terms
supports_descendant_repository_query()

Tests if a RepositoryQuery is available.

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

compliance: mandatory – This method must be implemented.

descendant_repository_query

Gets the query for a repository.

Multiple retrievals produce a nested OR term.

Returns:the repository query
Return type:osid.repository.RepositoryQuery
Raise:Unimplementedsupports_descendant_repository_query() is false

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

match_any_descendant_repository(match)

Matches repositories with any descendant.

Parameters:match (boolean) – true to match repositories with any descendant, false to match leaf repositories

compliance: mandatory – This method must be implemented.

descendant_repository_terms
get_repository_query_record(repository_record_type)

Gets the repository query record corresponding to the given Repository record Type.

Multiple record retrievals produce a nested OR term.

Parameters:repository_record_type (osid.type.Type) – a repository record type
Returns:the repository query record
Return type:osid.repository.records.RepositoryQueryRecord
Raise:NullArgumentrepository_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(repository_record_type) is false

compliance: mandatory – This method must be implemented.