AddListRemoveLinkDefinition: Add / List / Remove linkDefinition to / of / from emuDB

AddListRemoveLinkDefinitionR Documentation

Add / List / Remove linkDefinition to / of / from emuDB

Description

Add / List / Remove new link definition to / of / from emuDB. A link definition specifies the relationship between two levels, the super-level and the sub-level. The entirety of all link definitions of a emuDB specifies the hierarchical structure of the database. For more information on the structural elements of an emuDB see vignette(emuDB).

Usage

add_linkDefinition(emuDBhandle, type, superlevelName, sublevelName)

list_linkDefinitions(emuDBhandle)

remove_linkDefinition(
  emuDBhandle,
  superlevelName,
  sublevelName,
  force = FALSE,
  verbose = TRUE
)

Arguments

emuDBhandle

emuDB handle as returned by load_emuDB

type

type of linkDefinition (either "ONE_TO_MANY", "MANY_TO_MANY" or "ONE_TO_ONE")

superlevelName

name of super-level of linkDefinition

sublevelName

name of sub-level of linkDefinition

force

delete all links belonging to the linkDefinition (USE WITH CAUTION! VERY INVASIVE AKTION!)

verbose

be verbose. Ask to delete links if force is TRUE.

Details

Link type descriptions:

  • "ONE_TO_MANY": A single ITEM of the super-level can be linked to multiple ITEMs of the sub-level

  • "MANY_TO_MANY": Multiple ITEMs of the super-level can be linked to multiple ITEMs of the sub-level

  • "ONE_TO_ONE": A single ITEM of the super-level can be linked to a single ITEM of the sub-level

For all link types the rule applies that no links are allowed to cross any other links. Further, a linkDefinition can not be removed, if there are links present in the emuDB.

Examples

## Not run: 

##################################
# prerequisite: loaded emuDB that was converted
# using the convert_TextGridCollection function called myTGcolDB
# (see ?load_emuDB and ?convert_TextGridCollection for more information)

# add link definition from super-level "Phoneme"
# to sub-level "Phonetic" of type "ONE_TO_MANY"
# for myTGcolDB emuDB
add_linkDefinition(emuDBhandle = myTGcolDB,
                   type = "ONE_TO_MANY",
                   superlevelName = "Phoneme",
                   sublevelName = "Phonetic")

# list link definitions for myTGcolDB emuDB
list_linkDefinitions(emuDBhandle = myTGcolDB)

# remove newly added link definition
remove_linkDefinition(emuDBhandle = myTGcolDB,
                      superlevelName = "Phoneme",
                      sublevelName = "Phonetic")



## End(Not run)

emuR documentation built on Nov. 4, 2023, 1:06 a.m.