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
        kwargs:
            lang: language tag

def pyrdf(value, class_type=None, datatype=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
        kwargs:
            lang: language tag
    """
    if isinstance(value, BaseRdfDataType):
        return value
    if isinstance(value, dict):
        value = value.copy()
        class_type = value.pop('type')
        try:
            datatype = value.pop('datatype')
        except KeyError:
            datatype = __TYPE_MATCH__[class_type]
        kwargs = value
        value = kwargs.pop('value')
    if not class_type:
        class_type = 'literal'
    if not datatype:
        datatype = type(value)
    try:
        # print("pyrdf: ", value, " class_type: ", class_type, " datatype: ", datatype)
        return __DT_LOOKUP__[class_type][datatype](value, **kwargs)
    except KeyError:
        rtn_val = BaseRdfDataType(value)
        rtn_val.datatype = Uri(datatype)
        return rtn_val