Skip to content

core.xref

Cross references to database entries.

A cross reference points at one database entry for a term, e.g., the ChEBI web page for CHEBI:33699. RDFAnnotationData creates one cross reference per provider registered for a collection in the identifiers.org registry.

CrossReference dataclass

CrossReference(name, accession, url)

A database cross reference.

Attributes:

Name Type Description
name str

name of the resource, e.g., ChEBI

accession str

term in the resource, e.g., CHEBI:33699

url str

url of the entry in the resource

to_dict

to_dict()

Convert the cross reference to a dictionary.

validate

validate(warnings=True)

Check that the cross reference has a valid url.

Parameters:

Name Type Description Default
warnings bool

log a warning for an invalid url

True

Returns:

Type Description
bool

True if the url is valid.

is_url

is_url(url)

Check if a string is a valid http(s) or ftp url.

Parameters:

Name Type Description Default
url str

string to check

required

Returns:

Type Description
bool

True if the string is a valid url.