#NEWLINE# def parseJsonTerm( d ) : #NEWLINE# #INDENT# "rdflib object (Literal, URIRef, BNode) for the given json-format dict.\n\n    input is like:\n      { 'type': 'uri', 'value': 'http://famegame.com/2006/01/username' }\n      { 'type': 'literal', 'value': 'drewp' }\n    " #NEWLINE# t = d [ 'type' ] #NEWLINE# if ( t == 'uri' ) : #NEWLINE# #INDENT# return URIRef ( d [ 'value' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( t == 'literal' ) : #NEWLINE# #INDENT# if ( 'xml:lang' in d ) : #NEWLINE# #INDENT# return Literal ( d [ 'value' ] , lang = d [ 'xml:lang' ] ) #NEWLINE# #UNINDENT# return Literal ( d [ 'value' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( t == 'typed-literal' ) : #NEWLINE# #INDENT# return Literal ( d [ 'value' ] , datatype = URIRef ( d [ 'datatype' ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( t == 'bnode' ) : #NEWLINE# #INDENT# return BNode ( d [ 'value' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise NotImplementedError ( ( 'json term type %r' % t ) )