+ seen.add(str(r['type'].uri))
+ if node.is_literal():
+ # literal is a generic type.
+ nodetype = node.literal_value['datatype']
+ if nodetype is None:
+ # lets default to string
+ nodetype = xsdNS['string'].uri
+ if r['type'] == rdfsNS['Literal']:
+ pass
+ elif nodetype != r['type'].uri:
+ return type_error.format(
+ str(node), nodetype, r['type'])
+ # check that node is the expetected class type