Skip to contents

Helper to simplify_idaifield(). Traces the liesWithin fields to find the one that is a Layer and returns the corresponding identifier.

Usage

find_layer(ids, index = NULL, layer_categories = NULL, max_depth = 20)

Arguments

ids

Either the UUIDs or the identifiers resources from an idaifield_...-list as returned by get_idaifield_docs(), idf_query(), idf_index_query() or idf_json_query().

index

A data.frame as returned by get_field_index() or make_index().

layer_categories

A vector of categories that are classified as Layers.

max_depth

numeric. Maximum number of recursive iterations / maximum depth a resource may be nested below its layer.

Value

The identifier or UUID of the first "Layer"-category resource the given id/identifier lies within.

See also

Examples

if (FALSE) { # \dontrun{
conn <- connect_idaifield(pwd = "hallo", project = "rtest")
index <- get_field_index(conn)

 # For a nested Find:
index[which(index$identifier == "Befund_1_InschriftAufMünze"), ]
find_layer("Befund_1_InschriftAufMünze", index)

# For all resources:
find_layer(index$identifier, index)
} # }