diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 7c95afeb9..35cdea4aa 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -257,6 +257,7 @@ not be abused to represent any non-individual. In addition to the primary responsible contact person, the Bioregistry has structured fields for additional contact methods, such as: +- `contact_extras` for annotating secondary contact people - `contact_page` for annotating the URL of a web page that has contact information, e.g., containing a contact form. Only curate this field if a direct email is not available, as this is the least transparent option for diff --git a/src/bioregistry/app/templates/resource.html b/src/bioregistry/app/templates/resource.html index 56c336d02..5c1f504d6 100644 --- a/src/bioregistry/app/templates/resource.html +++ b/src/bioregistry/app/templates/resource.html @@ -236,6 +236,11 @@
Regis Missing Contact {% endif %} + {%- for secondary_contact in resource.contact_extras or [] %} +
+ {{ utils.render_author(secondary_contact, link=none) }} +
+ {%- endfor %} {% if resource.owners %}
Identifier Space Owner{% if resource.owners | length > 1 %}s{% endif %}
{% for owner in resource.owners %} diff --git a/src/bioregistry/data/bioregistry.json b/src/bioregistry/data/bioregistry.json index c50a6a324..fb054536c 100644 --- a/src/bioregistry/data/bioregistry.json +++ b/src/bioregistry/data/bioregistry.json @@ -117062,9 +117062,10 @@ "prefix": "UNIPARC" }, "contact": { - "email": "apweiler@ebi.ac.uk", - "name": "Rolf Apweiler", - "orcid": "0000-0001-7078-200X" + "email": "agb@ebi.ac.uk", + "github": "bateman-research", + "name": "Alex Bateman", + "orcid": "0000-0002-6982-4660" }, "edam": { "description": "Accession number of a UniParc (protein sequence) database entry.", @@ -117230,10 +117231,23 @@ "uri_format": "https://www.uniprot.org/uniprotkb/$1/entry" }, "contact": { - "email": "apweiler@ebi.ac.uk", - "name": "Rolf Apweiler", - "orcid": "0000-0001-7078-200X" + "email": "agb@ebi.ac.uk", + "github": "bateman-research", + "name": "Alex Bateman", + "orcid": "0000-0002-6982-4660" }, + "contact_extras": [ + { + "email": "alan.bridge@sib.swiss", + "name": "Alan Bridge", + "orcid": "0000-0003-2148-9135" + }, + { + "email": "wuc@udel.edu", + "name": "Cathy Wu", + "orcid": "0000-0001-6379-8601" + } + ], "contact_page": "https://www.uniprot.org/contact", "contributor_extras": [ { diff --git a/src/bioregistry/schema/schema.json b/src/bioregistry/schema/schema.json index 8bb6babdd..82349b8c4 100644 --- a/src/bioregistry/schema/schema.json +++ b/src/bioregistry/schema/schema.json @@ -1123,6 +1123,22 @@ "default": null, "description": "The contact email address for the resource. This must correspond to a specific person and not be a listserve nor a shared email account." }, + "contact_extras": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Attributable" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Secondary contacts. It's required to have a primary contact to have this field.", + "title": "Contact Extras" + }, "contact_page": { "anyOf": [ { diff --git a/src/bioregistry/schema/struct.py b/src/bioregistry/schema/struct.py index c8bfca907..77ae07d57 100644 --- a/src/bioregistry/schema/struct.py +++ b/src/bioregistry/schema/struct.py @@ -342,6 +342,10 @@ class Resource(BaseModel): "person and not be a listserve nor a shared email account." ), ) + contact_extras: list[Attributable] | None = Field( + default=None, + description="Secondary contacts. It's required to have a primary contact to have this field.", + ) contact_page: str | None = Field( default=None, description="A URL for a web page that has contact information, e.g., containing a contact form. " diff --git a/src/bioregistry/schema_utils.py b/src/bioregistry/schema_utils.py index bc911b3e5..2f5700b40 100644 --- a/src/bioregistry/schema_utils.py +++ b/src/bioregistry/schema_utils.py @@ -201,6 +201,12 @@ def read_prefix_contacts(registry: Mapping[str, Resource]) -> Mapping[str, set[s contact_orcid = resource.get_contact_orcid() if contact_orcid: rv[contact_orcid].add(prefix) + + # Add all secondary contacts' ORCIDs + for secondary_contact in resource.contact_extras or []: + if secondary_contact.orcid: + rv[secondary_contact.orcid].add(prefix) + return dict(rv) diff --git a/tests/test_data.py b/tests/test_data.py index 4b79c19db..eea94ab07 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -828,6 +828,9 @@ def test_reviewers(self): def test_contacts(self): """Check contacts have minimal metadata.""" for prefix, resource in self.registry.items(): + with self.subTest(prefix=prefix): + if resource.contact_extras: + self.assertIsNotNone(resource.contact) if not resource.contact: continue with self.subTest(prefix=prefix): @@ -839,6 +842,19 @@ def test_contacts(self): ) self.assert_contact_metadata(resource.contact) + def test_secondary_contacts(self) -> None: + """Check secondary contacts.""" + for prefix, resource in self.registry.items(): + if not resource.contact_extras: + continue + with self.subTest(prefix=prefix): + self.assertIsNotNone(resource.contact) + for contact in resource.contact_extras: + self.assert_contact_metadata(contact) + self.assertNotEqual( + resource.contact.orcid, contact.orcid, msg="duplicate secondary contact" + ) + def test_contact_page(self) -> None: """Test curation of contact page.""" for prefix, resource in self.registry.items():