createRepresentation interally with id
refactor EntityWithSource
refactor EntityWithMetadata