partOf_iri returns the IRI of the canonical "part_of" relationship in the database.

hasPart_iri returns the IRI of the canonical "has_part" relationship in the database.

developsFrom_iri returns the IRI of the canonical "develops from" relationship in the database.

Provides cached access to IRIs of terms and properties that are frequently used.

partOf_iri()

hasPart_iri()

developsFrom_iri()

term_iri(label, type = "owl:Class", preferOntologies = NULL, firstOnly = TRUE)

Arguments

label

character, the label of the term for which to obtain the IRI

type

character, the type of the term, as a IRI or using common namespace prefixes such as "owl", "rdf", etc. For example, "owl:Class", or "owl:ObjectProperty". The default is "owl:Class".

preferOntologies

character, an array of ontologies to use for preference. In the case of multiple matches, matches will be reordered in the order given, and if matches are from preferred and other ontologies, those from ontologies not in the preference list will be discarded. If provided and only matches from ontologies not in the preference list are found, they will not be cached. Can be provided as OBO ontology prefixes, or full ontology IRIs. The default is no preferences.

firstOnly

boolean, whether to return only the first match in case of multiple matches. The default is TRUE.

Value

Character, the IRI(s) for the requested term or property.

Details

Requested IRIs are not hard-coded. Instead, they are dynamically retrieved from the API when first queried, and (depending on parameters) are subsequently held in cache in the session. Hence, if they were to change in the database, the R session would need to be restarted for this change to be reflected in the result.

For the frequently needed properties "part of", "has part" etc, one should use the predefined functions (partOf_iri(), hasPart_iri()), so that the correct matches are cached and used internally by the package.

Examples

term_iri("part of", type = "owl:ObjectProperty", preferOntologies = c("RO", "BFO"))
#> [1] "http://purl.obolibrary.org/obo/BFO_0000050"
term_iri("develops from", type = "owl:ObjectProperty", preferOntologies = c("RO"))
#> [1] "http://purl.obolibrary.org/obo/RO_0002202"
term_iri("anatomical structure", firstOnly = FALSE)
#> [1] "http://purl.obolibrary.org/obo/CARO_0000003"  
#> [2] "http://purl.obolibrary.org/obo/UBERON_0000061"