} else if (value instanceof PlainLiteral) {
PlainLiteral pl = (PlainLiteral)value;
String lang = pl.language != null ? pl.language.toString() : null;
return new PlainLiteralImpl(pl.lexical.toString(), lang);
} else if (value instanceof TypedLiteral) {
TypedLiteral tl = (TypedLiteral)value;
return new TypedLiteralImpl(tl.lexical.toString(), URI.create(tl.datatype.toString()));
} else if (value instanceof BNode) {
return new BlankNodeImpl(((BNode)value).label.toString());
} else {
// Sherpa passes strings as something other than java.lang.String, so convert.