docs: def pyrdf2(value, class_type=None, datatype=None, lang=None, **kwargs):
      """ Coverts an input to one of the rdfdatatypes classes
  
          Args:
              value: any rdfdatatype, json dict or vlaue
              class_type: "literal", "uri" or "blanknode"
              datatype: "xsd:string", "xsd:int" , etc
      """
      try:
  
          if isinstance(value, dict):
              # test to see if the type is a literal, a literal will have a another
              # dictionary key call datatype. Feed the datatype to the lookup to
              # return the value else convert it to a XsdString
              if value.get('type') == "literal":
                  if not value.get("datatype"):
                      return XsdString(value['value'])
                  else:
                      try:
                          if value.get("lang"):
                              # The lang keyword only applies to XsdString types
                              return DT_LOOKUP[value['datatype']](value['value'],
                                      lang=value.get("lang"))
                          else:
                              return DT_LOOKUP[value['datatype']](value['value'])
                      except:
                          rtn_val = BaseRdfDataType(value['value'])
                          rtn_val.datatype = Uri(value['datatype'])
                          return rtn_val
              else:
                  return DT_LOOKUP[value['type']](value['value'])
          elif isinstance(value, BaseRdfDataType):
              return value
          else:
              return DT_LOOKUP[type(value)](value)
      except:
          pdb.set_trace()
          pass