File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed
Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 567567 "is_identifiers": true,
568568 "is_obo": false,
569569 "prefix": "APID.INTERACTIONS"
570- }
570+ },
571+ "provides": "uniprot",
572+ "type": "provider"
571573 },
572574 "apo": {
573575 "bioportal": {
2399023992 }
2399123993 },
2399223994 "validatordb": {
23995+ "example": "2h6o",
2399323996 "miriam": {
2399423997 "deprecated": false,
2399523998 "description": "Database of validation results for ligands and non-standard residues in the Protein Data Bank.",
2400824011 "is_identifiers": true,
2400924012 "is_obo": false,
2401024013 "prefix": "VALIDATORDB"
24011- }
24014+ },
24015+ "provides": "pdb",
24016+ "type": "provider",
24017+ "url": "https://webchem.ncbr.muni.cz/Platform/ValidatorDb/ByStructure/$1"
2401224018 },
2401324019 "vandf": {
2401424020 "biolink": {
Original file line number Diff line number Diff line change @@ -292,6 +292,36 @@ def get_owl_download(prefix: str) -> Optional[str]:
292292 return entry .get ('ols' , {}).get ('version.iri' )
293293
294294
295+ def is_provider (prefix : str ) -> bool :
296+ """Get if the prefix is a provider.
297+
298+ :param prefix: The prefix to look up
299+ :returns: if the prefix is a provider
300+
301+ >>> assert not is_provider('pdb')
302+ >>> assert is_provider('validatordb')
303+ """
304+ entry = get (prefix )
305+ if entry is None :
306+ return False
307+ return entry .get ('type' ) == 'provider'
308+
309+
310+ def get_provides_for (prefix : str ) -> Optional [str ]:
311+ """Get the resource that the given prefix provides for, or return none if not a provider.
312+
313+ :param prefix: The prefix to look up
314+ :returns: The prefix of the resource that the given prefix provides for, if it's a provider
315+
316+ >>> assert get_provides_for('pdb') is None
317+ >>> assert 'pdb' == get_provides_for('validatordb')
318+ """
319+ entry = get (prefix )
320+ if entry is None :
321+ return None
322+ return entry .get ('provides' )
323+
324+
295325def parse_curie (curie : str ) -> Union [Tuple [str , str ], Tuple [None , None ]]:
296326 """Parse a CURIE, normalizing the prefix and identifier if necessary.
297327
You can’t perform that action at this time.
0 commit comments