validator: validate the expected types found

The crawler gets the expected types for a linked document from the
schema and create a DocumentSpec for the new document. During validation
of the new document, the type is matched against the list of expected
types and an error is thrown if the type is wrong. The error message
contains the source of the link.