protected static org.openrdf.model.Value getValue(Value value) {
if (value instanceof Resource) {
Resource resource = (Resource)value;
return getResource(resource);
} else if (value instanceof Literal) {
Literal literal = (Literal)value;
if (literal.getLanguage() != null) {
return new LiteralImpl(literal.getLabel(), literal.getLanguage());
} else if (literal.getDatatype() != null) {
return new LiteralImpl(literal.getLabel(), new org.openrdf.model.impl.URIImpl(literal.getDatatype().getURI()));
} else if (literal.getLabel() != null){//XXX
return new LiteralImpl(literal.getLabel());
} else
return null;
} else {
return null;
}