code: def create_resource(self, uri):
          
          if isinstance(uri, str):
              uri = URI(uri)
          try:
              resource = self.resource_factory[uri.extension](uri)
          except KeyError:
              resource = self.resource_factory['*'](uri)
          self.resources[uri.normalize()] = resource
          resource.resource_set = self
          resource.decoders.insert(0, self)
          return resource
docs: Creates a new Resource.
  
          The created ressource type depends on the used URI.
  
          :param uri: the resource URI
          :type uri: URI
          :return: a new Resource
          :rtype: Resource
  
          .. seealso:: URI, Resource, XMIResource