Skip to content

Commit

Permalink
Data integrity bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dharvey-consbio committed Oct 19, 2016
1 parent 512a85c commit e5a7cd4
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 95 deletions.
2 changes: 1 addition & 1 deletion gis_metadata/fgdc_metadata_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _init_data_map(self):
specification=df_format.format(df_path='digtinfo/formspec'),
access_desc=df_format.format(df_path='digtopt/onlinopt/oncomp'),
access_instrs=df_format.format(df_path='digtopt/onlinopt/accinstr'),
network_resource=df_format.format(df_path='digtopt/onlineopt/computer/networka/networkr')
network_resource=df_format.format(df_path='digtopt/onlinopt/computer/networka/networkr')
)

lw_format = _fgdc_tag_formats[LARGER_WORKS]
Expand Down
10 changes: 6 additions & 4 deletions gis_metadata/iso_metadata_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,16 @@
'_attribute_accuracy_root': '{_dataqual_report}',
'_attributes_root': 'featureType/FC_FeatureType/carrierOfCharacteristics',
'_bounding_box_root': '{_idinfo_extent}/geographicElement',
'_contacts_root': '{_idinfo_resp}',
'_contacts_root': '{_idinfo}/pointOfContact',
'_dataset_completeness_root': '{_dataqual_report}',
'_dates_root': '{_idinfo_extent}/temporalElement',
'_digital_forms_root': '{_distinfo}/distributionFormat',
'_transfer_options_root': '{_distinfo}/transferOptions',
'_dist_liability_root': '{_idinfo}/resourceConstraints',
'_transfer_options_root': '{_distinfo}/transferOptions/MD_DigitalTransferOptions/onLine',
'_keywords_root': '{_idinfo}/descriptiveKeywords',
'_larger_works_root': '{_idinfo_aggregate_citation}',
'_process_steps_root': '{_dataqual_lineage}/processStep',
'_use_constraints_root': '{_idinfo}/resourceConstraints',

# Then process public dependent tags
'title': '{_idinfo_citation}/title/CharacterString',
Expand All @@ -126,7 +128,7 @@
'dist_liability': '{_idinfo}/resourceConstraints/MD_LegalConstraints/otherConstraints/CharacterString',
'processing_fees': '{_distinfo_proc}/fees/CharacterString',
'processing_instrs': '{_distinfo_proc}/orderingInstructions/CharacterString',
'resource_desc': '{_idinfo_citation}/identifier/MD_Identifier/code/CharacterString',
'resource_desc': '{_idinfo}/resourceSpecificUsage/MD_Usage/specificUsage/CharacterString',
'tech_prerequisites': '{_idinfo}/environmentDescription/CharacterString',
ATTRIBUTES: '{_attr_base}/{{ad_path}}',
'_attributes_file': '{_attr_citation}/@href',
Expand All @@ -141,7 +143,7 @@
PROCESS_STEPS: '{_dataqual_lineage}/processStep/LI_ProcessStep/{{ps_path}}',
LARGER_WORKS: '{_idinfo_aggregate_citation}/{{lw_path}}',
'_lw_citation': '{_idinfo_aggregate_contact}/{{lw_path}}',
'_lw_collective': '{_idinfo_citation}/collectiveTitle/CharacterString',
'_lw_collective': '{_idinfo_aggregate_citation}/collectiveTitle/CharacterString',
'_lw_contact': '{_idinfo_aggregate_contact}/contactInfo/CI_Contact/{{lw_path}}',
'_lw_linkage': '{_idinfo_aggregate_contact}/contactInfo/CI_Contact/onlineResource/CI_OnlineResource/{{lw_path}}',
'other_citation_info': '{_idinfo_citation}/otherCitationDetails/CharacterString',
Expand Down
44 changes: 6 additions & 38 deletions gis_metadata/tests/data/fgdc_metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,6 @@
<distliab>Test Distribution Liability</distliab>
<stdorder>
<digform>
<digtopt>
<onlineopt>
<computer>
<networka>
<networkr>Digital Form 1 Resource 1</networkr>
</networka>
</computer>
<computer>
<networka>
<networkr>Digital Form 1 Resource 2</networkr>
</networka>
</computer>
</onlineopt>
<onlineopt>
<computer>
<networka>
<networkr>Digital Form 1 Resource 3</networkr>
</networka>
</computer>
</onlineopt>
</digtopt>
<digtinfo>
<formname>Digital Form Name 1</formname>
<formvern>Digital Form Version 1</formvern>
Expand All @@ -158,7 +137,7 @@
<onlinopt>
<computer>
<networka>
<networkr>http://digitalform.network.resource.one</networkr>
<networkr>Digital Form Resource 1</networkr>
</networka>
</computer>
<accinstr>Digital Form Access Instructions 1</accinstr>
Expand All @@ -167,17 +146,6 @@
</digtopt>
</digform>
<digform>
<digtopt>
<onlineopt>
<computer>
<networka>
<networkr>Digital Form 2 Resource 1</networkr>
<networkr>Digital Form 2 Resource 2</networkr>
<networkr>Digital Form 2 Resource 3</networkr>
</networka>
</computer>
</onlineopt>
</digtopt>
<digtinfo>
<formname>Digital Form Name 2</formname>
<formvern>Digital Form Version 2</formvern>
Expand All @@ -189,7 +157,7 @@
<onlinopt>
<computer>
<networka>
<networkr>http://digitalform.network.resource.two</networkr>
<networkr>Digital Form Resource 2</networkr>
</networka>
</computer>
<accinstr>Digital Form Access Instructions 2</accinstr>
Expand Down Expand Up @@ -230,12 +198,12 @@
<dataqual>
<lineage>
<procstep>
<date Sync="TRUE">20070210</date>
<time Sync="TRUE">15093700</time>
<date>20070210</date>
<time>15093700</time>
</procstep>
<procstep>
<date Sync="TRUE">20070418</date>
<time Sync="TRUE">10392700</time>
<date>20070418</date>
<time>10392700</time>
</procstep>
<procstep>
<procdesc>Process Step Description 1</procdesc>
Expand Down
64 changes: 16 additions & 48 deletions gis_metadata/tests/data/iso_metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@
<otherCitationDetails>
<CharacterString>Larger Works Other Citation</CharacterString>
</otherCitationDetails>
<collectiveTitle>
<CharacterString>Larger Works Collective Title (not currently used)</CharacterString>
</collectiveTitle>
<edition>
<CharacterString>Larger Works Edition</CharacterString>
</edition>
Expand Down Expand Up @@ -184,16 +187,6 @@
<title>
<CharacterString>Test Title</CharacterString>
</title>
<collectiveTitle>
<CharacterString>Larger Works Collective Title (not currently used)</CharacterString>
</collectiveTitle>
<identifier>
<MD_Identifier>
<code>
<CharacterString>Test Resource Description</CharacterString>
</code>
</MD_Identifier>
</identifier>
<otherCitationDetails>
<CharacterString>Test Other Citation Info</CharacterString>
</otherCitationDetails>
Expand Down Expand Up @@ -265,6 +258,8 @@
</CI_Contact>
</contactInfo>
</CI_ResponsibleParty>
</pointOfContact>
<pointOfContact>
<CI_ResponsibleParty>
<individualName>
<CharacterString>Contact Name 2</CharacterString>
Expand Down Expand Up @@ -294,12 +289,21 @@
<CharacterString>Test Use Constraints</CharacterString>
</useLimitation>
</MD_Constraints>
</resourceConstraints>
<resourceConstraints>
<MD_LegalConstraints>
<otherConstraints>
<CharacterString>Test Distribution Liability</CharacterString>
</otherConstraints>
</MD_LegalConstraints>
</resourceConstraints>
<resourceSpecificUsage>
<MD_Usage>
<specificUsage>
<CharacterString>Test Resource Description</CharacterString>
</specificUsage>
</MD_Usage>
</resourceSpecificUsage>
<descriptiveKeywords>
<MD_Keywords>
<keyword>
Expand Down Expand Up @@ -450,7 +454,7 @@
<CharacterString>Digital Form Access Instructions 1</CharacterString>
</protocol>
<linkage>
<URL>Digital Form 1 Resource 1</URL>
<URL>Digital Form Resource 1</URL>
</linkage>
<description>
<CharacterString>Digital Form Access Description 1</CharacterString>
Expand All @@ -460,30 +464,8 @@
<onLine>
<CI_OnlineResource>
<linkage>
<URL>Digital Form 1 Resource 2</URL>
</linkage>
</CI_OnlineResource>
</onLine>
<onLine>
<CI_OnlineResource>
<linkage>
<URL>Digital Form 1 Resource 3</URL>
</linkage>
</CI_OnlineResource>
</onLine>
</MD_DigitalTransferOptions>
</transferOptions>
<transferOptions>
<MD_DigitalTransferOptions>
<onLine>
<CI_OnlineResource>
<linkage>
<URL>Digital Form 2 Resource 1</URL>
<URL>Digital Form Resource 2</URL>
</linkage>
</CI_OnlineResource>
</onLine>
<onLine>
<CI_OnlineResource>
<protocol>
<CharacterString>Digital Form Access Instructions 2</CharacterString>
</protocol>
Expand All @@ -492,20 +474,6 @@
</description>
</CI_OnlineResource>
</onLine>
<onLine>
<CI_OnlineResource>
<linkage>
<URL>Digital Form 2 Resource 2</URL>
</linkage>
</CI_OnlineResource>
</onLine>
<onLine>
<CI_OnlineResource>
<linkage>
<URL>Digital Form 2 Resource 3</URL>
</linkage>
</CI_OnlineResource>
</onLine>
</MD_DigitalTransferOptions>
</transferOptions>
<distributor>
Expand Down
4 changes: 2 additions & 2 deletions gis_metadata/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
'specification': 'Digital Form Specification 1',
'access_instrs': 'Digital Form Access Instructions 1',
'name': 'Digital Form Name 1',
'network_resource': ['Digital Form 1 Resource 1', 'Digital Form 1 Resource 2', 'Digital Form 1 Resource 3'],
'network_resource': 'Digital Form Resource 1',
'content': 'Digital Form Content 1',
'decompression': 'Digital Form Decompression 1'
}, {
Expand All @@ -85,7 +85,7 @@
'specification': 'Digital Form Specification 2',
'access_instrs': 'Digital Form Access Instructions 2',
'name': 'Digital Form Name 2',
'network_resource': ['Digital Form 2 Resource 1', 'Digital Form 2 Resource 2', 'Digital Form 2 Resource 3'],
'network_resource': 'Digital Form Resource 2',
'content': 'Digital Form Content 2',
'decompression': 'Digital Form Decompression 2'
}],
Expand Down
3 changes: 1 addition & 2 deletions gis_metadata/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
_COMPLEX_STRUCTS = {BOUNDING_BOX, DATES, LARGER_WORKS}
_COMPLEX_WITH_MULTI = {
DATES: {'values'},
DIGITAL_FORMS: {'network_resource'},
LARGER_WORKS: {'origin'},
PROCESS_STEPS: {'sources'}
}
Expand Down Expand Up @@ -111,7 +110,7 @@
'specification': '{specification}', # Text
'access_desc': '{access_desc}', # Text
'access_instrs': '{access_instrs}', # Text
'network_resource': '{network_resource}' # Text []
'network_resource': '{network_resource}' # Text
},
LARGER_WORKS: {
'title': '{title}', # Text
Expand Down

0 comments on commit e5a7cd4

Please sign in to comment.