Is there an opposite / reverse of entity_uri()? I understand that entity_uri() generates a uri for a profied entity

http://api.drupal.org/api/drupal/includes--common.inc/function/entity_uri

However, is it possible to go the other way? is there a function in drupal to pass a system uri and see if it's an entity? and then return the entity object?
I'm afraid there's nothing (existing at least) that will do that, the URI function is provided by the module implementing the entity (in hook_entity_info()) and the method within that function is completely transparent to Drupal...the core entity module doesn't give modules the chance to implement a function that reverses the process, nor does it store how the conversion was made.

Because of this I don't think a fully generic function is possible, however you could do it on a type-by-type basis:

$uri = entity_uri('node', $entity);
if (preg_match('/node\/([0-9+])/', $uri, $matches)) {
  $entity2 = entity_load('node', array($matches[1]));
}


You could then extract that logic to build a slightly more generic function based on the known attributes of your Drupal installation...it's not a pretty way to do it though, I'd love to hear a different solution to this.