Skip to content

Commit

Permalink
Update URLs (#6)
Browse files Browse the repository at this point in the history
- Add HTTPS for downloads from OBO PURL
- Switch to Bioregistry PURLs
  • Loading branch information
cthoyt committed Apr 3, 2024
1 parent 6071940 commit d5a1694
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/docs/docs/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions lib/docs/docs/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ async fn usage_example() -> Result<(), Box<dyn std::error::Error>> {
}"#).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?;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
/// }
/// ```
Expand Down Expand Up @@ -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<T: ExtendedPrefixMapSource>(
prefix_map: T,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -127,5 +127,5 @@ pub async fn get_go_converter() -> Result<Converter, CuriesError> {
/// assert_eq!(uri, "https://www.ncbi.nlm.nih.gov/gene/100010");
/// ```
pub async fn get_bioregistry_converter() -> Result<Converter, CuriesError> {
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
}
2 changes: 1 addition & 1 deletion scripts/benchmark_python.py
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
2 changes: 1 addition & 1 deletion scripts/benchmark_rust.py
Original file line number Diff line number Diff line change
@@ -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()
Expand Down

0 comments on commit d5a1694

Please sign in to comment.