Skip to content

Commit

Permalink
Merge branch 'main' into add-case-synonyms
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Nov 2, 2023
2 parents acc57c5 + fe07b38 commit 50d3208
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 32 deletions.
2 changes: 1 addition & 1 deletion exports/contexts/obo.context.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
"PLANA": "http://purl.obolibrary.org/obo/PLANA_",
"PLANP": "http://purl.obolibrary.org/obo/PLANP_",
"PLO": "http://purl.obolibrary.org/obo/PLO_",
"PMID": "http://rdf.ncbi.nlm.nih.gov/pubchem/reference/",
"PMID": "https://www.ncbi.nlm.nih.gov/pubmed/",
"PO": "http://purl.obolibrary.org/obo/PO_",
"PORO": "http://purl.obolibrary.org/obo/PORO_",
"PPO": "http://purl.obolibrary.org/obo/PPO_",
Expand Down
2 changes: 1 addition & 1 deletion exports/contexts/obo.context.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
[ sh:prefix "PLANA" ; sh:namespace "http://purl.obolibrary.org/obo/PLANA_"^^xsd:anyURI ; sh:pattern "^\\d{7}$" ],
[ sh:prefix "PLANP" ; sh:namespace "http://purl.obolibrary.org/obo/PLANP_"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "PLO" ; sh:namespace "http://purl.obolibrary.org/obo/PLO_"^^xsd:anyURI ],
[ sh:prefix "PMID" ; sh:namespace "http://rdf.ncbi.nlm.nih.gov/pubchem/reference/"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "PMID" ; sh:namespace "https://www.ncbi.nlm.nih.gov/pubmed/"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "PO" ; sh:namespace "http://purl.obolibrary.org/obo/PO_"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "PORO" ; sh:namespace "http://purl.obolibrary.org/obo/PORO_"^^xsd:anyURI ; sh:pattern "^\\d{7}$" ],
[ sh:prefix "PPO" ; sh:namespace "http://purl.obolibrary.org/obo/PPO_"^^xsd:anyURI ; sh:pattern "^\\d{7}$" ],
Expand Down
20 changes: 13 additions & 7 deletions exports/contexts/obo.epm.json
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,7 @@
"prefix_synonyms": [
"Ensembl",
"astd",
"ensembl",
"ensembl.bacteria",
"ensembl.fungi"
],
Expand Down Expand Up @@ -2523,7 +2524,8 @@
"prefix_synonyms": [
"ICD",
"ICD-10",
"ICD10"
"ICD10",
"icd10"
],
"uri_prefix": "https://icd.who.int/browse10/2019/en#/",
"uri_prefix_synonyms": [
Expand Down Expand Up @@ -4147,7 +4149,8 @@
"pattern": "^C?\\d+$",
"prefix": "Orphanet",
"prefix_synonyms": [
"ordo"
"ordo",
"orphanet.ordo"
],
"uri_prefix": "http://www.orpha.net/ORDO/Orphanet_",
"uri_prefix_synonyms": [
Expand Down Expand Up @@ -4360,9 +4363,10 @@
"prefix_synonyms": [
"MEDLINE",
"PubMed",
"pmid"
"pmid",
"pubmed"
],
"uri_prefix": "http://rdf.ncbi.nlm.nih.gov/pubchem/reference/",
"uri_prefix": "https://www.ncbi.nlm.nih.gov/pubmed/",
"uri_prefix_synonyms": [
"http://bio2rdf.org/pubmed:",
"http://bioregistry.io/MEDLINE:",
Expand All @@ -4378,6 +4382,7 @@
"http://pubmed.ncbi.nlm.nih.gov/",
"http://purl.uniprot.org/citations/",
"http://purl.uniprot.org/pubmed/",
"http://rdf.ncbi.nlm.nih.gov/pubchem/reference/",
"http://scholia.toolforge.org/pubmed/",
"http://www.hubmed.org/display.cgi?uids=",
"http://www.ncbi.nlm.nih.gov/pubmed/",
Expand All @@ -4397,8 +4402,7 @@
"https://purl.uniprot.org/pubmed/",
"https://rdf.ncbi.nlm.nih.gov/pubchem/reference/",
"https://scholia.toolforge.org/pubmed/",
"https://www.hubmed.org/display.cgi?uids=",
"https://www.ncbi.nlm.nih.gov/pubmed/"
"https://www.hubmed.org/display.cgi?uids="
]
},
{
Expand Down Expand Up @@ -4870,7 +4874,8 @@
"SNOMED_CT_US_2018_03_01",
"SNOWMEDCT",
"SNOWMEDCT_US",
"SNOWMEDCT_US_2018_03_01"
"SNOWMEDCT_US_2018_03_01",
"snomedct"
],
"uri_prefix": "http://snomed.info/id/",
"uri_prefix_synonyms": [
Expand Down Expand Up @@ -5355,6 +5360,7 @@
"UMLS CUI",
"UMLS_CUI",
"sider.effect",
"umls",
"umls.cui"
],
"uri_prefix": "http://linkedlifedata.com/resource/umls/id/",
Expand Down
14 changes: 10 additions & 4 deletions exports/contexts/obo_synonyms.context.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
"MC": "http://purl.obolibrary.org/obo/MC_",
"MCO": "http://purl.obolibrary.org/obo/MCO_",
"MCRO": "http://purl.obolibrary.org/obo/MCRO_",
"MEDLINE": "http://rdf.ncbi.nlm.nih.gov/pubchem/reference/",
"MEDLINE": "https://www.ncbi.nlm.nih.gov/pubmed/",
"MEDRA": "http://purl.bioontology.org/ontology/MDRFRE/",
"MESH": "http://id.nlm.nih.gov/mesh/",
"MESHA": "http://id.nlm.nih.gov/mesh/",
Expand Down Expand Up @@ -437,7 +437,7 @@
"PLO": "http://purl.obolibrary.org/obo/PLO_",
"PMC": "http://europepmc.org/articles/",
"PMCID": "http://europepmc.org/articles/",
"PMID": "http://rdf.ncbi.nlm.nih.gov/pubchem/reference/",
"PMID": "https://www.ncbi.nlm.nih.gov/pubmed/",
"PO": "http://purl.obolibrary.org/obo/PO_",
"PORO": "http://purl.obolibrary.org/obo/PORO_",
"PPO": "http://purl.obolibrary.org/obo/PPO_",
Expand All @@ -459,7 +459,7 @@
"Progenetix": "https://progenetix.org/services/ids/",
"PuRO": "http://purl.org/spar/pro/",
"PubChem_Compound_CID": "http://rdf.ncbi.nlm.nih.gov/pubchem/compound/CID",
"PubMed": "http://rdf.ncbi.nlm.nih.gov/pubchem/reference/",
"PubMed": "https://www.ncbi.nlm.nih.gov/pubmed/",
"Pubchem": "http://rdf.ncbi.nlm.nih.gov/pubchem/compound/CID",
"RBO": "http://purl.obolibrary.org/obo/RBO_",
"RCSB_PDB": "https://rdf.wwpdb.org/pdb/",
Expand Down Expand Up @@ -996,6 +996,7 @@
"ena.embl": "https://www.ebi.ac.uk/ena/browser/view/",
"encode": "https://www.encodeproject.org/",
"enm": "http://purl.enanomapper.org/onto/ENM_",
"ensembl": "http://rdf.ebi.ac.uk/resource/ensembl/",
"ensembl.bacteria": "http://rdf.ebi.ac.uk/resource/ensembl/",
"ensembl.fungi": "http://rdf.ebi.ac.uk/resource/ensembl/",
"ensembl.metazoa": "https://metazoa.ensembl.org/id/",
Expand Down Expand Up @@ -1212,6 +1213,7 @@
"huge": "https://www.kazusa.or.jp/huge/gfpage/",
"hypercldb": "https://identifiers.org/cldb:",
"h\u00f6lzel": "https://www.hoelzel-biotech.com/de/catalogsearch/result/?q=",
"icd10": "https://icd.who.int/browse10/2019/en#/",
"icd10cm": "https://icd.codes/icd10cm/",
"icd10pcs": "https://www.findacode.com/code.php?set=ICD10PCS&c=",
"icd11": "https://icd.who.int/browse11/l-m/en#/http://id.who.int/icd/entity/",
Expand Down Expand Up @@ -1569,6 +1571,7 @@
"oridb.sacch": "http://cerevisiae.oridb.org/details.php?id=",
"oridb.schizo": "http://pombe.oridb.org/details.php?id=",
"orphanet": "http://www.orpha.net/consor/cgi-bin/OC_Exp.php?Lng=EN&Expert=",
"orphanet.ordo": "http://www.orpha.net/ORDO/Orphanet_",
"orth": "http://purl.org/net/orth#",
"orthodb": "http://purl.uniprot.org/uniprot/",
"oryzabase.gene": "http://www.shigen.nig.ac.jp/rice/oryzabaseV4/gene/detail/",
Expand Down Expand Up @@ -1654,7 +1657,7 @@
"pmap.substratedb": "https://identifiers.org/pmap.substratedb:",
"pmc": "http://europepmc.org/articles/",
"pmdb": "https://bioinformatics.cineca.it/PMDB/user//search.php?idsearch=",
"pmid": "http://rdf.ncbi.nlm.nih.gov/pubchem/reference/",
"pmid": "https://www.ncbi.nlm.nih.gov/pubmed/",
"pmp": "http://purl.uniprot.org/uniprot/",
"pmr": "https://models.physiomeproject.org/exposure/",
"pmr.workspace": "https://models.physiomeproject.org/workspace/",
Expand Down Expand Up @@ -1694,6 +1697,7 @@
"pubchem_id": "http://rdf.ncbi.nlm.nih.gov/pubchem/compound/CID",
"publons.publication": "https://publons.com/publon/",
"publons.researcher": "https://publons.com/researcher/",
"pubmed": "https://www.ncbi.nlm.nih.gov/pubmed/",
"px": "http://proteomecentral.proteomexchange.org/cgi/GetDataset?ID=",
"pypi": "https://pypi.org/project/",
"qb": "http://purl.org/linked-data/cube#",
Expand Down Expand Up @@ -1824,6 +1828,7 @@
"smid": "https://smid-db.org/smid/",
"smpdb": "https://smpdb.ca/view/",
"snap": "http://www.ifomis.org/bfo/1.1/snap#",
"snomedct": "http://snomed.info/id/",
"snornabase": "http://www-snorna.biotoul.fr/plus.php?id=",
"snp2tfbs": "https://www.ncbi.nlm.nih.gov/snp/",
"snp500cancer": "http://snp500cancer.nci.nih.gov/snp.cfm?both_snp_id=",
Expand Down Expand Up @@ -1905,6 +1910,7 @@
"umbbd.pathway": "http://umbbd.ethz.ch/servlets/pageservlet?ptype=p&pathway_abbr=",
"umbbd.reaction": "http://eawag-bbd.ethz.ch/servlets/pageservlet?ptype=r&reacID=",
"umbbd.rule": "http://www.umbbd.ethz.ch/servlets/rule.jsp?rule=",
"umls": "http://linkedlifedata.com/resource/umls/id/",
"umls.cui": "http://linkedlifedata.com/resource/umls/id/",
"umls.st": "https://uts.nlm.nih.gov/uts/umls/semantic-network/",
"umls.sty": "https://uts.nlm.nih.gov/uts/umls/semantic-network/",
Expand Down
14 changes: 10 additions & 4 deletions exports/contexts/obo_synonyms.context.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
[ sh:prefix "ENSEMBL" ; sh:namespace "http://rdf.ebi.ac.uk/resource/ensembl/"^^xsd:anyURI ; sh:pattern "^((ENS[FPTG]\\d{11}(\\.\\d+)?)|(FB\\w{2}\\d{7})|(Y[A-Z]{2}\\d{3}[a-zA-Z](\\-[A-Z])?)|([A-Z_a-z0-9]+(\\.)?(t)?(\\d+)?([a-z])?))$" ],
[ sh:prefix "Ensembl" ; sh:namespace "http://rdf.ebi.ac.uk/resource/ensembl/"^^xsd:anyURI ; sh:pattern "^((ENS[FPTG]\\d{11}(\\.\\d+)?)|(FB\\w{2}\\d{7})|(Y[A-Z]{2}\\d{3}[a-zA-Z](\\-[A-Z])?)|([A-Z_a-z0-9]+(\\.)?(t)?(\\d+)?([a-z])?))$" ],
[ sh:prefix "astd" ; sh:namespace "http://rdf.ebi.ac.uk/resource/ensembl/"^^xsd:anyURI ; sh:pattern "^((ENS[FPTG]\\d{11}(\\.\\d+)?)|(FB\\w{2}\\d{7})|(Y[A-Z]{2}\\d{3}[a-zA-Z](\\-[A-Z])?)|([A-Z_a-z0-9]+(\\.)?(t)?(\\d+)?([a-z])?))$" ],
[ sh:prefix "ensembl" ; sh:namespace "http://rdf.ebi.ac.uk/resource/ensembl/"^^xsd:anyURI ; sh:pattern "^((ENS[FPTG]\\d{11}(\\.\\d+)?)|(FB\\w{2}\\d{7})|(Y[A-Z]{2}\\d{3}[a-zA-Z](\\-[A-Z])?)|([A-Z_a-z0-9]+(\\.)?(t)?(\\d+)?([a-z])?))$" ],
[ sh:prefix "ensembl.bacteria" ; sh:namespace "http://rdf.ebi.ac.uk/resource/ensembl/"^^xsd:anyURI ; sh:pattern "^((ENS[FPTG]\\d{11}(\\.\\d+)?)|(FB\\w{2}\\d{7})|(Y[A-Z]{2}\\d{3}[a-zA-Z](\\-[A-Z])?)|([A-Z_a-z0-9]+(\\.)?(t)?(\\d+)?([a-z])?))$" ],
[ sh:prefix "ensembl.fungi" ; sh:namespace "http://rdf.ebi.ac.uk/resource/ensembl/"^^xsd:anyURI ; sh:pattern "^((ENS[FPTG]\\d{11}(\\.\\d+)?)|(FB\\w{2}\\d{7})|(Y[A-Z]{2}\\d{3}[a-zA-Z](\\-[A-Z])?)|([A-Z_a-z0-9]+(\\.)?(t)?(\\d+)?([a-z])?))$" ],
[ sh:prefix "ENVO" ; sh:namespace "http://purl.obolibrary.org/obo/ENVO_"^^xsd:anyURI ; sh:pattern "^\\d{7,8}$" ],
Expand Down Expand Up @@ -194,6 +195,7 @@
[ sh:prefix "ICD" ; sh:namespace "https://icd.who.int/browse10/2019/en#/"^^xsd:anyURI ; sh:pattern "^(([XVI]+)|([A-Z][0-9]+((-[A-Z][0-9]+)|(\\.[0-9]))?))$" ],
[ sh:prefix "ICD-10" ; sh:namespace "https://icd.who.int/browse10/2019/en#/"^^xsd:anyURI ; sh:pattern "^(([XVI]+)|([A-Z][0-9]+((-[A-Z][0-9]+)|(\\.[0-9]))?))$" ],
[ sh:prefix "ICD10" ; sh:namespace "https://icd.who.int/browse10/2019/en#/"^^xsd:anyURI ; sh:pattern "^(([XVI]+)|([A-Z][0-9]+((-[A-Z][0-9]+)|(\\.[0-9]))?))$" ],
[ sh:prefix "icd10" ; sh:namespace "https://icd.who.int/browse10/2019/en#/"^^xsd:anyURI ; sh:pattern "^(([XVI]+)|([A-Z][0-9]+((-[A-Z][0-9]+)|(\\.[0-9]))?))$" ],
[ sh:prefix "ICEO" ; sh:namespace "http://purl.obolibrary.org/obo/ICEO_"^^xsd:anyURI ; sh:pattern "^\\d{7}(_\\d)?$" ],
[ sh:prefix "ICO" ; sh:namespace "http://purl.obolibrary.org/obo/ICO_"^^xsd:anyURI ; sh:pattern "^\\d{7}$" ],
[ sh:prefix "IDO" ; sh:namespace "http://purl.obolibrary.org/obo/IDO_"^^xsd:anyURI ; sh:pattern "^[0-9]+$" ],
Expand Down Expand Up @@ -322,6 +324,7 @@
[ sh:prefix "OlatDv" ; sh:namespace "http://purl.obolibrary.org/obo/OlatDv_"^^xsd:anyURI ; sh:pattern "^\\d{7}$" ],
[ sh:prefix "Orphanet" ; sh:namespace "http://www.orpha.net/ORDO/Orphanet_"^^xsd:anyURI ; sh:pattern "^C?\\d+$" ],
[ sh:prefix "ordo" ; sh:namespace "http://www.orpha.net/ORDO/Orphanet_"^^xsd:anyURI ; sh:pattern "^C?\\d+$" ],
[ sh:prefix "orphanet.ordo" ; sh:namespace "http://www.orpha.net/ORDO/Orphanet_"^^xsd:anyURI ; sh:pattern "^C?\\d+$" ],
[ sh:prefix "PAO" ; sh:namespace "http://purl.obolibrary.org/obo/PAO_"^^xsd:anyURI ],
[ sh:prefix "PATO" ; sh:namespace "http://purl.obolibrary.org/obo/PATO_"^^xsd:anyURI ; sh:pattern "^\\d{7}$" ],
[ sh:prefix "PBA" ; sh:namespace "https://biopragmatics.github.io/providers/pba/"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
Expand All @@ -335,10 +338,11 @@
[ sh:prefix "PLANA" ; sh:namespace "http://purl.obolibrary.org/obo/PLANA_"^^xsd:anyURI ; sh:pattern "^\\d{7}$" ],
[ sh:prefix "PLANP" ; sh:namespace "http://purl.obolibrary.org/obo/PLANP_"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "PLO" ; sh:namespace "http://purl.obolibrary.org/obo/PLO_"^^xsd:anyURI ],
[ sh:prefix "PMID" ; sh:namespace "http://rdf.ncbi.nlm.nih.gov/pubchem/reference/"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "MEDLINE" ; sh:namespace "http://rdf.ncbi.nlm.nih.gov/pubchem/reference/"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "PubMed" ; sh:namespace "http://rdf.ncbi.nlm.nih.gov/pubchem/reference/"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "pmid" ; sh:namespace "http://rdf.ncbi.nlm.nih.gov/pubchem/reference/"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "PMID" ; sh:namespace "https://www.ncbi.nlm.nih.gov/pubmed/"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "MEDLINE" ; sh:namespace "https://www.ncbi.nlm.nih.gov/pubmed/"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "PubMed" ; sh:namespace "https://www.ncbi.nlm.nih.gov/pubmed/"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "pmid" ; sh:namespace "https://www.ncbi.nlm.nih.gov/pubmed/"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "pubmed" ; sh:namespace "https://www.ncbi.nlm.nih.gov/pubmed/"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "PO" ; sh:namespace "http://purl.obolibrary.org/obo/PO_"^^xsd:anyURI ; sh:pattern "^\\d+$" ],
[ sh:prefix "PORO" ; sh:namespace "http://purl.obolibrary.org/obo/PORO_"^^xsd:anyURI ; sh:pattern "^\\d{7}$" ],
[ sh:prefix "PPO" ; sh:namespace "http://purl.obolibrary.org/obo/PPO_"^^xsd:anyURI ; sh:pattern "^\\d{7}$" ],
Expand Down Expand Up @@ -398,6 +402,7 @@
[ sh:prefix "SNOWMEDCT" ; sh:namespace "http://snomed.info/id/"^^xsd:anyURI ; sh:pattern "^(\\w+)?\\d+$" ],
[ sh:prefix "SNOWMEDCT_US" ; sh:namespace "http://snomed.info/id/"^^xsd:anyURI ; sh:pattern "^(\\w+)?\\d+$" ],
[ sh:prefix "SNOWMEDCT_US_2018_03_01" ; sh:namespace "http://snomed.info/id/"^^xsd:anyURI ; sh:pattern "^(\\w+)?\\d+$" ],
[ sh:prefix "snomedct" ; sh:namespace "http://snomed.info/id/"^^xsd:anyURI ; sh:pattern "^(\\w+)?\\d+$" ],
[ sh:prefix "SCoRO" ; sh:namespace "http://purl.org/spar/scoro/"^^xsd:anyURI ],
[ sh:prefix "SEP" ; sh:namespace "http://purl.obolibrary.org/obo/SEP_"^^xsd:anyURI ; sh:pattern "^\\d{5,6}$" ],
[ sh:prefix "SEPIO" ; sh:namespace "http://purl.obolibrary.org/obo/SEPIO_"^^xsd:anyURI ; sh:pattern "^\\d{7}$" ],
Expand Down Expand Up @@ -430,6 +435,7 @@
[ sh:prefix "UMLS CUI" ; sh:namespace "http://linkedlifedata.com/resource/umls/id/"^^xsd:anyURI ; sh:pattern "^C\\d+$" ],
[ sh:prefix "UMLS_CUI" ; sh:namespace "http://linkedlifedata.com/resource/umls/id/"^^xsd:anyURI ; sh:pattern "^C\\d+$" ],
[ sh:prefix "sider.effect" ; sh:namespace "http://linkedlifedata.com/resource/umls/id/"^^xsd:anyURI ; sh:pattern "^C\\d+$" ],
[ sh:prefix "umls" ; sh:namespace "http://linkedlifedata.com/resource/umls/id/"^^xsd:anyURI ; sh:pattern "^C\\d+$" ],
[ sh:prefix "umls.cui" ; sh:namespace "http://linkedlifedata.com/resource/umls/id/"^^xsd:anyURI ; sh:pattern "^C\\d+$" ],
[ sh:prefix "UO" ; sh:namespace "http://purl.obolibrary.org/obo/UO_"^^xsd:anyURI ; sh:pattern "^\\d{7}$" ],
[ sh:prefix "UPA" ; sh:namespace "http://purl.obolibrary.org/obo/UPA_"^^xsd:anyURI ; sh:pattern "^(UCR|UCY|UER|ULS|UPA|UPC|UPX)\\d{5}$" ],
Expand Down
18 changes: 10 additions & 8 deletions src/bioregistry/record_accumulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,32 +117,35 @@ def get_converter(
strict: bool = False,
blacklist: Optional[Collection[str]] = None,
remapping: Optional[Mapping[str, str]] = None,
rewiring: Optional[Mapping[str, str]] = None,
) -> Converter:
"""Generate a converter from resources."""
records = get_records(
records = _get_records(
resources,
prefix_priority=prefix_priority,
uri_prefix_priority=uri_prefix_priority,
include_prefixes=include_prefixes,
strict=strict,
blacklist=blacklist,
remapping=remapping,
)
return curies.Converter(records)
converter = curies.Converter(records)
if remapping:
converter = curies.remap_curie_prefixes(converter, remapping)
if rewiring:
converter = curies.rewire(converter, rewiring)
return converter


def get_records( # noqa: C901
def _get_records( # noqa: C901
resources: List[Resource],
prefix_priority: Optional[Sequence[str]] = None,
uri_prefix_priority: Optional[Sequence[str]] = None,
include_prefixes: bool = False,
strict: bool = False,
blacklist: Optional[Collection[str]] = None,
remapping: Optional[Mapping[str, str]] = None,
) -> List[curies.Record]:
"""Generate records from resources."""
blacklist = set(blacklist or []).union(prefix_blacklist)
remapping = dict(remapping or {})
resource_dict: Mapping[str, Resource] = {
resource.prefix: resource
for resource in resources
Expand All @@ -153,8 +156,7 @@ def get_records( # noqa: C901
for resource in resource_dict.values()
}
primary_prefixes: Dict[str, str] = {
resource.prefix: remapping.get(resource.prefix)
or resource.get_priority_prefix(priority=prefix_priority)
resource.prefix: resource.get_priority_prefix(priority=prefix_priority)
for resource in resource_dict.values()
}
dd = defaultdict(list)
Expand Down
Loading

0 comments on commit 50d3208

Please sign in to comment.