commonmeta-ruby 3.2.5 → 3.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +16 -2
  3. data/commonmeta.gemspec +1 -0
  4. data/lib/commonmeta/author_utils.rb +20 -3
  5. data/lib/commonmeta/cli.rb +17 -21
  6. data/lib/commonmeta/crossref_utils.rb +22 -18
  7. data/lib/commonmeta/readers/json_feed_reader.rb +31 -11
  8. data/lib/commonmeta/utils.rb +13 -3
  9. data/lib/commonmeta/version.rb +1 -1
  10. data/resources/crossref/common5.3.1.xsd +43 -35
  11. data/spec/author_utils_spec.rb +38 -0
  12. data/spec/cli_spec.rb +5 -7
  13. data/spec/fixtures/vcr_cassettes/Commonmeta_CLI/json_feed/blog_post_uuid.yml +980 -0
  14. data/spec/fixtures/vcr_cassettes/Commonmeta_CLI/json_feed_unregistered/blog_post_uuid.yml +49 -0
  15. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed/unregistered_posts.yml +215 -0
  16. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/blogger_post.yml +20 -11
  17. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_author_name_suffix.yml +215 -0
  18. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_doi.yml +14 -9
  19. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_without_doi.yml +9 -8
  20. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/jekyll_post.yml +15 -10
  21. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/syldavia_gazette_post_with_references.yml +328 -0
  22. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/upstream_post_with_references.yml +824 -0
  23. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/wordpress_post.yml +14 -9
  24. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/wordpress_post_with_references.yml +390 -0
  25. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/{json_feed_url → json_feed_unregistered_url}/all_posts.yml +11 -11
  26. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/another_schema_org_from_front-matter.yml +103 -105
  27. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/journal_article.yml +5 -5
  28. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/journal_article_from_datacite.yml +4 -4
  29. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_feed_item_from_rogue_scholar_with_doi.yml +60 -9
  30. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_feed_item_from_upstream_blog.yml +55 -7
  31. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_feed_item_with_references.yml +824 -0
  32. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/posted_content.yml +17 -17
  33. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/schema_org_from_another_science_blog.yml +12 -8
  34. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/schema_org_from_front_matter.yml +178 -181
  35. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/schema_org_from_upstream_blog.yml +104 -92
  36. data/spec/readers/json_feed_reader_spec.rb +106 -30
  37. data/spec/utils_spec.rb +23 -11
  38. data/spec/writers/crossref_xml_writer_spec.rb +31 -3
  39. metadata +25 -8
  40. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/json_feed_url/front-matter_blog.yml +0 -221
  41. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_item_from_rogue_scholar_with_doi.yml +0 -163
  42. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_item_from_upstream_blog.yml +0 -243
  43. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_post_from_rogue_scholar_with_doi.yml +0 -210
  44. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_post_from_upstream_blog.yml +0 -290
@@ -1,4 +1,9 @@
1
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:fr="http://www.crossref.org/fundref.xsd" xmlns:ct="http://www.crossref.org/clinicaltrials.xsd" xmlns:ai="http://www.crossref.org/AccessIndicators.xsd" xmlns:mml="http://www.w3.org/1998/Math/MathML"><!-- *************************************************************
1
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
2
+ xmlns:fr="http://www.crossref.org/fundref.xsd"
3
+ xmlns:ct="http://www.crossref.org/clinicaltrials.xsd"
4
+ xmlns:ai="http://www.crossref.org/AccessIndicators.xsd"
5
+ xmlns:mml="http://www.w3.org/1998/Math/MathML">
6
+ <!--*************************************************************
2
7
  Crossref Metadata Input Schema, common file v. 5.3.1
3
8
  *************************************************************
4
9
 
@@ -8,7 +13,7 @@ As of version 4.5.0 all changes are noted in the release notes for the schema re
8
13
 
9
14
  Prior updates are noted as comments within previous schema versions.
10
15
 
11
- -->
16
+ -->
12
17
  <xsd:import namespace="http://www.w3.org/1998/Math/MathML" schemaLocation="http://www.w3.org/Math/XMLSchema/mathml3/mathml3.xsd"/>
13
18
  <xsd:import namespace="http://www.crossref.org/fundref.xsd" schemaLocation="fundref.xsd"/>
14
19
  <xsd:import namespace="http://www.crossref.org/AccessIndicators.xsd" schemaLocation="AccessIndicators.xsd"/>
@@ -20,7 +25,7 @@ Prior updates are noted as comments within previous schema versions.
20
25
  </xsd:complexType>
21
26
  <xsd:group name="face_markup">
22
27
  <xsd:annotation>
23
- <xsd:documentation>The following are basic data types for face markup. Face markup that appears in the title, subtitle, and original_language_title elements should be retained when depositing metadata. Face markup in other elements (e.g. small caps in author names) must be dropped. Face markup support includes bold (b), italic (i), underline (u), over-line (ovl), superscript (sup), subscript (sub), small caps (scp), and typewriter text (tt). See https://support.crossref.org/hc/en-us/articles/214532023 MathML may also be included using the &apos;mml&apos; namespace prefix.</xsd:documentation>
28
+ <xsd:documentation>The following are basic data types for face markup. Face markup that appears in the title, subtitle, and original_language_title elements should be retained when depositing metadata. Face markup in other elements (e.g. small caps in author names) must be dropped. Face markup support includes bold (b), italic (i), underline (u), over-line (ovl), superscript (sup), subscript (sub), small caps (scp), and typewriter text (tt). See https://support.crossref.org/hc/en-us/articles/214532023 MathML may also be included using the 'mml' namespace prefix.</xsd:documentation>
24
29
  </xsd:annotation>
25
30
  <xsd:choice>
26
31
  <xsd:element ref="b"/>
@@ -50,7 +55,7 @@ Prior updates are noted as comments within previous schema versions.
50
55
  <xsd:element name="font" type="xrefFaces"/>
51
56
  <xsd:element name="a">
52
57
  <xsd:annotation>
53
- <xsd:documentation> content is &quot;Inline&quot; except that anchors shouldn&apos;t be nested </xsd:documentation>
58
+ <xsd:documentation> content is "Inline" except that anchors shouldn't be nested </xsd:documentation>
54
59
  </xsd:annotation>
55
60
  <xsd:complexType mixed="true">
56
61
  <xsd:simpleContent>
@@ -133,7 +138,7 @@ Prior updates are noted as comments within previous schema versions.
133
138
  </xsd:element>
134
139
  <xsd:element name="edition_number">
135
140
  <xsd:annotation>
136
- <xsd:documentation>The edition number of a book. edition_number should include only a number and not additional text such as &quot;edition&quot;. For example, you should submit &quot;3&quot;, not &quot;third edition&quot; or &quot;3rd edition&quot;. Roman numerals are acceptable.</xsd:documentation>
141
+ <xsd:documentation>The edition number of a book. edition_number should include only a number and not additional text such as "edition". For example, you should submit "3", not "third edition" or "3rd edition". Roman numerals are acceptable.</xsd:documentation>
137
142
  </xsd:annotation>
138
143
  <xsd:simpleType>
139
144
  <xsd:restriction base="xsd:string">
@@ -141,11 +146,12 @@ Prior updates are noted as comments within previous schema versions.
141
146
  <xsd:minLength value="1"/>
142
147
  </xsd:restriction>
143
148
  </xsd:simpleType>
144
- </xsd:element><!-- =============================================================
149
+ </xsd:element>
150
+ <!-- =============================================================
145
151
 
146
152
  5. Journal elements
147
153
 
148
- ============================================================= -->
154
+ ============================================================= -->
149
155
  <xsd:element name="issue">
150
156
  <xsd:annotation>
151
157
  <xsd:documentation>The issue number or name in which an article is published. The issue number takes precedence over any other name. For example, if an issue has only a seasonal name, then the season should be listed in issue.</xsd:documentation>
@@ -156,11 +162,12 @@ Prior updates are noted as comments within previous schema versions.
156
162
  <xsd:minLength value="1"/>
157
163
  </xsd:restriction>
158
164
  </xsd:simpleType>
159
- </xsd:element><!-- =============================================================
165
+ </xsd:element>
166
+ <!-- =============================================================
160
167
 
161
168
  6. Elements shared by content types
162
169
 
163
- ============================================================= -->
170
+ ============================================================= -->
164
171
  <xsd:element name="doi_data">
165
172
  <xsd:annotation>
166
173
  <xsd:documentation>The container for elements related directly to a DOI. </xsd:documentation>
@@ -203,10 +210,9 @@ Prior updates are noted as comments within previous schema versions.
203
210
  </xsd:simpleType>
204
211
  <xsd:element name="collection">
205
212
  <xsd:annotation>
206
- <xsd:documentation>
207
- Container for item elements containing non-primary URIs associated with the item being registered. Collections are supported for the following (defined in the property attribute):
208
- <ul>
209
- <li>list-based: Multiple Resolution, more info: https://www.crossref.org/education/content-registration/creating-and-managing-dois/multiple-resolution/</li>
213
+ <xsd:documentation>Container for item elements containing non-primary URIs associated with the item being registered. Collections are supported for the following (defined in the property attribute):
214
+ <ul>
215
+ <li>list-based: Multiple Resolution, more info: https://www.crossref.org/education/content-registration/creating-and-managing-dois/multiple-resolution/</li>
210
216
  <li>country-based: more info: https://www.crossref.org/education/content-registration/creating-and-managing-dois/multiple-resolution/#00130</li>
211
217
  <li>crawler-based: for Similarity Check URLs, more info: https://www.crossref.org/education/similarity-check/participate/urls-for-new-deposits/</li>
212
218
  <li>text-mining: supply specific URLs for text and data mining, more info: https://www.crossref.org/education/retrieve-metadata/rest-api/text-and-data-mining-for-members/</li>
@@ -540,7 +546,7 @@ Container for item elements containing non-primary URIs associated with the item
540
546
  </xsd:element>
541
547
  <xsd:attributeGroup name="reference_distribution_opts.att">
542
548
  <xsd:annotation>
543
- <xsd:documentation>NOTE: not currently supported. Use to flag references for distribution. &quot;none&quot; is the default and follows current protocol - references are only distributed to everyone if the prefix level permission is set, otherwise reference distribution is limited to the DOI owner. Setting the value to &quot;query&quot; releases references to anyone making a query request (this overrides any established prefix level permission). Value &quot;any&quot; allows bulk distribution to anyone (using a Crossref query account) using the OAI-PMH protocol, and also releases references to anyone making a query request.</xsd:documentation>
549
+ <xsd:documentation>NOTE: not currently supported. Use to flag references for distribution. "none" is the default and follows current protocol - references are only distributed to everyone if the prefix level permission is set, otherwise reference distribution is limited to the DOI owner. Setting the value to "query" releases references to anyone making a query request (this overrides any established prefix level permission). Value "any" allows bulk distribution to anyone (using a Crossref query account) using the OAI-PMH protocol, and also releases references to anyone making a query request.</xsd:documentation>
544
550
  </xsd:annotation>
545
551
  <xsd:attribute name="reference_distribution_opts" use="optional" default="none">
546
552
  <xsd:simpleType>
@@ -551,7 +557,9 @@ Container for item elements containing non-primary URIs associated with the item
551
557
  </xsd:restriction>
552
558
  </xsd:simpleType>
553
559
  </xsd:attribute>
554
- </xsd:attributeGroup><!-- END NAME ELEMENTs --><!-- ============ end various dates ========== -->
560
+ </xsd:attributeGroup>
561
+ <!--END NAME ELEMENTs-->
562
+ <!--============ end various dates ========== -->
555
563
  <xsd:simpleType name="doi_t">
556
564
  <xsd:restriction base="xsd:string">
557
565
  <xsd:maxLength value="2048"/>
@@ -703,7 +711,7 @@ Container for item elements containing non-primary URIs associated with the item
703
711
  </xsd:complexType>
704
712
  <xsd:element name="citation">
705
713
  <xsd:annotation>
706
- <xsd:documentation>citation is used to deposit each reference in the reference list of the item for which the DOI is being deposited. For details see: https://www.crossref.org/education/metadata-stewardship/maintaining-your-metadata/add-references/ </xsd:documentation>
714
+ <xsd:documentation>citation is used to deposit each reference in the reference list of the item for which the DOI is being deposited. For details see: https://www.crossref.org/education/metadata-stewardship/maintaining-your-metadata/add-references/ </xsd:documentation>
707
715
  </xsd:annotation>
708
716
  <xsd:complexType>
709
717
  <xsd:complexContent>
@@ -729,7 +737,7 @@ Container for item elements containing non-primary URIs associated with the item
729
737
  </xsd:attributeGroup>
730
738
  <xsd:element name="unstructured_citation">
731
739
  <xsd:annotation>
732
- <xsd:documentation>A citation to an item that is not structured with the Crossref citation model. &apos;unstructured_citation&apos; supports deposit of references for which no structural information is available. </xsd:documentation>
740
+ <xsd:documentation>A citation to an item that is not structured with the Crossref citation model. 'unstructured_citation' supports deposit of references for which no structural information is available. </xsd:documentation>
733
741
  </xsd:annotation>
734
742
  <xsd:complexType mixed="true">
735
743
  <xsd:choice minOccurs="0" maxOccurs="unbounded">
@@ -783,7 +791,7 @@ Container for item elements containing non-primary URIs associated with the item
783
791
  <xsd:element ref="crossmark_domains" minOccurs="0" maxOccurs="unbounded"/>
784
792
  <xsd:element ref="crossmark_domain_exclusive" minOccurs="0">
785
793
  <xsd:annotation>
786
- <xsd:documentation>Some publishers encourage broad third party hosting of the publisher&apos;s content. Other publishers do not. And still others vary their policy depending on whether a particular article has been published under an OA policy or not. This boolean flag allows the publisher to indicate whether the Crossmarked content will only legitimately be updated on the Crossmark domain (true) or whether the publisher encourages updating the content on other sites as well (false).</xsd:documentation>
794
+ <xsd:documentation>Some publishers encourage broad third party hosting of the publisher's content. Other publishers do not. And still others vary their policy depending on whether a particular article has been published under an OA policy or not. This boolean flag allows the publisher to indicate whether the Crossmarked content will only legitimately be updated on the Crossmark domain (true) or whether the publisher encourages updating the content on other sites as well (false).</xsd:documentation>
787
795
  </xsd:annotation>
788
796
  </xsd:element>
789
797
  <xsd:sequence minOccurs="0">
@@ -795,13 +803,13 @@ Container for item elements containing non-primary URIs associated with the item
795
803
  </xsd:element>
796
804
  <xsd:element name="crossmark_policy" type="doi_t">
797
805
  <xsd:annotation>
798
- <xsd:documentation>A DOI which points to a publisher&apos;s CrossMark policy document. Publishers might have different policies for different publications.</xsd:documentation>
806
+ <xsd:documentation>A DOI which points to a publisher's CrossMark policy document. Publishers might have different policies for different publications.</xsd:documentation>
799
807
  </xsd:annotation>
800
808
  </xsd:element>
801
809
  <xsd:element name="crossmark_version" type="xsd:string"/>
802
810
  <xsd:element name="crossmark_domains">
803
811
  <xsd:annotation>
804
- <xsd:documentation>Container element for crossmark_domain. A list of domains where the publisher maintains updates and corrections to their content. Minimally, one of these should include the Internet domain name of the publisher&apos;s web site(s), but the publisher might also decide to include 3rd party aggregators (e.g. Ebsco, IngentaConnect) or archives with which the publisher has agreements to update the content </xsd:documentation>
812
+ <xsd:documentation>Container element for crossmark_domain. A list of domains where the publisher maintains updates and corrections to their content. Minimally, one of these should include the Internet domain name of the publisher's web site(s), but the publisher might also decide to include 3rd party aggregators (e.g. Ebsco, IngentaConnect) or archives with which the publisher has agreements to update the content </xsd:documentation>
805
813
  </xsd:annotation>
806
814
  <xsd:complexType>
807
815
  <xsd:sequence>
@@ -811,7 +819,7 @@ Container for item elements containing non-primary URIs associated with the item
811
819
  </xsd:element>
812
820
  <xsd:element name="crossmark_domain">
813
821
  <xsd:annotation>
814
- <xsd:documentation>This should be a simple Internet domain name or subdomain name (e.g. www.psychoceramics.org or psychoceramics.org). It is used to identify when a referring URL is coming from a Crossmark domain. A &quot;crossmark_domain&quot; is made up of two subelements; a &quot;domain&quot; and a &quot;filter&quot;. The filter is only needed for use in situations where content from multiple publishers/publications is on the same host with the same domain name (e.g. an aggregator) and one needs to use the referrer&apos;s URI &quot;path&quot; to further determine whether the content in a crossmark domain.</xsd:documentation>
822
+ <xsd:documentation>This should be a simple Internet domain name or subdomain name (e.g. www.psychoceramics.org or psychoceramics.org). It is used to identify when a referring URL is coming from a Crossmark domain. A "crossmark_domain" is made up of two subelements; a "domain" and a "filter". The filter is only needed for use in situations where content from multiple publishers/publications is on the same host with the same domain name (e.g. an aggregator) and one needs to use the referrer's URI "path" to further determine whether the content in a crossmark domain.</xsd:documentation>
815
823
  </xsd:annotation>
816
824
  <xsd:complexType>
817
825
  <xsd:sequence>
@@ -827,7 +835,7 @@ Container for item elements containing non-primary URIs associated with the item
827
835
  </xsd:element>
828
836
  <xsd:element name="filter" type="xsd:string">
829
837
  <xsd:annotation>
830
- <xsd:documentation>The filter element is used to disambiguate content in situations where multiple publishers share the same host (e.g. when on an aggregated platform). It should contain a substring of the path that can be used to uniquely identify a publisher&apos;s or publication&apos;s content. For instance, using the string &quot;alpsp&quot; here would help the CrossMark system distinguish between ALPSP publications on the ingentaconnect host and other publications on the same host.</xsd:documentation>
838
+ <xsd:documentation>The filter element is used to disambiguate content in situations where multiple publishers share the same host (e.g. when on an aggregated platform). It should contain a substring of the path that can be used to uniquely identify a publisher's or publication's content. For instance, using the string "alpsp" here would help the CrossMark system distinguish between ALPSP publications on the ingentaconnect host and other publications on the same host.</xsd:documentation>
831
839
  </xsd:annotation>
832
840
  </xsd:element>
833
841
  <xsd:element name="crossmark_domain_exclusive" type="xsd:boolean"/>
@@ -843,16 +851,15 @@ Container for item elements containing non-primary URIs associated with the item
843
851
  </xsd:element>
844
852
  <xsd:element name="update">
845
853
  <xsd:annotation>
846
- <xsd:documentation>The DOI of the content being updated (e.g. corrected, retracted, etc.) In the CrossMark Terms and Conditions &quot;updates&quot; are defined as changes that are likely to &quot;change the reader’s interpretation or crediting of the work.&quot; That is, *editorially significant* changes. &quot;Updates&quot; should not include minor changes to spelling, punctuation, formatting, etc. </xsd:documentation>
854
+ <xsd:documentation>The DOI of the content being updated (e.g. corrected, retracted, etc.) In the CrossMark Terms and Conditions "updates" are defined as changes that are likely to "change the reader’s interpretation or crediting of the work." That is, *editorially significant* changes. "Updates" should not include minor changes to spelling, punctuation, formatting, etc. </xsd:documentation>
847
855
  </xsd:annotation>
848
856
  <xsd:complexType mixed="true">
849
857
  <xsd:simpleContent>
850
858
  <xsd:extension base="doi_t">
851
859
  <xsd:attribute name="type" use="required" type="cm_update_type">
852
860
  <xsd:annotation>
853
- <xsd:documentation>
854
- This attribute should be used to list the update type. Allowed update types are:
855
- <ul>
861
+ <xsd:documentation>This attribute should be used to list the update type. Allowed update types are:
862
+ <ul>
856
863
  <li>addendum</li>
857
864
  <li>clarification</li>
858
865
  <li>correction</li>
@@ -913,27 +920,27 @@ This attribute should be used to list the update type. Allowed update types are:
913
920
  </xsd:choice>
914
921
  <xsd:attribute name="explanation" type="xsd:anyURI">
915
922
  <xsd:annotation>
916
- <xsd:documentation>If the publisher wants to provide a further explanation of what the particular &quot;assertion&quot; means, they can link to such an explanation by providing an appropriate url on the &quot;explanation&quot; attribute.</xsd:documentation>
923
+ <xsd:documentation>If the publisher wants to provide a further explanation of what the particular "assertion" means, they can link to such an explanation by providing an appropriate url on the "explanation" attribute.</xsd:documentation>
917
924
  </xsd:annotation>
918
925
  </xsd:attribute>
919
926
  <xsd:attribute name="group_label" type="cm_assertion_group_label">
920
927
  <xsd:annotation>
921
- <xsd:documentation>This is the human-readable form of the &quot;group_name&quot; attribute. This is what will be displayed in the group headings on the Crossmark metadata record dialog.</xsd:documentation>
928
+ <xsd:documentation>This is the human-readable form of the "group_name" attribute. This is what will be displayed in the group headings on the Crossmark metadata record dialog.</xsd:documentation>
922
929
  </xsd:annotation>
923
930
  </xsd:attribute>
924
931
  <xsd:attribute name="group_name" type="cm_assertion_group_name">
925
932
  <xsd:annotation>
926
- <xsd:documentation>Some assertions could be logically &quot;grouped&quot; together in the CrossMark dialog. For instance, if the publisher is recording several pieces of metadata related to funding sources (source name, percentage, grant number), they may want to make sure that these three assertions are grouped next to each-other in the CrossMark dialog. The group_name attribute is the machine-readable value that will be used for grouping such assertions.</xsd:documentation>
933
+ <xsd:documentation>Some assertions could be logically "grouped" together in the CrossMark dialog. For instance, if the publisher is recording several pieces of metadata related to funding sources (source name, percentage, grant number), they may want to make sure that these three assertions are grouped next to each-other in the CrossMark dialog. The group_name attribute is the machine-readable value that will be used for grouping such assertions.</xsd:documentation>
927
934
  </xsd:annotation>
928
935
  </xsd:attribute>
929
936
  <xsd:attribute name="label" type="cm_assertion_label">
930
937
  <xsd:annotation>
931
- <xsd:documentation>This is the human-readable version of the name attribute which will be displayed in the CrossMark dialog. If this attribute is missing, then the value of the assertion will *not* be displayed in the dialog. Publishers may want to &quot;hide&quot; assertions this way in cases where the assertion value is too large or too complex to display in the dialog, but where the assertion is nonetheless valuable enough to include in API queries and metadata dumps (e.g. detailed licensing terms)</xsd:documentation>
938
+ <xsd:documentation>This is the human-readable version of the name attribute which will be displayed in the CrossMark dialog. If this attribute is missing, then the value of the assertion will *not* be displayed in the dialog. Publishers may want to "hide" assertions this way in cases where the assertion value is too large or too complex to display in the dialog, but where the assertion is nonetheless valuable enough to include in API queries and metadata dumps (e.g. detailed licensing terms)</xsd:documentation>
932
939
  </xsd:annotation>
933
940
  </xsd:attribute>
934
941
  <xsd:attribute name="name" use="required" type="cm_assertion_name">
935
942
  <xsd:annotation>
936
- <xsd:documentation>This is the machine-readable name of the assertion. Use the &quot;label&quot; attribute to provide a human-readable version of the name.</xsd:documentation>
943
+ <xsd:documentation>This is the machine-readable name of the assertion. Use the "label" attribute to provide a human-readable version of the name.</xsd:documentation>
937
944
  </xsd:annotation>
938
945
  </xsd:attribute>
939
946
  <xsd:attribute name="order" type="xsd:integer">
@@ -1024,7 +1031,7 @@ This attribute should be used to list the update type. Allowed update types are:
1024
1031
  </xsd:element>
1025
1032
  <xsd:element name="std_family_designator" type="std_designator_t">
1026
1033
  <xsd:annotation>
1027
- <xsd:documentation>Provides for defining a DOI for a broad grouping of standards. </xsd:documentation>
1034
+ <xsd:documentation>Provides for defining a DOI for a broad grouping of standards. </xsd:documentation>
1028
1035
  </xsd:annotation>
1029
1036
  </xsd:element>
1030
1037
  <xsd:element name="std_set_designator">
@@ -1059,12 +1066,12 @@ This attribute should be used to list the update type. Allowed update types are:
1059
1066
  </xsd:element>
1060
1067
  <xsd:element name="std_adopted_from" type="std_designatorvalue_t">
1061
1068
  <xsd:annotation>
1062
- <xsd:documentation>Designator for standard from which the current deposit is adopted. </xsd:documentation>
1069
+ <xsd:documentation>Designator for standard from which the current deposit is adopted. </xsd:documentation>
1063
1070
  </xsd:annotation>
1064
1071
  </xsd:element>
1065
1072
  <xsd:element name="std_revision_of" type="std_designatorvalue_t">
1066
1073
  <xsd:annotation>
1067
- <xsd:documentation>Designator for the previous revision of the standard being deposited. (note: use alt_as_published for revisions within designators having common stem) </xsd:documentation>
1074
+ <xsd:documentation>Designator for the previous revision of the standard being deposited. (note: use alt_as_published for revisions within designators having common stem) </xsd:documentation>
1068
1075
  </xsd:annotation>
1069
1076
  </xsd:element>
1070
1077
  <xsd:element name="standards_body">
@@ -1103,7 +1110,8 @@ This attribute should be used to list the update type. Allowed update types are:
1103
1110
  </xsd:complexType>
1104
1111
  <xsd:element name="std_designator" type="std_designatorvalue_t"/>
1105
1112
  <xsd:element name="std_alt_script" type="std_designatorvalue_t"/>
1106
- <xsd:element name="std_variant_form" type="std_designatorvalue_t"/><!-- ================SCN policy ============================= -->
1113
+ <xsd:element name="std_variant_form" type="std_designatorvalue_t"/>
1114
+ <!-- ================SCN policy ============================= -->
1107
1115
  <xsd:element name="scn_policies">
1108
1116
  <xsd:annotation>
1109
1117
  <xsd:documentation>A wrapper for Scholarly Sharing Network (SCN) policy information</xsd:documentation>
@@ -44,10 +44,42 @@ describe Commonmeta::Metadata, vcr: true do
44
44
  expect(subject.is_personal_name?(name: author['name'])).to be true
45
45
  end
46
46
 
47
+ it 'has unknown given name and middle initial' do
48
+ author = { 'name' => 'Tejas S. Sathe' }
49
+ expect(subject.is_personal_name?(name: author['name'])).to be true
50
+ end
51
+
47
52
  it 'has no info' do
48
53
  author = { 'name' => 'M Fenner' }
49
54
  expect(subject.is_personal_name?(name: author['name'])).to be true
50
55
  end
56
+
57
+ it 'name with title' do
58
+ author = { 'name' => 'Tejas S. Sathe, MD' }
59
+ expect(subject.is_personal_name?(name: author['name'])).to be true
60
+ end
61
+ end
62
+
63
+ context 'cleanup_author' do
64
+ it 'Smith J.' do
65
+ author = 'Smith J.'
66
+ expect(subject.cleanup_author(author)).to eq('Smith, J.')
67
+ end
68
+
69
+ it 'Smith, John' do
70
+ author = 'Smith, John'
71
+ expect(subject.cleanup_author(author)).to eq('Smith, John')
72
+ end
73
+
74
+ it 'John Smith' do
75
+ author = 'John Smith'
76
+ expect(subject.cleanup_author(author)).to eq('John Smith')
77
+ end
78
+
79
+ it 'with email' do
80
+ author = 'noreply@blogger.com (Roderic Page)'
81
+ expect(subject.cleanup_author(author)).to eq('Roderic Page')
82
+ end
51
83
  end
52
84
 
53
85
  context 'get_one_author' do
@@ -69,6 +101,12 @@ describe Commonmeta::Metadata, vcr: true do
69
101
  )
70
102
  end
71
103
 
104
+ it 'has name with title' do
105
+ author = { 'name' => "Tejas S. Sathe, MD" }
106
+ response = subject.get_one_author(author)
107
+ expect(response).to eq('givenName' => 'Tejas S.', 'familyName' => 'Sathe', 'type' => 'Person')
108
+ end
109
+
72
110
  it 'has name in display-order with ORCID' do
73
111
  input = 'https://doi.org/10.6084/M9.FIGSHARE.4700788'
74
112
  subject = described_class.new(input: input)
data/spec/cli_spec.rb CHANGED
@@ -341,11 +341,9 @@ describe Commonmeta::CLI do
341
341
  end
342
342
  end
343
343
 
344
- describe "json_feed", vcr: true do
345
- let(:input) { "prmb582" }
346
-
347
- it "blog post" do
348
- expect { subject.json_feed input }.to output(/89a326c6-f5d1-443a-99b8-ea75e705ce11\n/).to_stdout
349
- end
350
- end
344
+ # describe "json_feed_unregistered", vcr: true do
345
+ # it "blog post uuid" do
346
+ # expect { subject.json_feed_unregistered }.to output(/e4872b3e-cd15-407d-8406-33642c1a98b0\n/).to_stdout
347
+ # end
348
+ # end
351
349
  end