} else if(nodeDef instanceof org.openrdf.model.BNode) {
node = new BNode(((org.openrdf.model.BNode)nodeDef).getID());
} else if(nodeDef instanceof org.openrdf.model.Literal) {
org.openrdf.model.Literal nodeLiteral = (org.openrdf.model.Literal)nodeDef;
if(nodeLiteral.getLanguage() != null) {
node = new Literal(nodeLiteral.getLabel(), nodeLiteral.getLanguage());
} else if(nodeLiteral.getDatatype() != null) {
node = new Literal(nodeLiteral.getLabel(), new URI(nodeLiteral.getDatatype().stringValue()));
} else {
node = new Literal(nodeLiteral.getLabel());
}
} else {
log.error("unknown result node type: {}",nodeDef);
}