Skip to content

Commit

Permalink
premisrw: add PREMIS v2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sevein committed Dec 5, 2018
1 parent b6ce1b0 commit dfc5dca
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions metsrw/plugins/premisrw/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
)
from .utils import (
XSI_NAMESPACE,
PREMIS_2_1_VERSION,
PREMIS_2_1_NAMESPACE,
PREMIS_2_1_XSD,
PREMIS_2_1_SCHEMA_LOCATION,
PREMIS_2_1_NAMESPACES,
PREMIS_2_1_META,
PREMIS_2_2_VERSION,
PREMIS_2_2_NAMESPACE,
PREMIS_2_2_XSD,
Expand Down Expand Up @@ -48,6 +54,9 @@
__all__ = ['PREMISElement', 'PREMISObject', 'PREMISEvent', 'PREMISAgent',
'data_to_premis', 'premis_to_data', 'data_find', 'data_find_all',
'data_find_text', 'data_find_text_or_all', 'XSI_NAMESPACE',
'PREMIS_2_1_VERSION', 'PREMIS_2_1_NAMESPACE', 'PREMIS_2_1_XSD',
'PREMIS_2_1_SCHEMA_LOCATION', 'PREMIS_2_1_NAMESPACES',
'PREMIS_2_1_META',
'PREMIS_2_2_VERSION', 'PREMIS_2_2_NAMESPACE', 'PREMIS_2_2_XSD',
'PREMIS_2_2_SCHEMA_LOCATION', 'PREMIS_2_2_NAMESPACES',
'PREMIS_2_2_META', 'PREMIS_3_0_VERSION', 'PREMIS_3_0_NAMESPACE',
Expand Down
19 changes: 19 additions & 0 deletions metsrw/plugins/premisrw/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@

XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance'

# PREMIS v. 2.1
PREMIS_2_1_VERSION = '2.1'
PREMIS_2_1_NAMESPACE = 'info:lc/xmlns/premis-v1'
PREMIS_2_1_XSD = 'http://www.loc.gov/standards/premis/v2/premis-v2-1.xsd'
PREMIS_2_1_SCHEMA_LOCATION = '{} {}'.format(
PREMIS_2_1_NAMESPACE, PREMIS_2_1_XSD)
PREMIS_2_1_NAMESPACES = {
'premis': PREMIS_2_1_NAMESPACE,
'xsi': XSI_NAMESPACE
}
PREMIS_2_1_META = {
'xsi:schema_location': PREMIS_2_1_SCHEMA_LOCATION,
'version': PREMIS_2_1_VERSION
}

# PREMIS v. 2.2
PREMIS_2_2_VERSION = '2.2'
PREMIS_2_2_NAMESPACE = 'info:lc/xmlns/premis-v2'
Expand Down Expand Up @@ -34,6 +49,10 @@
}

PREMIS_VERSIONS_MAP = {
PREMIS_2_1_VERSION: {
'namespaces': PREMIS_2_2_NAMESPACES,
'meta': PREMIS_2_1_META
},
PREMIS_2_2_VERSION: {
'namespaces': PREMIS_2_2_NAMESPACES,
'meta': PREMIS_2_2_META
Expand Down

0 comments on commit dfc5dca

Please sign in to comment.