Change extract to jsonSerialize.
Remove unneeded method.
Add @type to resource entity JSON-LD.