Objects¶
Asset¶
-
class
dlkit.repository.objects.Asset¶ Bases:
dlkit.osid.objects.OsidObject,dlkit.osid.markers.Aggregateable,dlkit.osid.markers.SourceableAn
Assetrepresents some digital content.Example assets might be a text document, an image, or a movie. The content data, and metadata related directly to the content format and quality, is accessed through
AssetContent. Assets, like allOsidObjects,include a type a record to qualify theAssetand include additional data. The division between theAssetTypeandAssetContentis to separate data describing the asset from data describing the format of the contents, allowing a consumer to select among multiple formats, sizes or levels of fidelity.An example is a photograph of the Bay Bridge. The content may deliver a JPEG in multiple resolutions where the
AssetContentmay also desribe size or compression factor for each one. The content may also include an uncompressed TIFF version. TheAssetTypemay be “photograph” indicating that the photo itself is the asset managed in this repository.Since an Asset may have multiple
AssetContentstructures, the decision of how many things to stuff inside a single asset comes down to if the content is actually a different format, or size, or quality, falling under the same creator, copyright, publisher and distribution rights as the original. This may, in some cases, provide a means to implement some accessibility, it doesn’t handle the case where, to meet an accessibility requirement, one asset needs to be substituted for another. The Repository OSID manages this aspect outside the scope of the coreAssetdefinition.Assetsmap toAssetSubjects.AssetSubjectsareOsidObjectsthat capture a subject matter. In the above example, anAssetSubjectmay be defined for the Bay Bridge and include data describing the bridge. The single subject can map to multiple assets depicting the bridge providing a single entry for a search and a single place to describe a bridge. Bridges, as physical items, may also be described using the Resource OSID in which case the use of theAssetSubjectacts as a cover for the underlyingResourceto assist repository-only consumers.The
Assetdefinition includes some basic copyright and related licensing information to assist in finding free-to-use content, or to convey the distribution restrictions that may be placed on the asset. Generally, if no data is available it is to be assumed that all rights are reserved.A publisher is applicable if the content of this
Assethas been published. Not allAssetsin thisRepositorymay have a published status and such a status may effect the applicability of copyright law. To trace the source of anAsset,both a provider and source are defined. The provider indicates where this repository acquired the asset and the source indicates the original provider or copyright owner. In the case of a published asset, the source is the publisher.Assetsalso define methods to facilitate searches over time and space as it relates to the subject matter. This may at times be redundant with theAssetSubject. In the case of the Bay Bridge photograph, the temporal coverage may include 1936, when it opened, and/or indicate when the photo was taken to capture a current event of the bridge. The decision largeley depends on what desired effect is from a search. The spatial coverage may describe the gps coordinates of the bridge or describe the spatial area encompassed in the view. In either case, a “photograph” type may unambiguously defined methods to describe the exact time the photograph was taken and the location of the photographer.The core Asset defines methods to perform general searches and construct bibliographic entries without knowledge of a particular
AssetorAssetContentrecordType.-
title¶ Gets the proper title of this asset.
This may be the same as the display name or the display name may be used for a less formal label.
Returns: the title of this asset Return type: osid.locale.DisplayText
-
is_copyright_status_known()¶ Tests if the copyright status is known.
return: trueif the copyright status of this asset is known,falseotherwise. Iffalse, is_public_domain(),``can_distribute_verbatim(), can_distribute_alterations() and- can_distribute_compositions()`` may also be
false. rtype: boolean
- can_distribute_compositions()`` may also be
-
is_public_domain()¶ Tests if this asset is in the public domain.
An asset is in the public domain if copyright is not applicable, the copyright has expired, or the copyright owner has expressly relinquished the copyright.
Returns: trueif this asset is in the public domain,falseotherwise. Iftrue,can_distribute_verbatim(), can_distribute_alterations() and can_distribute_compositions()must also betrue.Return type: booleanRaise: IllegalState–is_copyright_status_known()isfalse
-
copyright_registration¶ Gets the copyright registration information for this asset.
Returns: the copyright registration. An empty string means the registration status isn’t known. Return type: stringRaise: IllegalState–is_copyright_status_known()isfalse
-
can_distribute_verbatim()¶ Tests if there are any license restrictions on this asset that restrict the distribution, re-publication or public display of this asset, commercial or otherwise, without modification, alteration, or inclusion in other works.
This method is intended to offer consumers a means of filtering out search results that restrict distribution for any purpose. The scope of this method does not include licensing that describes warranty disclaimers or attribution requirements. This method is intended for informational purposes only and does not replace or override the terms specified in a license agreement which may specify exceptions or additional restrictions.
Returns: trueif the asset can be distributed verbatim,falseotherwise.Return type: booleanRaise: IllegalState–is_copyright_status_known()isfalse
-
can_distribute_alterations()¶ Tests if there are any license restrictions on this asset that restrict the distribution, re-publication or public display of any alterations or modifications to this asset, commercial or otherwise, for any purpose.
This method is intended to offer consumers a means of filtering out search results that restrict the distribution or public display of any modification or alteration of the content or its metadata of any kind, including editing, translation, resampling, resizing and cropping. The scope of this method does not include licensing that describes warranty disclaimers or attribution requirements. This method is intended for informational purposes only and does not replace or override the terms specified in a license agreement which may specify exceptions or additional restrictions.
Returns: trueif the asset can be modified,falseotherwise. Iftrue,can_distribute_verbatim()must also betrue.Return type: booleanRaise: IllegalState–is_copyright_status_known()isfalse
-
can_distribute_compositions()¶ Tests if there are any license restrictions on this asset that restrict the distribution, re-publication or public display of this asset as an inclusion within other content or composition, commercial or otherwise, for any purpose, including restrictions upon the distribution or license of the resulting composition.
This method is intended to offer consumers a means of filtering out search results that restrict the use of this asset within compositions. The scope of this method does not include licensing that describes warranty disclaimers or attribution requirements. This method is intended for informational purposes only and does not replace or override the terms specified in a license agreement which may specify exceptions or additional restrictions.
Returns: trueif the asset can be part of a larger compositionfalseotherwise. Iftrue,can_distribute_verbatim()must also betrue.Return type: booleanRaise: IllegalState–is_copyright_status_known()isfalse
-
source_id¶ Gets the
Resource Idof the source of this asset.The source is the original owner of the copyright of this asset and may differ from the creator of this asset. The source for a published book written by Margaret Mitchell would be Macmillan. The source for an unpublished painting by Arthur Goodwin would be Arthur Goodwin.
An
AssetisSourceableand also contains a provider identity. The provider is the entity that makes this digital asset available in this repository but may or may not be the publisher of the contents depicted in the asset. For example, a map published by Ticknor and Fields in 1848 may have a provider of Library of Congress and a source of Ticknor and Fields. If copied from a repository at Middlebury College, the provider would be Middlebury College and a source of Ticknor and Fields.Returns: the source IdReturn type: osid.id.Id
-
source¶ Gets the
Resourceof the source of this asset.The source is the original owner of the copyright of this asset and may differ from the creator of this asset. The source for a published book written by Margaret Mitchell would be Macmillan. The source for an unpublished painting by Arthur Goodwin would be Arthur Goodwin.
Returns: the source Return type: osid.resource.Resource
-
provider_link_ids¶ Gets the resource
Idsrepresenting the source of this asset in order from the most recent provider to the originating source.Returns: the provider IdsReturn type: osid.id.IdList
-
provider_links¶ Gets the
Resourcesrepresenting the source of this asset in order from the most recent provider to the originating source.Returns: the provider chain Return type: osid.resource.ResourceListRaise: OperationFailed– unable to complete request
-
created_date¶ Gets the created date of this asset, which is generally not related to when the object representing the asset was created.
The date returned may indicate that not much is known.
Returns: the created date Return type: osid.calendaring.DateTime
-
is_published()¶ Tests if this asset has been published.
Not all assets viewable in this repository may have been published. The source of a published asset indicates the publisher.
Returns: true if this asset has been published, falseif unpublished or its published status is not knownReturn type: boolean
-
published_date¶ Gets the published date of this asset.
Unpublished assets have no published date. A published asset has a date available, however the date returned may indicate that not much is known.
Returns: the published date Return type: osid.calendaring.DateTimeRaise: IllegalState–is_published()isfalse
-
principal_credit_string¶ Gets the credits of the principal people involved in the production of this asset as a display string.
Returns: the principal credits Return type: osid.locale.DisplayText
-
asset_content_ids¶ Gets the content
Idsof this asset.Returns: the asset content IdsReturn type: osid.id.IdList
-
asset_contents¶ Gets the content of this asset.
Returns: the asset contents Return type: osid.repository.AssetContentListRaise: OperationFailed– unable to complete request
-
is_composition()¶ Tetss if this asset is a representation of a composition of assets.
Returns: true if this asset is a composition, falseotherwiseReturn type: boolean
-
composition_id¶ Gets the
CompositionIdcorresponding to this asset.Returns: the composiiton IdReturn type: osid.id.IdRaise: IllegalState–is_composition()isfalse
-
composition¶ Gets the Composition corresponding to this asset.
Returns: the composiiton Return type: osid.repository.CompositionRaise: IllegalState–is_composition()isfalseRaise: OperationFailed– unable to complete request
-
get_asset_record(asset_record_type)¶ Gets the asset record corresponding to the given
AssetrecordType.This method is used to retrieve an object implementing the requested record. The
asset_record_typemay be theTypereturned inget_record_types()or any of its parents in aTypehierarchy wherehas_record_type(asset_record_type)istrue.Parameters: asset_record_type ( osid.type.Type) – an asset record typeReturns: the asset record Return type: osid.repository.records.AssetRecordRaise: NullArgument–asset_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: Unsupported–has_record_type(asset_record_type)isfalse
-
Asset Form¶
-
class
dlkit.repository.objects.AssetForm¶ Bases:
dlkit.osid.objects.OsidObjectForm,dlkit.osid.objects.OsidAggregateableForm,dlkit.osid.objects.OsidSourceableFormThis is the form for creating and updating
Assets.Like all
OsidFormobjects, various data elements may be set here for use in the create and update methods in theAssetAdminSession. For each data element that may be set, metadata may be examined to provide display hints or data constraints.-
title_metadata¶ Gets the metadata for an asset title.
Returns: metadata for the title Return type: osid.Metadata
-
title¶ Sets the title.
Parameters: title ( string) – the new titleRaise: InvalidArgument–titleis invalidRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NullArgument–titleisnull
-
public_domain_metadata¶ Gets the metadata for the public domain flag.
Returns: metadata for the public domain Return type: osid.Metadata
-
public_domain¶ Sets the public domain flag.
Parameters: public_domain ( boolean) – the public domain statusRaise: NoAccess–Metadata.isReadOnly()istrue
-
copyright_metadata¶ Gets the metadata for the copyright.
Returns: metadata for the copyright Return type: osid.Metadata
-
copyright_registration_metadata¶ Gets the metadata for the copyright registration.
Returns: metadata for the copyright registration Return type: osid.Metadata
-
copyright_registration¶ Sets the copyright registration.
Parameters: registration ( string) – the new copyright registrationRaise: InvalidArgument–copyrightis invalidRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NullArgument–copyrightisnull
-
distribute_verbatim_metadata¶ Gets the metadata for the distribute verbatim rights flag.
Returns: metadata for the distribution rights fields Return type: osid.Metadata
-
distribute_verbatim¶ Sets the distribution rights.
Parameters: distribute_verbatim ( boolean) – right to distribute verbatim copiesRaise: InvalidArgument–distribute_verbatimis invalidRaise: NoAccess– authorization failure
-
distribute_alterations_metadata¶ Gets the metadata for the distribute alterations rights flag.
Returns: metadata for the distribution rights fields Return type: osid.Metadata
-
distribute_alterations¶ Sets the distribute alterations flag.
This also sets distribute verbatim to
true.Parameters: distribute_mods ( boolean) – right to distribute modificationsRaise: InvalidArgument–distribute_modsis invalidRaise: NoAccess– authorization failure
-
distribute_compositions_metadata¶ Gets the metadata for the distribute compositions rights flag.
Returns: metadata for the distribution rights fields Return type: osid.Metadata
-
distribute_compositions¶ Sets the distribution rights.
This sets distribute verbatim to
true.Parameters: distribute_comps ( boolean) – right to distribute modificationsRaise: InvalidArgument–distribute_compsis invalidRaise: NoAccess– authorization failure
-
source_metadata¶ Gets the metadata for the source.
Returns: metadata for the source Return type: osid.Metadata
-
source¶ Sets the source.
Parameters: source_id ( osid.id.Id) – the new publisherRaise: InvalidArgument–source_idis invalidRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NullArgument–source_idisnull
-
provider_links_metadata¶ Gets the metadata for the provider chain.
Returns: metadata for the provider chain Return type: osid.Metadata
-
provider_links¶ Sets a provider chain in order from the most recent source to the originating source.
Parameters: resource_ids ( osid.id.Id[]) – the new sourceRaise: InvalidArgument–resource_idsis invalidRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NullArgument–resource_idsisnull
-
created_date_metadata¶ Gets the metadata for the asset creation date.
Returns: metadata for the created date Return type: osid.Metadata
-
created_date¶ Sets the created date.
Parameters: created_date ( osid.calendaring.DateTime) – the new created dateRaise: InvalidArgument–created_dateis invalidRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NullArgument–created_dateisnull
-
published_metadata¶ Gets the metadata for the published status.
Returns: metadata for the published field Return type: osid.Metadata
-
published¶ Sets the published status.
Parameters: published ( boolean) – the published statusRaise: NoAccess–Metadata.isReadOnly()istrue
-
published_date_metadata¶ Gets the metadata for the published date.
Returns: metadata for the published date Return type: osid.Metadata
-
published_date¶ Sets the published date.
Parameters: published_date ( osid.calendaring.DateTime) – the new published dateRaise: InvalidArgument–published_dateis invalidRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NullArgument–published_dateisnull
-
principal_credit_string_metadata¶ Gets the metadata for the principal credit string.
Returns: metadata for the credit string Return type: osid.Metadata
-
principal_credit_string¶ Sets the principal credit string.
Parameters: credit_string ( string) – the new credit stringRaise: InvalidArgument–credit_stringis invalidRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NullArgument–credit_stringisnull
-
composition_metadata¶ Gets the metadata for linking this asset to a composition.
Returns: metadata for the composition Return type: osid.Metadata
-
composition¶ Sets the composition.
Parameters: composition_id ( osid.id.Id) – a compositionRaise: InvalidArgument–composition_idis invalidRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NullArgument–composition_idisnull
-
get_asset_form_record(asset_record_type)¶ Gets the
AssetFormRecordcorresponding to the givenAssetrecordType.Parameters: asset_record_type ( osid.type.Type) – an asset record typeReturns: the asset form record Return type: osid.repository.records.AssetFormRecordRaise: NullArgument–asset_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: Unsupported–has_record_type(asset_record_type)isfalse
-
Asset List¶
-
class
dlkit.repository.objects.AssetList¶ Bases:
dlkit.osid.objects.OsidListLike all
OsidLists,AssetListprovides a means for accessingAssetelements sequentially either one at a time or many at a time.Examples: while (al.hasNext()) { Asset asset = al.getNextAsset(); }
- or
- while (al.hasNext()) {
- Asset[] assets = al.getNextAssets(al.available());
}
-
next_asset¶ Gets the next
Assetin this list.Returns: the next Assetin this list. Thehas_next()method should be used to test that a nextAssetis available before calling this method.Return type: osid.repository.AssetRaise: IllegalState– no more elements available in this listRaise: OperationFailed– unable to complete request
-
get_next_assets(n)¶ Gets the next set of
Assetsin this list which must be less than or equal to the return fromavailable().Parameters: n ( cardinal) – the number ofAssetelements requested which must be less than or equal toavailable()Returns: an array of Assetelements.The length of the array is less than or equal to the number specified.Return type: osid.repository.AssetRaise: IllegalState– no more elements available in this listRaise: OperationFailed– unable to complete request
Asset Content¶
-
class
dlkit.repository.objects.AssetContent¶ Bases:
dlkit.osid.objects.OsidObject,dlkit.osid.markers.SubjugateableAssetContentrepresents a version of content represented by anAsset.Although
AssetContentis a separateOsidObjectwith its ownIdto distuinguish it from other content inside anAsset, AssetContentcan only be accessed through anAsset.Once an
Assetis selected, multiple contents should be negotiated using the size, fidelity, accessibility requirements or application evnironment.-
asset_id¶ Gets the
Asset Idcorresponding to this content.Returns: the asset IdReturn type: osid.id.Id
-
asset¶ Gets the
Assetcorresponding to this content.Returns: the asset Return type: osid.repository.Asset
-
accessibility_types¶ Gets the accessibility types associated with this content.
Returns: list of content accessibility types Return type: osid.type.TypeList
-
has_data_length()¶ Tests if a data length is available.
Returns: trueif a length is available for this content,falseotherwise.Return type: boolean
-
data_length¶ Gets the length of the data represented by this content in bytes.
Returns: the length of the data stream Return type: cardinalRaise: IllegalState–has_data_length()isfalse
-
data¶ Gets the asset content data.
Returns: the length of the content data Return type: osid.transport.DataInputStreamRaise: OperationFailed– unable to complete request
-
has_url()¶ Tests if a URL is associated with this content.
Returns: trueif a URL is available,falseotherwiseReturn type: boolean
-
url¶ Gets the URL associated with this content for web-based retrieval.
Returns: the url for this data Return type: stringRaise: IllegalState–has_url()isfalse
-
get_asset_content_record(asset_content_content_record_type)¶ Gets the asset content record corresponding to the given
AssetContentrecordType.This method is used to retrieve an object implementing the requested record. The
asset_record_typemay be theTypereturned inget_record_types()or any of its parents in aTypehierarchy wherehas_record_type(asset_record_type)istrue.Parameters: asset_content_content_record_type ( osid.type.Type) – the type of the record to retrieveReturns: the asset content record Return type: osid.repository.records.AssetContentRecordRaise: NullArgument–asset_content_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: Unsupported–has_record_type(asset_content_record_type)isfalse
-
Asset Content Form¶
-
class
dlkit.repository.objects.AssetContentForm¶ Bases:
dlkit.osid.objects.OsidObjectForm,dlkit.osid.objects.OsidSubjugateableFormThis is the form for creating and updating content for
AssetContent.Like all
OsidFormobjects, various data elements may be set here for use in the create and update methods in theAssetAdminSession. For each data element that may be set, metadata may be examined to provide display hints or data constraints.-
accessibility_type_metadata¶ Gets the metadata for an accessibility type.
Returns: metadata for the accessibility types Return type: osid.Metadata
-
add_accessibility_type(accessibility_type)¶ Adds an accessibility type.
Multiple types can be added.
Parameters: accessibility_type ( osid.type.Type) – a new accessibility typeRaise: InvalidArgument–accessibility_typeis invalidRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NullArgument–accessibility_t_ypeisnull
-
remove_accessibility_type(accessibility_type)¶ Removes an accessibility type.
Parameters: accessibility_type ( osid.type.Type) – accessibility type to removeRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NotFound– acessibility type not foundRaise: NullArgument–accessibility_typeisnull
-
accessibility_types¶
-
data_metadata¶ Gets the metadata for the content data.
Returns: metadata for the content data Return type: osid.Metadata
-
data¶ Sets the content data.
Parameters: data ( osid.transport.DataInputStream) – the content dataRaise: InvalidArgument–datais invalidRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NullArgument–dataisnull
-
url_metadata¶ Gets the metadata for the url.
Returns: metadata for the url Return type: osid.Metadata
-
url¶ Sets the url.
Parameters: url ( string) – the new copyrightRaise: InvalidArgument–urlis invalidRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NullArgument–urlisnull
-
get_asset_content_form_record(asset_content_record_type)¶ Gets the
AssetContentFormRecordcorresponding to the given asset content recordType.Parameters: asset_content_record_type ( osid.type.Type) – an asset content record typeReturns: the asset content form record Return type: osid.repository.records.AssetContentFormRecordRaise: NullArgument–asset_content_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: Unsupported–has_record_type(asset_content_record_type)isfalse
-
Asset Content List¶
-
class
dlkit.repository.objects.AssetContentList¶ Bases:
dlkit.osid.objects.OsidListLike all
OsidLists,AssetContentListprovides a means for accessingAssetContentelements sequentially either one at a time or many at a time.Examples: while (acl.hasNext()) { AssetContent content = acl.getNextAssetContent(); }
- or
- while (acl.hasNext()) {
- AssetContent[] contents = acl.getNextAssetContents(acl.available());
}
-
next_asset_content¶ Gets the next
AssetContentin this list.Returns: the next AssetContentin this list. Thehas_next()method should be used to test that a nextAssetContentis available before calling this method.Return type: osid.repository.AssetContentRaise: IllegalState– no more elements available in this listRaise: OperationFailed– unable to complete request
-
get_next_asset_contents(n)¶ Gets the next set of
AssetContentsin this list which must be less than or equal to the return fromavailable().Parameters: n ( cardinal) – the number ofAssetContentelements requested which must be less than or equal toavailable()Returns: an array of AssetContentelements.The length of the array is less than or equal to the number specified.Return type: osid.repository.AssetContentRaise: IllegalState– no more elements available in this listRaise: OperationFailed– unable to complete request
Repository Form¶
-
class
dlkit.repository.objects.RepositoryForm¶ Bases:
dlkit.osid.objects.OsidCatalogFormThis is the form for creating and updating repositories.
Like all
OsidFormobjects, various data elements may be set here for use in the create and update methods in theRepositoryAdminSession. For each data element that may be set, metadata may be examined to provide display hints or data constraints.-
get_repository_form_record(repository_record_type)¶ Gets the
RepositoryFormRecordcorresponding to the given repository recordType.Parameters: repository_record_type ( osid.type.Type) – a repository record typeReturns: the repository form record Return type: osid.repository.records.RepositoryFormRecordRaise: NullArgument–repository_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: Unsupported–has_record_type(repository_record_type)isfalse
-
Repository List¶
-
class
dlkit.repository.objects.RepositoryList¶ Bases:
dlkit.osid.objects.OsidListLike all
OsidLists,RepositoryListprovides a means for accessingRepositoryelements sequentially either one at a time or many at a time.Examples: while (rl.hasNext()) { Repository repository = rl.getNextRepository(); }
- or
- while (rl.hasNext()) {
- Repository[] repositories = rl.getNextRepositories(rl.available());
}
-
next_repository¶ Gets the next
Repositoryin this list.Returns: the next Repositoryin this list. Thehas_next()method should be used to test that a nextRepositoryis available before calling this method.Return type: osid.repository.RepositoryRaise: IllegalState– no more elements available in this listRaise: OperationFailed– unable to complete request
-
get_next_repositories(n)¶ Gets the next set of
Repositoryelements in this list which must be less than or equal to the return fromavailable().Parameters: n ( cardinal) – the number ofRepositoryelements requested which must be less than or equal toavailable()Returns: an array of Repositoryelements.The length of the array is less than or equal to the number specified.Return type: osid.repository.RepositoryRaise: IllegalState– no more elements available in this listRaise: OperationFailed– unable to complete request