{"record":{"id":"ea3420179e7ed701","repo":"stanfordnlp/CoreNLP","slug":"invalid-relation-mention-argument-role-role","errorCode":null,"errorMessage":"Invalid relation mention argument role: ${role}","messagePattern":"Invalid relation mention argument role: (.+?)","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/ie/machinereading/domains/ace/reader/AceDomReader.java","lineNumber":77,"sourceCode":"\n    // create the mention\n    AceRelationMention mention = new AceRelationMention(id, extent, lc);\n\n    // find the mention args\n    List<Node> args = getChildrenByName(node, \"relation_mention_argument\");\n    for(Node arg: args){\n      String role = getAttributeValue(arg, \"ROLE\");\n      String refid = getAttributeValue(arg, \"REFID\");\n      AceEntityMention am = doc.getEntityMention(refid);\n\n      if(am != null){\n      \tam.addRelationMention(mention);\n      \tif(role.equalsIgnoreCase(\"arg-1\")){\n      \t\tmention.getArgs()[0] = new AceRelationMentionArgument(role, am);\n      \t} else if(role.equalsIgnoreCase(\"arg-2\")){\n      \t\tmention.getArgs()[1] = new AceRelationMentionArgument(role, am);\n      \t} else {\n      \t\tthrow new RuntimeException(\"Invalid relation mention argument role: \" + role);\n      \t}\n      }\n    }\n\n    return mention;\n  }\n\n  /**\n   * Extracts info about one relation mention\n   */\n  private static AceEventMention parseEventMention(Node node,\n               AceDocument doc) {\n    String id = getAttributeValue(node, \"ID\");\n    AceCharSeq extent = parseCharSeq(getChildByName(node, \"extent\"));\n    AceCharSeq anchor = parseCharSeq(getChildByName(node, \"anchor\"));\n\n    // create the mention\n    AceEventMention mention = new AceEventMention(id, extent, anchor);","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/ie/machinereading/domains/ace/reader/AceDomReader.java#L59-L95","documentation":"An ACE corpus parsing failure in AceDomReader.parseRelationMention: a relation_mention_argument's ROLE attribute is not one of the recognized roles (arg-1, arg-2, etc.), meaning the ACE XML contains a relation argument role the reader does not map into mention args.","triggerScenarios":"Parsing an ACE .apf.xml relation that contains an argument with a role other than arg-1/arg-2 (case-insensitive), e.g. time or place arguments, or a corpus variant emitting different role names.","commonSituations":"Processing ACE corpora or extensions with extra relation argument types, annotation tools writing roles in a different convention (e.g. 'Arg', 'ARG'), custom relation types added to the corpus.","solutions":["Extend parseRelationMention to handle additional roles or ignore unsupported ones instead of throwing.","Filter relations with unsupported roles in a preprocessing pass over the .apf.xml files.","Check the corpus version — standard ACE2005 relations only use arg-1/arg-2; a third role indicates a nonstandard or corrupted file.","Normalize role casing (already case-insensitive here) and strip whitespace before the check if files contain stray whitespace."],"exampleFix":"// before\n} else {\n  throw new RuntimeException(\"Invalid relation mention argument role: \" + role);\n}\n// after\n} else {\n  logger.warning(\"Ignoring unsupported relation role: \" + role);\n}","handlingStrategy":"try-catch","validationCode":"Set<String> allowed = Set.of(\"arg-1\", \"arg-2\");\nif (!allowed.contains(role.toLowerCase())) { logger.warning(\"unsupported role: \" + role); return; }","typeGuard":null,"tryCatchPattern":"try { parseRelationMention(...); } catch (RuntimeException e) { logger.warning(\"skipping relation: \" + e.getMessage()); }","preventionTips":["Pre-filter .apf.xml relations to arg-1/arg-2 roles only.","Normalize role strings (lowercase, trim) before parsing.","Extend the reader when your corpus adds new relation argument types."],"tags":["java","stanford-nlp","ace-corpus","parsing"],"backgroundTag":"invalid-enum-value","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}