Repository: biopragmatics/bioregistry

Issue:
Extend provider data model
Include a list of publications in the `Provider` data model. 

https://github.com/biopragmatics/bioregistry/blob/22f53b4105ab6b5eb0e41ea749582833c6cbcd0c/src/bioregistry/schema/struct.py#L232

This should be easy to incorporate since there's already a model for `Publication`

https://github.com/biopragmatics/bioregistry/blob/22f53b4105ab6b5eb0e41ea749582833c6cbcd0c/src/bioregistry/schema/struct.py#L257

It also needs to get propagated upwards to 

https://github.com/biopragmatics/bioregistry/blob/22f53b4105ab6b5eb0e41ea749582833c6cbcd0c/src/bioregistry/schema/struct.py#L1243

Discussion:

Patch:
diff --git a/src/bioregistry/data/bioregistry.json b/src/bioregistry/data/bioregistry.json
index a094c04d7..d71be1682 100644
--- a/src/bioregistry/data/bioregistry.json
+++ b/src/bioregistry/data/bioregistry.json
@@ -49460,6 +49460,22 @@
         "description": "A large scale database of biomedical statements.",
         "homepage": "https://db.indra.bio",
         "name": "INDRA Database",
+        "publications": [
+          {
+            "doi": "PMC5731347",
+            "pmc": "10.15252/msb.20177651",
+            "pubmed": " 29175850",
+            "title": "From word models to executable models of signaling networks using automated assembly",
+            "year": 2017
+          },
+          {
+            "doi": "10.15252/msb.202211325",
+            "pmc": "PMC10167483",
+            "pubmed": "36938926",
+            "title": "Automated assembly of molecular mechanisms at scale from text mining and curated databases",
+            "year": 2023
+          }
+        ],
         "uri_format": "https://db.indra.bio/statements/from_agents?&format=html&agent0=$1@HGNC"
       },
       {
diff --git a/src/bioregistry/schema/struct.py b/src/bioregistry/schema/struct.py
index 97f4042e0..589e90edd 100644
--- a/src/bioregistry/schema/struct.py
+++ b/src/bioregistry/schema/struct.py
@@ -244,6 +244,10 @@ class Provider(BaseModel):
     first_party: Optional[bool] = Field(
         None, description="Annotates whether a provider is from the first-party organization"
     )
+    publications: Optional[List["Publication"]] = Field(
+        default=None,
+        description="A list of publications about the provider. See the `indra` provider for `hgnc` for an example.",
+    )
 
     def resolve(self, identifier: str) -> str:
         """Resolve the identifier into a URI.
@@ -287,6 +291,13 @@ class Publication(BaseModel):
                 return f"https://bioregistry.io/{prefix}:{identifier}"
         raise ValueError("no fields were full")
 
+    def _matches_any_field(self, other: "Publication") -> bool:
+        return (
+            (self.pubmed is not None and self.pubmed == other.pubmed)
+            or (self.doi is not None and self.doi == other.doi)
+            or (self.pmc is not None and self.pmc == other.pmc)
+        )
+
 
 class Resource(BaseModel):
     """Metadata about an ontology, database, or other resource."""
@@ -1296,6 +1307,8 @@ class Resource(BaseModel):
         if self.uniprot:
             for publication in self.uniprot.get("publications", []):
                 publications.append(Publication.parse_obj(publication))
+        for provider in self.providers or []:
+            publications.extend(provider.publications or [])
         return deduplicate_publications(publications)
 
     def get_mastodon(self) -> Optional[str]:


Test patch:
diff --git a/tests/test_data.py b/tests/test_data.py
index 3496a674a..e99605df4 100644
--- a/tests/test_data.py
+++ b/tests/test_data.py
@@ -2,6 +2,7 @@
 
 """Tests for data integrity."""
 
+import itertools as itt
 import json
 import logging
 import re
@@ -676,6 +677,8 @@ class TestRegistry(unittest.TestCase):
         for prefix, resource in self.registry.items():
             if not resource.providers:
                 continue
+
+            publications = resource.publications or []
             for provider in resource.providers:
                 with self.subTest(prefix=prefix, code=provider.code):
                     self.assertNotEqual(provider.code, prefix)
@@ -697,6 +700,15 @@ class TestRegistry(unittest.TestCase):
                         msg="Multiple parameters not supported. See discussion on "
                         "https://github.com/biopragmatics/bioregistry/issues/933",
                     )
+                    # check that none of the publications are duplicates of ones in the main record
+                    for publication, other in itt.product(
+                        provider.publications or [], publications
+                    ):
+                        self.assertFalse(
+                            publication._matches_any_field(other),
+                            msg=f"provider publication {publication.title} should not appear "
+                            f"in prefix publication list (appears as {other.title})",
+                        )
 
     def test_namespace_in_lui(self):
         """Test having the namespace in LUI requires a banana annotation.