The validator should enforce:
- that the value matches the pattern for an EntitySchema ID (make sure the match is case-sensitive too!); and
- that an EntitySchema with this ID actually exists (it may be deleted later, but we should enforce existence at the time the value is created).
Compare e.g. the validator-factory-callback of PT:commonsMedia in WikibaseRepo.datatypes.php.