Add a source_type check to the WHERE of the generated query
Fully implement support for linking!