{"record":{"id":"4b97aeaa2b890c00","repo":"stanfordnlp/CoreNLP","slug":"unknown-multi-relation-s","errorCode":null,"errorMessage":"Unknown multi relation ${s}","messagePattern":"Unknown multi relation (.+?)","errorType":"validation","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/trees/tregex/Relation.java","lineNumber":193,"sourceCode":"   */\n  static TregexPattern constructMultiRelation(String s, List<DescriptionPattern> children,\n                                              Function<String, String> basicCatFunction,\n                                              HeadFinder headFinder) throws ParseException {\n    if (s.equals(\"<...\")) {\n      List<TregexPattern> newChildren = Generics.newArrayList();\n      for (int i = 0; i < children.size(); ++i) {\n        Relation rel = getRelation(\"<\", Integer.toString(i + 1), basicCatFunction, headFinder); \n        DescriptionPattern oldChild = children.get(i);\n        TregexPattern newChild = new DescriptionPattern(rel, oldChild);\n        newChildren.add(newChild);\n      }\n      Relation rel = getRelation(\"<\", Integer.toString(children.size() + 1), basicCatFunction, headFinder);\n      TregexPattern noExtraChildren = new DescriptionPattern(rel, false, \"__\", null, false, basicCatFunction, Collections.<Pair<Integer,String>>emptyList(), false, null);\n      noExtraChildren.negate();\n      newChildren.add(noExtraChildren);\n      return new CoordinationPattern(newChildren, true);\n    } else {\n      throw new ParseException(\"Unknown multi relation \" + s);\n    }\n  }\n\n  private Relation(String symbol) {\n    this.symbol = symbol;\n  }\n\n  @Override\n  public String toString() {\n    return symbol;\n  }\n\n  /**\n   * This abstract Iterator implements a NULL iterator, but by subclassing and\n   * overriding advance and/or initialize, it is an efficient implementation.\n   */\n  abstract static class SearchNodeIterator implements Iterator<Tree> {\n    public SearchNodeIterator() {","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/trees/tregex/Relation.java#L175-L211","documentation":"Relation.constructMultiRelation() builds composite patterns for multi relations (like <<, <<1) by expanding them into conjunctions of simpler relations; a symbol not recognized as a multi relation throws ParseException. It means the query used a multi-child relation the builder cannot expand.","triggerScenarios":"Calling constructMultiRelation with a symbol outside the supported multi-relation set (e.g. a typo like '<<>' or an operator from a newer/older CoreNLP), typically reached while parsing a tregex query.","commonSituations":"Hand-written tregex queries with malformed multi operators; version drift where a multi relation was added or renamed; programmatic query builders emitting wrong symbols.","solutions":["Use a supported multi relation symbol (e.g. <<, <<1 style indexed forms) in the query","Check the constructMultiRelation source/switch for the exact symbols handled in your version","Fix typos in the multi-operator prefix (extra/missing angle brackets)","Upgrade CoreNLP if the query relies on a multi relation your version lacks"],"exampleFix":"// before\nString q = \"A <<> B\"; // unknown multi relation\n// after\nString q = \"A << B\"; // supported multi relation","handlingStrategy":"try-catch","validationCode":"Set<String> multiRels = Set.of(\"<<\", \"<<1\", \"<<'\", \"<<'\"); // per-version whitelist\nif (!multiRels.contains(s)) throw new IllegalArgumentException(\"Unknown multi relation: \" + s);","typeGuard":null,"tryCatchPattern":"try {\n  Relation.constructMultiRelation(s, basicCatFunction, headFinder, children);\n} catch (ParseException e) {\n  throw new TregexQueryException(\"Unsupported multi relation '\" + s + \"'\", e);\n}","preventionTips":["Use only documented multi relations in generated or hand-written queries","Pin and test the CoreNLP version your query syntax targets","Sanitize programmatic query builders to emit only whitelisted operators"],"tags":["java","tregex","parse-error","query"],"backgroundTag":"invalid-identifier-format","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}