Repository: biopragmatics/bioregistry

Issue:
Add prefix [hgvs]
### Prefix

hgvs

### Name

Human Genome Variation Society Nomenclature

### Homepage

https://hgvs-nomenclature.org/stable/background/simple/

### Source Code Repository

https://github.com/HGVSnomenclature/hgvs-nomenclature

### Description

The HGVS Nomenclature is an internationally-recognized standard for the description of DNA, RNA and protein sequence variants. It is used to convey variants in clinical reports and to share variants in publications and databases.

The HGVS Nomenclature is administered by the [HGVS Variant Nomenclature Committee (HVNC)](https://hgvs-nomenclature.org/stable/hvnc/) under the auspices of the [Human Genome Organization (HUGO)](https://hugo-int.org/).

### License

_No response_

### Publications

doi:10.1002/humu.22981 | pubmed:26931183

### Example Local Unique Identifier

NP_003997.1:p.Trp24Cys

### Regular Expression Pattern for Local Unique Identifier

_No response_

### URI Format String

_No response_

### Wikidata Property

P3331

### Contributor Name

Madeline Iseminger

### Contributor GitHub

miseminger

### Contributor ORCiD

 0000-0002-0548-891X

### Contributor Email

miseming@sfu.ca

### Contact Name

_No response_

### Contact ORCiD

_No response_

### Contact GitHub

_No response_

### Contact Email

_No response_

### Additional Comments

_No response_

Discussion:
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/biopragmatics/bioregistry/pull/1035?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biopragmatics) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`cec1841`)](https://app.codecov.io/gh/biopragmatics/bioregistry/commit/cec184109840de15d1cc0c168845b61a3ae2bb3c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biopragmatics) 40.54% compared to head [(`9988a5d`)](https://app.codecov.io/gh/biopragmatics/bioregistry/pull/1035?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biopragmatics) 40.43%.


<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main    #1035      +/-   ##
==========================================
- Coverage   40.54%   40.43%   -0.12%     
==========================================
  Files         148      148              
  Lines        8237     8236       -1     
  Branches     1907     1622     -285     
==========================================
- Hits         3340     3330      -10     
- Misses       4689     4711      +22     
+ Partials      208      195      -13     
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/biopragmatics/bioregistry/pull/1035?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biopragmatics).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biopragmatics).


Patch:
diff --git a/src/bioregistry/app/ui.py b/src/bioregistry/app/ui.py
index 023d64a02..5e19603f7 100644
--- a/src/bioregistry/app/ui.py
+++ b/src/bioregistry/app/ui.py
@@ -303,8 +303,15 @@ def reference(prefix: str, identifier: str):
     )
 
 
+#: this is a hack to make it work when the luid starts with a slash for
+#: ARK, since ARK doesn't actually require a slash. Will break
+#: if there are other LUIDs that actualyl require a slash in front
+ark_hacked_route = ui_blueprint.route("/<prefix>:/<path:identifier>")
+
+
 @ui_blueprint.route("/<prefix>")
 @ui_blueprint.route("/<prefix>:<path:identifier>")
+@ark_hacked_route
 def resolve(prefix: str, identifier: Optional[str] = None):
     """Resolve a CURIE.
 
@@ -314,6 +321,16 @@ def resolve(prefix: str, identifier: Optional[str] = None):
     2. The prefix has a validation pattern and the identifier does not match it
     3. There are no providers available for the URL
     """  # noqa:DAR101,DAR201
+    if ":" in prefix:
+        # A colon might appear in the prefix if there are multiple colons
+        # in the CURIE, since Flask/Werkzeug parses from right to left.
+        # This block reorganizes the parts of the CURIE based on that assumption
+        prefix, middle = prefix.split(":", 1)
+        if identifier:
+            identifier = f"{middle}:{identifier}"
+        else:
+            identifier = middle  # not sure how this could happen, though
+
     _resource = manager.get_resource(prefix)
     if _resource is None:
         return (
diff --git a/src/bioregistry/data/bioregistry.json b/src/bioregistry/data/bioregistry.json
index 40fa09d08..f89740516 100644
--- a/src/bioregistry/data/bioregistry.json
+++ b/src/bioregistry/data/bioregistry.json
@@ -47670,6 +47670,76 @@
       "uri_format": "https://www.genenames.org/tools/search/#!/all?query=$1"
     }
   },
+  "hgvs": {
+    "contact": {
+      "email": "reecehart@gmail.com",
+      "github": "reece",
+      "name": "Reece Hart",
+      "orcid": "0000-0003-3463-0775"
+    },
+    "contributor": {
+      "email": "miseming@sfu.ca",
+      "github": "miseminger",
+      "name": "Madeline Iseminger",
+      "orcid": "0000-0002-0548-891X"
+    },
+    "description": "The HGVS Nomenclature is an internationally-recognized standard for the description of DNA, RNA and protein sequence variants. It is used to convey variants in clinical reports and to share variants in publications and databases. The HGVS Nomenclature is administered by the [HGVS Variant Nomenclature Committee (HVNC)](https://hgvs-nomenclature.org/stable/hvnc/) under the auspices of the [Human Genome Organization (HUGO)](https://hugo-int.org/).",
+    "example": "NP_003997.1:p.Trp24Cys",
+    "example_extras": [
+      "NG_012337.3(NM_003002.4):c.274G>T",
+      "NG_012337.3(NM_003002.4):r.(274g>u)",
+      "NC_000011.10:g.112088970del",
+      "NC_000011.10(NM_001276503.2):c.169+998del",
+      "GRCh38(chr11):g.112088970del"
+    ],
+    "github_request_issue": 1032,
+    "homepage": "https://hgvs-nomenclature.org/stable/background/simple/",
+    "mappings": {
+      "wikidata": "P3331"
+    },
+    "name": "Human Genome Variation Society Nomenclature",
+    "providers": [
+      {
+        "code": "mutalyzer",
+        "description": " The Mutalyzer tool suite is designed to be of help when working with HGVS sequence variant nomenclature descriptions.",
+        "homepage": "https://mutalyzer.nl",
+        "name": "LUMC Mutalyzer 3",
+        "uri_format": "https://mutalyzer.nl/api/description_to_model/$1"
+      }
+    ],
+    "publications": [
+      {
+        "doi": "10.1002/humu.22981",
+        "pubmed": "26931183",
+        "title": "HGVS Recommendations for the Description of Sequence Variants: 2016 Update",
+        "year": 2016
+      },
+      {
+        "doi": "10.1093/bioinformatics/btu630",
+        "pmc": "PMC4287946",
+        "pubmed": "25273102",
+        "title": "A Python package for parsing, validating, mapping and formatting sequence variants using HGVS nomenclature",
+        "year": 2014
+      }
+    ],
+    "references": [
+      "https://github.com/biopragmatics/bioregistry/issues/460"
+    ],
+    "repository": "https://github.com/HGVSnomenclature/hgvs-nomenclature",
+    "reviewer": {
+      "email": "cthoyt@gmail.com",
+      "github": "cthoyt",
+      "name": "Charles Tapley Hoyt",
+      "orcid": "0000-0003-4423-4370"
+    },
+    "wikidata": {
+      "description": "Sequence Variant Nomenclature from the Human Genome Variation Society (HGVS)",
+      "homepage": "https://civic.genome.wustl.edu/#/home",
+      "name": "HGVS nomenclature",
+      "prefix": "P3331",
+      "uri_format": "http://reg.clinicalgenome.org/allele?hgvs=$1"
+    }
+  },
   "hinv.locus": {
     "biocontext": {
       "prefix": "HINV.LOCUS"
@@ -90456,7 +90526,8 @@
         "17170002"
       ],
       "synonyms": [
-        "pubchemsubstance"
+        "pubchemsubstance",
+        "SID"
       ],
       "uri_format": "http://www.ncbi.nlm.nih.gov/sites/entrez?cmd=search&db=pcsubstance&term=$1"
     },
diff --git a/src/bioregistry/data/external/wikidata/curation.tsv b/src/bioregistry/data/external/wikidata/curation.tsv
index 853b27b82..694379c71 100644
--- a/src/bioregistry/data/external/wikidata/curation.tsv
+++ b/src/bioregistry/data/external/wikidata/curation.tsv
@@ -225,7 +225,6 @@ P3288	World Spider Catalog ID		identifier of a taxon in the World Spider Catalog
 P3291	DocCheck Flexikon En ID	http://flexikon.doccheck.com/en/Special:Mainpage	identifier for an article in the English section of DocCheck Flexikon wiki	https://flexikon.doccheck.com/en/$1	Diabetes_mellitus|Interosseus_membrane
 P3292	DocCheck Flexikon De ID	http://flexikon.doccheck.com/de/Spezial:Mainpage	identifier for an article in the German section of the DocCheck wiki	https://flexikon.doccheck.com/de/$1	Herzinfarkt|Ligamentum_ulnocarpale_dorsale
 P3322	Vlinderstichting ID	https://www.vlinderstichting.nl/vlinders	identifier for lepidoptera species in the vlinderstichting database	https://www.vlinderstichting.nl/vlinders/overzicht-vlinders/details-vlinder/?vlinder=$1	874
-P3331	HGVS nomenclature	https://civic.genome.wustl.edu/#/home	Sequence Variant Nomenclature from the Human Genome Variation Society (HGVS)	http://reg.clinicalgenome.org/allele?hgvs=$1	
 P3332	ACM Digital Library citation ID	https://dl.acm.org/	unique identifier for a bibliographic record in the Association for Computing Machinery (ACM) Digital Library	https://dl.acm.org/citation.cfm?id=$1	2872427|2874809
 P3350	World Health Organisation international non-proprietary name numeric ID		a numeric ID for the WHO international non-proprietary drug names collection	https://extranet.who.int/soinn/mod/page/view.php?id=137&inn_n=$1	1058|377|9286
 P3380	FAO 2007 genetic resource ID	https://tools.wmflabs.org/mix-n-match/?mode=catalog_details&catalog=135	(constructed) ID of a domestic animal species or breed in the FAO Animal Genetic resources report 2007 breed		Horse:Württemberger Warmblut (ger.)|Rabbit


Test patch:
diff --git a/tests/test_web/test_ui.py b/tests/test_web/test_ui.py
index 89968f98a..fcaebfc45 100644
--- a/tests/test_web/test_ui.py
+++ b/tests/test_web/test_ui.py
@@ -179,10 +179,18 @@ class TestUI(unittest.TestCase):
         """Test healthy redirects."""
         with self.app.test_client() as client:
             for endpoint in [
-                "metaregistry/miriam/chebi:24867",
-                "chebi:24867",
-                "health/go",
+                "/metaregistry/miriam/chebi:24867",
+                "/chebi:24867",
+                "/ark:53355/cl010066723",
+                "/ark:/53355/cl010066723",  # test if slash at beginning of luid works
+                "/foaf:test/nope",  # test if slash in middle of luid works
+                # this isn't a real FOAF term, but it's just to make sure that the resolver
+                # doesn't blow up on a local unique identifier that has a colon inside it
+                # i.e., foaf should still get properly recognized
+                "/foaf:test:case",
+                "/foaf:test:case:2",
+                "/health/go",
             ]:
                 with self.subTest(endpoint=endpoint):
                     res = client.get(endpoint, follow_redirects=False)
-                    self.assertEqual(302, res.status_code)
+                    self.assertEqual(302, res.status_code)  # , msg=res.text)