Make Graph#entity strict

Use Graph#hasEntity for the previous behavior.