Skip to content

Commit

Permalink
enable document dois, plus some other changes (mostly better keyword …
Browse files Browse the repository at this point in the history
…management)

add duplicate doi check for reserve submission

change misleading error message

add duplicate doi check for reserve submission

make behave test work again

make unit test work, add nltk requirement
  • Loading branch information
thomas loubrieu committed Sep 25, 2020
1 parent 98835f4 commit c1f3e5a
Show file tree
Hide file tree
Showing 23 changed files with 231 additions and 218 deletions.
27 changes: 14 additions & 13 deletions config/DOI_IAD2_reserved_template_20200205-mustache.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
<id></id>
{{/id}}
<title>{{title}}</title>
{{#doi}}
<sponsoring_organization>National Aeronautics and Space Administration (NASA)</sponsoring_organization>
<accession_number>{{related_identifier}}</accession_number>
<publisher>{{publisher}}</publisher>
{{#doi}}
<doi>{{doi}}</doi>
{{/doi}}
<availability></availability>
Expand All @@ -18,7 +21,7 @@
<site_url>{{site_url}}</site_url>
{{/site_url}}
{{^site_url}}
<site_url> </site_url>
<site_url></site_url>
{{/site_url}}
<product_type>{{product_type}}</product_type>
<product_type_specific>{{product_type_specific}}</product_type_specific>
Expand All @@ -34,7 +37,7 @@
<first_name>{{first_name}}</first_name>
{{/first_name}}
{{#middle_name}}
<middle>{{middle_name}}</middle_name>
<middle_name>{{middle_name}}</middle_name>
{{/middle_name}}
{{#full_name}}
<full_name>{{full_name}}</full_name>
Expand All @@ -43,32 +46,30 @@
{{/authors}}
</authors>
<contributors>
{{#contributors}}
{{#editors}}
<contributor>
<email/>
{{#last_name}}
<last_name>{{last_name}}</last_name>
{{/last_name}}
{{#first_name}}
<first_name>{{first_name}}</first_name>
{{/first_name}}
{{#middle_name}}
<middle>{{middle_name}}</middle_name>
<middle_name>{{middle_name}}</middle_name>
{{/middle_name}}
{{#full_name}}
<full_name>{{full_name}}</full_name>
{{/full_name}}
<contributor_type>DataCurator</contributor_type>
<affiliations/>
</contributor>
{{/contributors}}
{{/editors}}
<contributor>
<full_name>Planetary Data System: {{contributor}} Node</full_name>
<contributor_type>DataCurator</contributor_type>
</contributor>
</contributors>
<related_identifiers>
<related_identifier>
<identifier_type>URN</identifier_type>
<identifier_value>{{related_identifier}}</identifier_value>
<relation_type>IsIdenticalTo</relation_type>
</related_identifier>
</related_identifiers>
<contact_name>PDS Operator</contact_name>
<contact_org>PDS</contact_org>
<contact_email>[email protected]</contact_email>
Expand Down
9 changes: 1 addition & 8 deletions config/DOI_template_20200407-mustache.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<description>{{description}}
</description>
<site_url>{{site_url}}</site_url>
<product_type>Dataset</product_type>
<product_type>{{product_type}}</product_type>
<product_type_specific>{{product_type_specific}}</product_type_specific>
<date_record_added>{{date_record_added}}</date_record_added>
<keywords>PDS; PDS4; {{keywords}}</keywords>
Expand Down Expand Up @@ -67,13 +67,6 @@
<contributor_type>DataCurator</contributor_type>
</contributor>
</contributors>
<related_identifiers>
<related_identifier>
<identifier_type>URN</identifier_type>
<identifier_value>{{related_identifier}}</identifier_value>
<relation_type>IsIdenticalTo</relation_type>
</related_identifier>
</related_identifiers>
<!--product_nos>{{related_identifier}}</product_nos-->
<contact_name>PDS Operator</contact_name>
<contact_org>PDS</contact_org>
Expand Down
7 changes: 6 additions & 1 deletion config/conf.ini.default
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[OSTI]
url = https://www.osti.gov/iad2test/api/records
#url = https://www.osti.gov/iad2/api/records
user = username
password = secret
release_input_schematron = config/IAD3_scheematron.sch
Expand All @@ -10,7 +11,11 @@ url = https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_JSON_1D00.JSON
pds_node_identifier = 0001_NASA_PDS_1.pds.Node.pds.name

[LANDING_PAGES]
url = https://pds.jpl.nasa.gov/ds-view/pds/viewCollection.jsp
# template url, arguments are
# 1) product_class suffix, after _
# 2) lid
# 3) vid
url = https://pds.nasa.gov/ds-view/pds/view{}.jsp?identifier={}&version={}

[OTHER]
doi_publisher = NASA Planetary Data System
Expand Down
2 changes: 1 addition & 1 deletion config/iad_1.0.0_edited_20200908.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@

<xs:element name="authors" type="type_authors" minOccurs="1" maxOccurs="1"> </xs:element>
<xs:element name="contributors" type="type_contributors" minOccurs="1" maxOccurs="1"> </xs:element>
<xs:element name="related_identifiers" type="type_related_identifiers" minOccurs="1" maxOccurs="1"> </xs:element>
<xs:element name="related_identifiers" type="type_related_identifiers" minOccurs="0"> </xs:element>

<!--
<contact_name>PDS OPERATOR</contact_name>
Expand Down
4 changes: 2 additions & 2 deletions config/iad_schema.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -434,13 +434,13 @@
<xs:element name="site_code" type="type_site_code" minOccurs="0" maxOccurs="1"> </xs:element>
<xs:element name="product_type" type="type_product_type" minOccurs="1" maxOccurs="1"> </xs:element>
<xs:element name="product_type_specific" type="type_product_type_specific" minOccurs="1" maxOccurs="1"> </xs:element>
<xs:element name="date_record_added" type="type_date_record_added" minOccurs="1" maxOccurs="1"> </xs:element>
<xs:element name="date_record_added" type="type_date_record_added" minOccurs="0" maxOccurs="1"> </xs:element>
<xs:element name="date_record_updated" type="type_date_record_updated" minOccurs="0" maxOccurs="1"> </xs:element>
<xs:element name="keywords" type="type_keywords" minOccurs="1" maxOccurs="1"> </xs:element>

<xs:element name="authors" type="type_authors" minOccurs="1" maxOccurs="1"> </xs:element>
<xs:element name="contributors" type="type_contributors" minOccurs="1" maxOccurs="1"> </xs:element>
<xs:element name="related_identifiers" type="type_related_identifiers" minOccurs="1" maxOccurs="1"> </xs:element>
<xs:element name="related_identifiers" type="type_related_identifiers" minOccurs="0" maxOccurs="1"> </xs:element>

<!--
<contact_name>PDS OPERATOR</contact_name>
Expand Down
17 changes: 1 addition & 16 deletions input/DOI_Release_20200727_from_draft.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<records>
<record status='Pending'>
<title>InSight Cameras Bundle 0</title>
<accession_number>urn:nasa:pds:insight_cameras::2.0</accession_number>
<authors>
<author>
<first_name>R.</first_name>
Expand Down Expand Up @@ -31,15 +32,6 @@
-->
<product_type>Dataset</product_type>
<product_type_specific>PDS4 Refereed Data Bundle</product_type_specific>
<!-- Product Numbers: insert LIDVID here -->
<related_identifiers>
<related_identifier>
<identifier_type>URN</identifier_type>
<identifier_value>urn:nasa:pds:insight_cameras::2.0</identifier_value>
<relation_type>IsIdenticalTo</relation_type>
</related_identifier>
</related_identifiers>
<product_nos></product_nos>

<description>InSight Cameras Experiment Data Record (EDR) and Reduced Data Record (RDR) Data Products
</description>
Expand Down Expand Up @@ -83,13 +75,6 @@
<contributor_type>DataCurator</contributor_type>
</contributor>
</contributors>
<related_identifiers>
<related_identifier>
<identifier_type>URN</identifier_type>
<identifier_value>urn:nasa:pds:insight_cameras::1.0</identifier_value>
<relation_type>IsIdenticalTo</relation_type>
</related_identifier>
</related_identifiers>
</record>
</records>

Expand Down
24 changes: 3 additions & 21 deletions input/DOI_Release_20200727_from_reserve.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<site_url>http://mysite.example.com/link/to/my-dataset-id-25901.html</site_url>
<site_code>NASA-PDS</site_code>
<title>Laboratory Shocked Feldspars Bundle</title>
<accession_number>urn:nasa:pds:lab_shocked_feldspars::2.0</accession_number>
<doi>10.17189/25901</doi>
<publication_date>2020-03-11</publication_date>
<product_type>Dataset</product_type>
Expand All @@ -18,19 +19,13 @@
</author>
</authors>
<contributors/>
<related_identifiers>
<related_identifier>
<identifier_type>URN</identifier_type>
<identifier_value>urn:nasa:pds:lab_shocked_feldspars::2.0</identifier_value>
<relation_type>IsIdenticalTo</relation_type>
</related_identifier>
</related_identifiers>
</record>
<record status='pending' index="2">
<id>25902</id>
<site_url>http://mysite.example.com/link/to/my-dataset-id-25902.html</site_url>
<site_code>NASA-PDS</site_code>
<title>Laboratory Shocked Feldspars Bundle 2</title>
<accession_number>urn:nasa:pds:lab_shocked_feldspars_2::1.0</accession_number>
<doi>10.17189/25902</doi>
<publication_date>2020-03-12</publication_date>
<product_type>Dataset</product_type>
Expand All @@ -45,19 +40,13 @@
</author>
</authors>
<contributors/>
<related_identifiers>
<related_identifier>
<identifier_type>URN</identifier_type>
<identifier_value>urn:nasa:pds:lab_shocked_feldspars_2::1.0</identifier_value>
<relation_type>IsIdenticalTo</relation_type>
</related_identifier>
</related_identifiers>
</record>
<record status='pending' index="3">
<id>25903</id>
<site_url>http://mysite.example.com/link/to/my-dataset-id-25903.html</site_url>
<site_code>NASA-PDS</site_code>
<title>Laboratory Shocked Feldspars Bundle</title>
<accession_number>urn:nasa:pds:lab_shocked_feldspars_3::1.0</accession_number>
<doi>10.17189/25903</doi>
<publication_date>2020-03-12</publication_date>
<product_type>Dataset</product_type>
Expand All @@ -72,12 +61,5 @@
</author>
</authors>
<contributors/>
<related_identifiers>
<related_identifier>
<identifier_type>URN</identifier_type>
<identifier_value>urn:nasa:pds:lab_shocked_feldspars_3::1.0</identifier_value>
<relation_type>IsIdenticalTo</relation_type>
</related_identifier>
</related_identifiers>
</record>
</records>
3 changes: 2 additions & 1 deletion pds_doi_core/actions/draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def _transform_pds4_label_into_osti_record(self, input_file, contributor_value,
response = requests.get(input_file)
xml_tree = etree.fromstring(response.content)

o_doi = DOIPDS4LabelUtil().get_doi_fields_from_pds4(xml_tree)
o_doi = DOIPDS4LabelUtil(landing_page_template=self._config.get('LANDING_PAGES', 'url'))\
.get_doi_fields_from_pds4(xml_tree)
o_doi.publisher = self._config.get('OTHER', 'doi_publisher')
o_doi.contributor = contributor_value
o_doi.status = 'Draft' # Add 'status' field so the ranking in the workflow can be determined.
Expand Down
2 changes: 1 addition & 1 deletion pds_doi_core/actions/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _validate_doi(self, doi_label):
self._doi_validator.validate_against_xsd(single_doi_label)

# Validate the label to ensure that no rules are violated.
self._doi_validator.validate_release(doi)
self._doi_validator.validate_osti_submission(doi)

except Exception as e:
raise # Re-raise all exceptions.
Expand Down
Loading

0 comments on commit c1f3e5a

Please sign in to comment.