if (node instanceof NamedNode) {
result = com.hp.hpl.jena.graph.Node
.createURI(((NamedNode) node).getURIRef());
} else {
if (node instanceof PlainLiteralNode) {
PlainLiteralNode lit = (PlainLiteralNode) node;
result = com.hp.hpl.jena.graph.Node.createLiteral(
lit.getLexicalForm(),
lit.getLocale() == null ? null : lit
.getLocale().toString(), false);
} else {
TypedLiteralNode lit = (TypedLiteralNode) node;
result = com.hp.hpl.jena.graph.Node.createLiteral(
lit.getLexicalForm(), null, TypeMapper
.getInstance().getSafeTypeByName(
lit.getDataType()
.toString()));
}
}
} else {
result = com.hp.hpl.jena.graph.Node.createAnon();