Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't duplicate_level() if the level has an attribute defined #250

Open
samgregory opened this issue Jul 1, 2021 · 0 comments
Open

Can't duplicate_level() if the level has an attribute defined #250

samgregory opened this issue Jul 1, 2021 · 0 comments

Comments

@samgregory
Copy link

samgregory commented Jul 1, 2021

I came across an issue today where I wanted to duplicate the bundle level with a transcription attribute (from a database built using convert_txtCollection). The function goes to duplicate the attributes on this level as expected (

# add attributeDefintions
attrDefs = list_attributeDefinitions(emuDBhandle, levelName)
for(i in 1:nrow(attrDefs)){
if(attrDefs[i,]$name != levelName){
internal_add_attributeDefinition(emuDBhandle,
levelName = duplicateLevelName,
name = attrDefs[i,]$name,
type = attrDefs[i,]$type,
rewriteAllAnnots = FALSE,
verbose = verbose,
insertLabels = F)
}
) but then because the interal_add_attributeDefinition function does a check for that attribute name in the database it will always throw this error:
if(name %in% lads$name){
stop("attributeDefinition with name '", name, "' already exists on level '", ln, "'! Currently, only unique attributeDefinition names are allowed within a single emuDB.")
}

I want to be able to duplicate the level inclusive of the transcription attribute - can we have a way to rename this attribute when it is duplicated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant