public Resource ToResource(org.openrdf.model.Value value)
 {
     if (value == null)
     {
         return(null);
     }
     if (value is LiteralWrapper)
     {
         return(((LiteralWrapper)value).r);
     }
     if (value is org.openrdf.model.Literal)
     {
         org.openrdf.model.Literal literal = (org.openrdf.model.Literal)value;
         return(new Literal(literal.getLabel(), literal.getLanguage(), literal.getDatatype() == null ? null : literal.getDatatype().toString()));
     }
     else
     {
         return(ToEntity(value));
     }
 }
 static Literal GetLiteral(org.openrdf.model.Literal literal)
 {
     return(new Literal(literal.getLabel(), literal.getLanguage(),
                        literal.getDatatype() == null ? null
                                     : literal.getDatatype().toString()));
 }