as.terminfo creates an object (or a list of objects) of type "terminfo". The object to be coerced can be a character vector (of term IRIs), or a data.frame. In the latter case, there must be a column "id" with term IRIs. If the object is already of type "terminfo", a new terminfo object will be created so options such as withClassification will be applied.

is.terminfo tests whether an object is of type "terminfo"

is_valid_terminfo tests which of the objects in the list are valid terminfo objects, and returns a logical vector of the same length as x. An object is a valid terminfo object if it is of type "terminfo" and its IRI has been found in the database.

print pretty-prints objects of type "terminfo"

as.terminfo(
  x,
  withClassification = getOption("rphenoscape.fetch.classification", default = FALSE),
  ...
)

is.terminfo(x)

is_valid_terminfo(x)

# S3 method for terminfo
print(x, ...)

Arguments

x

an object of type "terminfo" or coercible to it, or to be tested for being of type "terminfo"

withClassification

logical. If TRUE classification data will be available through the terminfo object at key "classification". Default is FALSE, because obtaining taxa requires an additional query per object. The default can be customized by setting the "rphenoscape.fetch.classification" option.

...

additional parameters where applicable

Value

as.terminfo returns and object of type "terminfo", or a list of such objects if the object to be coerced had multiple elements (if a vector) or rows (if a data.frame). A terminfo object has properties "id" (ID, i.e., IRI of the term), "label" (label of the term if one exists). If the term is a taxon additional properties will be populated: "extinct", "rank", "common_name". If withClassification is TRUE,there will also be a key "classification" (a list with properties "subClassOf", "equivalentTo" and "superClassOf").

is.terminfo returns TRUE if the object is of type "terminfo" and FALSE otherwise.

is_valid_terminfo returns a logical vector of the same length as the input array of objects, with TRUE for those objects in the list that are of type "terminfo" and correspond to a term in the database.

Details

Create and test objects of type "terminfo", and extract properties from them.

Examples

# find a term iri
term_iri <- find_term('basihyal bone', matchType='exact')
# turn it into a terminfo object
obj <- as.terminfo(term_iri)
class(obj)
#> [1] "terminfo" "list"    
obj
#> terminfo 'basihyal bone' http://purl.obolibrary.org/obo/UBERON_0011618
#> Definition: Replacement bone that is median and is the anterior-most bone of the ventral hyoid arch.
#> Synonyms:
#>     basihyoid (exact)
#>     glossohyal (exact)
#> Relationships:
#>     develops from basihyal cartilage
#> Subclass of:
#>     anatomical entity and develops from some basihyal cartilage
#>     basihyal element
#>     endochondral bone
#>     structure with developmental contribution from neural crest
#> Superclass of:
#>     basihyal bone (zebrafish)

# classification details can be requested:
term_iri <- find_term('maxilla', matchType='exact')
# turn it into a terminfo object
obj <- as.terminfo(term_iri, withClassification=TRUE)
class(obj)
#> [1] "terminfo" "list"    
obj
#> terminfo 'maxilla' http://purl.obolibrary.org/obo/UBERON_0002397
#> Definition: The bone which normally forms the lateral upper jaw in osteichthyans, including tetrapods.
#> Synonyms:
#>     upper jaw bone (broad)
#>     maxillae (related)
#>     maxillary bone (related)
#> Relationships:
#>     contributes to morphology of jaw skeleton
#>     adjacent to premaxilla
#>     part of dermatocranium
#>     part of skeleton of upper jaw
#>     in lateral side of facial skeleton
#>     develops from maxillary process mesenchyme from neural crest
#> Subclass of:
#>     anatomical entity and develops from some maxillary process mesenchyme from neural crest
#>     anatomical entity and part of some dermatocranium
#>     bone of upper jaw
#>     dermal bone
#>     intramembranous bone
#>     lateral structure
#>     neural crest-derived structure
#>     pneumatized bone
#> Superclass of:
#>     maxilla (zebrafish)
#>     maxilla and (part_of some larva)
#>     maxilla and (part_of some larva)

# taxon terms have additional properties: 
term_iri <- find_term('Coralliozetus angelicus', matchType='exact')
# turn it into a terminfo object
obj <- as.terminfo(term_iri)
class(obj)
#> [1] "terminfo" "list"    
obj
#> terminfo 'Coralliozetus angelicus' http://purl.obolibrary.org/obo/VTO_0042957
#> Synonyms:
#>     Angel blenny (related)
#>     Emblemaria angelica (related)
#> Subclass of:
#>     Coralliozetus
#> Extinct: FALSE
#> Rank: species
#> Common Name: Angel blenny