} else if (value instanceof RDFNode) {
return (RDFNode) value;
} else if (value instanceof IRI) {
return new NamedNodeImpl(URI.create(((IRI)value).iri.toString()));
} 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()));