From d5a1694f85149835b688a7981ffb1491da44bd7b Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Wed, 3 Apr 2024 15:54:06 +0200 Subject: [PATCH] Update URLs (#6) - Add HTTPS for downloads from OBO PURL - Switch to Bioregistry PURLs --- lib/docs/docs/javascript.md | 4 ++-- lib/docs/docs/rust.md | 4 ++-- lib/src/api.rs | 4 ++-- lib/src/sources.rs | 4 ++-- scripts/benchmark_python.py | 2 +- scripts/benchmark_rust.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/docs/docs/javascript.md b/lib/docs/docs/javascript.md index 77a73ae..f1d5026 100644 --- a/lib/docs/docs/javascript.md +++ b/lib/docs/docs/javascript.md @@ -39,10 +39,10 @@ async function main() { }`); // Load from an extended prefix map (string or URI) - const converterFromUrl = await Converter.fromExtendedPrefixMap("https://raw.githubusercontent.com/biopragmatics/bioregistry/main/exports/contexts/bioregistry.epm.json") + const converterFromUrl = await Converter.fromExtendedPrefixMap("https://w3id.org/biopragmatics/bioregistry.epm.json") // Load from a JSON-LD context (string or URI) - const converterFromJsonld = await Converter.fromJsond("http://purl.obolibrary.org/meta/obo_context.jsonld"); + const converterFromJsonld = await Converter.fromJsond("https://purl.obolibrary.org/meta/obo_context.jsonld"); // Load from one of the predefined source const converterFromSource = await getBioregistryConverter(); diff --git a/lib/docs/docs/rust.md b/lib/docs/docs/rust.md index 9892b73..208b0c2 100644 --- a/lib/docs/docs/rust.md +++ b/lib/docs/docs/rust.md @@ -19,10 +19,10 @@ async fn usage_example() -> Result<(), Box> { }"#).await?; // Load from an extended prefix map (string or URI) - let converterFromUrl = Converter::from_extended_prefix_map("https://raw.githubusercontent.com/biopragmatics/bioregistry/main/exports/contexts/bioregistry.epm.json").await?; + let converterFromUrl = Converter::from_extended_prefix_map("https://w3id.org/biopragmatics/bioregistry.epm.json").await?; // Load from a JSON-LD context (string or URI) - let converterFromJsonld = Converter::from_jsonld("http://purl.obolibrary.org/meta/obo_context.jsonld").await?; + let converterFromJsonld = Converter::from_jsonld("https://purl.obolibrary.org/meta/obo_context.jsonld").await?; // Load from one of the predefined source let converterFromSource = get_bioregistry_converter().await?; diff --git a/lib/src/api.rs b/lib/src/api.rs index eeac7cf..6b9e3d0 100644 --- a/lib/src/api.rs +++ b/lib/src/api.rs @@ -158,7 +158,7 @@ impl Converter { /// use curies::{Converter, Record, error::CuriesError}; /// /// fn test_from_jsonld() -> Result<(), CuriesError> { - /// let converter = Converter::from_jsonld("http://purl.obolibrary.org/meta/obo_context.jsonld"); + /// let converter = Converter::from_jsonld("https://purl.obolibrary.org/meta/obo_context.jsonld"); /// Ok(()) /// } /// ``` @@ -196,7 +196,7 @@ impl Converter { /// ``` /// use curies::Converter; /// - /// let converter = Converter::from_extended_prefix_map("https://raw.github.com/biopragmatics/bioregistry/main/exports/contexts/bioregistry.epm.json"); + /// let converter = Converter::from_extended_prefix_map("https://w3id.org/biopragmatics/bioregistry.epm.json"); /// ``` pub async fn from_extended_prefix_map( prefix_map: T, diff --git a/lib/src/sources.rs b/lib/src/sources.rs index fb75274..2ae154a 100644 --- a/lib/src/sources.rs +++ b/lib/src/sources.rs @@ -2,7 +2,7 @@ use crate::{error::CuriesError, Converter}; -/// Get the latest [OBO Foundry context](http://purl.obolibrary.org/meta/obo_context.jsonld). +/// Get the latest [OBO Foundry context](https://purl.obolibrary.org/meta/obo_context.jsonld). /// /// The OBO Foundry context is a simple prefix map stored in a JSON-LD file. /// It contains OBO Foundry preferred prefixes and OBO PURL expansions, @@ -127,5 +127,5 @@ pub async fn get_go_converter() -> Result { /// assert_eq!(uri, "https://www.ncbi.nlm.nih.gov/gene/100010"); /// ``` pub async fn get_bioregistry_converter() -> Result { - Converter::from_extended_prefix_map("https://raw.githubusercontent.com/biopragmatics/bioregistry/main/exports/contexts/bioregistry.epm.json").await + Converter::from_extended_prefix_map("https://w3id.org/biopragmatics/bioregistry.epm.json").await } diff --git a/scripts/benchmark_python.py b/scripts/benchmark_python.py index fa5ba02..2eda92a 100644 --- a/scripts/benchmark_python.py +++ b/scripts/benchmark_python.py @@ -1,7 +1,7 @@ import curies # converter = curies.get_bioregistry_converter() -url = "https://raw.githubusercontent.com/biopragmatics/bioregistry/main/exports/contexts/bioregistry.epm.json" +url = "https://w3id.org/biopragmatics/bioregistry.epm.json" converter = curies.load_extended_prefix_map(url) curie = converter.compress("http://purl.obolibrary.org/obo/DOID_1234") diff --git a/scripts/benchmark_rust.py b/scripts/benchmark_rust.py index 4501a5b..58afd1e 100644 --- a/scripts/benchmark_rust.py +++ b/scripts/benchmark_rust.py @@ -1,7 +1,7 @@ import time from curies_rs import Converter -url = "https://raw.githubusercontent.com/biopragmatics/bioregistry/main/exports/contexts/bioregistry.epm.json" +url = "https://w3id.org/biopragmatics/bioregistry.epm.json" converter = Converter.load_extended_prefix_map(url) start_time = time.time()