stanfordnlp/CoreNLP · error · IllegalStateException
Format is not implemented: " + FORMAT
Error message
Format is not implemented: " + FORMAT
What it means
tripleToString() formats extracted RelationTriples according to the configured output format (OpenIE.FORMAT). The switch handles REVERB, QA_SRL, and DEFAULT; any other configured format is not implemented, so an IllegalStateException is thrown. This happens during output, after successful extraction.
Solutions
- Set openie.format to one of the supported values: default, reverb, or qasrl.
- Check spelling/case of the configured format string against OpenIE.Format enum values.
- Upgrade CoreNLP if you need a format introduced after your current version.
- Validate/normalize the format option at program start rather than failing mid-output.
Example fix
// before
props.setProperty("openie.format", "json");
// after
props.setProperty("openie.format", "default"); // or reverb / qasrl Defensive patterns
Strategy: validation
Validate before calling
String fmt = props.getProperty("openie.format", "default").toLowerCase(Locale.ROOT);
if (!fmt.equals("default") && !fmt.equals("reverb") && !fmt.equals("qasrl")) {
throw new IllegalArgumentException("Unsupported openie.format: " + fmt);
} Try / catch
try {
String s = tripleToString(extraction, sentence);
} catch (IllegalStateException e) {
log.error("Invalid openie.format configured: " + e.getMessage());
} Prevention
- Validate openie.format against allowed values at startup
- Use the exact enum names (default/reverb/qasrl) in configs
- Match format options to the CoreNLP version in use
When it happens
Trigger: Setting the -openie.format property to a value other than default/reverb/qasrl (e.g. a typo or a format supported only in newer CoreNLP versions) and running OpenIE's main/CLI through processDocument.
Common situations: Typos in the openie.format CLI option; copying example configs from a different CoreNLP version where additional formats exist; case-sensitive format names.
Related errors
- Cannot output in format
- Sorry, but dependencies cannot be output as part of the…
- annotator " " requires annotation " ". The usual…
- : Entry doesn't have overwriteable types , but entry type…
- : Ignoring duplicate entry: , old type = , new type =
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/30166939747d10ad.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/naturalli/OpenIE.java:634
*
* @param extraction The triple to write.
* @param docid The document ID (for the ReVerb format)
* @param sentence The sentence the triple was extracted from (for the ReVerb format)
*
* @return A String representation of the triple.
*/
public static String tripleToString(RelationTriple extraction, String docid, CoreMap sentence) {
switch (FORMAT) {
case REVERB:
return extraction.toReverbString(docid, sentence);
case OLLIE:
return extraction.confidenceGloss() + ": (" + extraction.subjectGloss() + "; " + extraction.relationGloss() + "; " + extraction.objectGloss() + ')';
case DEFAULT:
return extraction.toString();
case QA_SRL:
return extraction.toQaSrlString(sentence);
default:
throw new IllegalStateException("Format is not implemented: " + FORMAT);
}
}
/**
* Process a single file or line of standard in.
*
* @param pipeline The annotation pipeline to run the lines of the input through.
* @param docid The docid of the document we are extracting.
* @param document the document to annotate.
*/
@SuppressWarnings("SynchronizeOnNonFinalField")
private static void processDocument(AnnotationPipeline pipeline, String docid, String document) {
// Error checks
if (document.trim().isEmpty()) {
return;
}
View on GitHub (pinned to 1b7edd19c4)