Skip to content

Commit

Permalink
Only use keywords with urn
Browse files Browse the repository at this point in the history
The old keywords (theme and place) are still in the FGDC metadata. The
new keywords, I think, should all have a urn attribute pointing to a
worldcat fast resource. The parser will now ignore any keyword without a
urn.
  • Loading branch information
Mike Graves committed Feb 15, 2018
1 parent 5346b9c commit 91acf07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions slingshot/parsers.py
Expand Up @@ -65,9 +65,11 @@ def end_handler(self, elem):
elif elem.tag == 'accconst' and elem.text:
self.record['dc_rights_s'] = elem.text
elif elem.tag == 'themekey' and elem.text:
self.record.setdefault('dc_subject_sm', set()).add(elem.text)
if 'urn' in elem.attrib:
self.record.setdefault('dc_subject_sm', set()).add(elem.text)
elif elem.tag == 'placekey' and elem.text:
self.record.setdefault('dct_spatial_sm', set()).add(elem.text)
if 'urn' in elem.attrib:
self.record.setdefault('dct_spatial_sm', set()).add(elem.text)
elif elem.tag == 'direct' and elem.text:
if elem.text.lower() == 'raster':
self.record['layer_geom_type_s'] = elem.text
Expand Down

0 comments on commit 91acf07

Please sign in to comment.