{"record":{"id":"35ff8969c9c5c091","repo":"stanfordnlp/CoreNLP","slug":"not-implemented","errorCode":null,"errorMessage":"not implemented!","messagePattern":"not implemented!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/scenegraph/OpenIEParser.java","lineNumber":28,"sourceCode":"import edu.stanford.nlp.pipeline.Annotation;\nimport edu.stanford.nlp.pipeline.StanfordCoreNLP;\nimport edu.stanford.nlp.semgraph.SemanticGraph;\nimport edu.stanford.nlp.util.CoreMap;\n\npublic class OpenIEParser extends AbstractSceneGraphParser {\n\n\n  public OpenIEParser() {\n    Properties props = new Properties();\n    props.setProperty(\"annotators\", \"tokenize,ssplit,parse,depparse,lemma,ner,dcoref,natlog,openie\");\n    props.setProperty(\"depparse.model\", \"/Users/sebschu/Dropbox/Uni/RA/VisualGenome/parser-models/run0.gz\");\n    props.setProperty(\"depparse.extradependencies\", \"MAXIMAL\");\n    this.pipeline = new StanfordCoreNLP(props);\n  }\n\n  @Override\n  public SceneGraph parse(SemanticGraph sg) {\n   throw new RuntimeException(\"not implemented!\");\n  }\n\n  @Override\n  public SceneGraph parse(Annotation annotation) {\n\n    SceneGraph sg = new SceneGraph();\n\n    /*for (CoreMap sentence : annotation.get(CoreAnnotations.SentencesAnnotation.class)) {\n      for (RelationTriple extraction : sentence.get(NaturalLogicAnnotations.RelationTriplesAnnotation.class)) {\n\n\n        String[] subjParts = extraction.subjectGloss().split(\" \");\n        String[] objParts = extraction.objectGloss().split(\" \");\n        String subj = extraction.subjectHead().toString(OutputFormat.VALUE_INDEX);\n        String obj = extraction.objectHead().toString(OutputFormat.VALUE_INDEX);\n\n        String pred = extraction.relationLemmaGloss();\n","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/scenegraph/OpenIEParser.java#L10-L46","documentation":"OpenIEParser.parse(SemanticGraph) is deliberately unimplemented and throws RuntimeException(\"not implemented!\") at src/edu/stanford/nlp/scenegraph/OpenIEParser.java:28. OpenIE-based scene graph parsing only supports parsing from a full Annotation; the SemanticGraph overload exists solely to satisfy the abstract base class.","triggerScenarios":"Calling parse(sg) on an OpenIEParser instance with a SemanticGraph — e.g. reusing code written for the dependency-based parser instead of calling parse(Annotation).","commonSituations":"Migrating from Dcoref/dependency parsers to OpenIEParser while keeping the SemanticGraph call site; generic benchmark harnesses that dispatch on the SemanticGraph overload.","solutions":["Build a CoreNLP Annotation (with tokenize/ssplit/pos/lemma/depparse/OpenIE pipeline) and call parse(annotation) instead.","Use a parser implementation that supports SemanticGraph input if a graph is all you have.","Wrap OpenIEParser behind an adapter that accepts SemanticGraph but throws a clearer error or converts input."],"exampleFix":"// before\nSceneGraph g = openIEParser.parse(sg); // throws\n// after\nAnnotation ann = new Annotation(text);\npipeline.annotate(ann); // full CoreNLP pipeline\nSceneGraph g = openIEParser.parse(ann);","handlingStrategy":"type-guard","validationCode":"if (!(input instanceof Annotation)) throw new IllegalArgumentException(\"OpenIEParser only accepts Annotation\");","typeGuard":"boolean isOpenIECapableInput(Object o) { return o instanceof Annotation; }","tryCatchPattern":"try {\n  return parser.parse(input);\n} catch (RuntimeException e) {\n  if (e.getMessage().contains(\"not implemented\")) throw new UnsupportedOperationException(\"Use parse(Annotation) with OpenIEParser\");\n  throw e;\n}","preventionTips":["Always run the full CoreNLP pipeline and pass the Annotation","Don't reuse SemanticGraph-based call sites when switching to OpenIEParser","Centralize parser selection so overload misuse is caught in one place"],"tags":["java","unimplemented","openie","scenegraph"],"backgroundTag":"method-not-implemented","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"}